@aws-sdk/client-bedrock-agentcore 3.847.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +413 -0
  3. package/dist-cjs/BedrockAgentCore.js +63 -0
  4. package/dist-cjs/BedrockAgentCoreClient.js +54 -0
  5. package/dist-cjs/auth/httpAuthExtensionConfiguration.js +43 -0
  6. package/dist-cjs/auth/httpAuthSchemeProvider.js +47 -0
  7. package/dist-cjs/commands/CreateEventCommand.js +27 -0
  8. package/dist-cjs/commands/DeleteEventCommand.js +26 -0
  9. package/dist-cjs/commands/DeleteMemoryRecordCommand.js +26 -0
  10. package/dist-cjs/commands/GetBrowserSessionCommand.js +26 -0
  11. package/dist-cjs/commands/GetCodeInterpreterSessionCommand.js +26 -0
  12. package/dist-cjs/commands/GetEventCommand.js +27 -0
  13. package/dist-cjs/commands/GetMemoryRecordCommand.js +27 -0
  14. package/dist-cjs/commands/GetResourceApiKeyCommand.js +27 -0
  15. package/dist-cjs/commands/GetResourceOauth2TokenCommand.js +27 -0
  16. package/dist-cjs/commands/GetWorkloadAccessTokenCommand.js +27 -0
  17. package/dist-cjs/commands/GetWorkloadAccessTokenForJWTCommand.js +27 -0
  18. package/dist-cjs/commands/GetWorkloadAccessTokenForUserIdCommand.js +27 -0
  19. package/dist-cjs/commands/InvokeAgentRuntimeCommand.js +27 -0
  20. package/dist-cjs/commands/InvokeCodeInterpreterCommand.js +31 -0
  21. package/dist-cjs/commands/ListActorsCommand.js +26 -0
  22. package/dist-cjs/commands/ListBrowserSessionsCommand.js +26 -0
  23. package/dist-cjs/commands/ListCodeInterpreterSessionsCommand.js +26 -0
  24. package/dist-cjs/commands/ListEventsCommand.js +27 -0
  25. package/dist-cjs/commands/ListMemoryRecordsCommand.js +27 -0
  26. package/dist-cjs/commands/ListSessionsCommand.js +26 -0
  27. package/dist-cjs/commands/RetrieveMemoryRecordsCommand.js +27 -0
  28. package/dist-cjs/commands/StartBrowserSessionCommand.js +26 -0
  29. package/dist-cjs/commands/StartCodeInterpreterSessionCommand.js +26 -0
  30. package/dist-cjs/commands/StopBrowserSessionCommand.js +26 -0
  31. package/dist-cjs/commands/StopCodeInterpreterSessionCommand.js +26 -0
  32. package/dist-cjs/commands/UpdateBrowserStreamCommand.js +26 -0
  33. package/dist-cjs/commands/index.js +29 -0
  34. package/dist-cjs/endpoint/EndpointParameters.js +17 -0
  35. package/dist-cjs/endpoint/endpointResolver.js +18 -0
  36. package/dist-cjs/endpoint/ruleset.js +7 -0
  37. package/dist-cjs/extensionConfiguration.js +2 -0
  38. package/dist-cjs/index.js +11 -0
  39. package/dist-cjs/models/BedrockAgentCoreServiceException.js +12 -0
  40. package/dist-cjs/models/index.js +4 -0
  41. package/dist-cjs/models/models_0.js +468 -0
  42. package/dist-cjs/pagination/Interfaces.js +2 -0
  43. package/dist-cjs/pagination/ListActorsPaginator.js +7 -0
  44. package/dist-cjs/pagination/ListEventsPaginator.js +7 -0
  45. package/dist-cjs/pagination/ListMemoryRecordsPaginator.js +7 -0
  46. package/dist-cjs/pagination/ListSessionsPaginator.js +7 -0
  47. package/dist-cjs/pagination/RetrieveMemoryRecordsPaginator.js +7 -0
  48. package/dist-cjs/pagination/index.js +9 -0
  49. package/dist-cjs/protocols/Aws_restJson1.js +1423 -0
  50. package/dist-cjs/runtimeConfig.browser.js +41 -0
  51. package/dist-cjs/runtimeConfig.js +58 -0
  52. package/dist-cjs/runtimeConfig.native.js +15 -0
  53. package/dist-cjs/runtimeConfig.shared.js +36 -0
  54. package/dist-cjs/runtimeExtensions.js +13 -0
  55. package/dist-es/BedrockAgentCore.js +59 -0
  56. package/dist-es/BedrockAgentCoreClient.js +50 -0
  57. package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
  58. package/dist-es/auth/httpAuthSchemeProvider.js +41 -0
  59. package/dist-es/commands/CreateEventCommand.js +23 -0
  60. package/dist-es/commands/DeleteEventCommand.js +22 -0
  61. package/dist-es/commands/DeleteMemoryRecordCommand.js +22 -0
  62. package/dist-es/commands/GetBrowserSessionCommand.js +22 -0
  63. package/dist-es/commands/GetCodeInterpreterSessionCommand.js +22 -0
  64. package/dist-es/commands/GetEventCommand.js +23 -0
  65. package/dist-es/commands/GetMemoryRecordCommand.js +23 -0
  66. package/dist-es/commands/GetResourceApiKeyCommand.js +23 -0
  67. package/dist-es/commands/GetResourceOauth2TokenCommand.js +23 -0
  68. package/dist-es/commands/GetWorkloadAccessTokenCommand.js +23 -0
  69. package/dist-es/commands/GetWorkloadAccessTokenForJWTCommand.js +23 -0
  70. package/dist-es/commands/GetWorkloadAccessTokenForUserIdCommand.js +23 -0
  71. package/dist-es/commands/InvokeAgentRuntimeCommand.js +23 -0
  72. package/dist-es/commands/InvokeCodeInterpreterCommand.js +27 -0
  73. package/dist-es/commands/ListActorsCommand.js +22 -0
  74. package/dist-es/commands/ListBrowserSessionsCommand.js +22 -0
  75. package/dist-es/commands/ListCodeInterpreterSessionsCommand.js +22 -0
  76. package/dist-es/commands/ListEventsCommand.js +23 -0
  77. package/dist-es/commands/ListMemoryRecordsCommand.js +23 -0
  78. package/dist-es/commands/ListSessionsCommand.js +22 -0
  79. package/dist-es/commands/RetrieveMemoryRecordsCommand.js +23 -0
  80. package/dist-es/commands/StartBrowserSessionCommand.js +22 -0
  81. package/dist-es/commands/StartCodeInterpreterSessionCommand.js +22 -0
  82. package/dist-es/commands/StopBrowserSessionCommand.js +22 -0
  83. package/dist-es/commands/StopCodeInterpreterSessionCommand.js +22 -0
  84. package/dist-es/commands/UpdateBrowserStreamCommand.js +22 -0
  85. package/dist-es/commands/index.js +26 -0
  86. package/dist-es/endpoint/EndpointParameters.js +13 -0
  87. package/dist-es/endpoint/endpointResolver.js +14 -0
  88. package/dist-es/endpoint/ruleset.js +4 -0
  89. package/dist-es/extensionConfiguration.js +1 -0
  90. package/dist-es/index.js +6 -0
  91. package/dist-es/models/BedrockAgentCoreServiceException.js +8 -0
  92. package/dist-es/models/index.js +1 -0
  93. package/dist-es/models/models_0.js +421 -0
  94. package/dist-es/pagination/Interfaces.js +1 -0
  95. package/dist-es/pagination/ListActorsPaginator.js +4 -0
  96. package/dist-es/pagination/ListEventsPaginator.js +4 -0
  97. package/dist-es/pagination/ListMemoryRecordsPaginator.js +4 -0
  98. package/dist-es/pagination/ListSessionsPaginator.js +4 -0
  99. package/dist-es/pagination/RetrieveMemoryRecordsPaginator.js +4 -0
  100. package/dist-es/pagination/index.js +6 -0
  101. package/dist-es/protocols/Aws_restJson1.js +1367 -0
  102. package/dist-es/runtimeConfig.browser.js +36 -0
  103. package/dist-es/runtimeConfig.js +53 -0
  104. package/dist-es/runtimeConfig.native.js +11 -0
  105. package/dist-es/runtimeConfig.shared.js +32 -0
  106. package/dist-es/runtimeExtensions.js +9 -0
  107. package/dist-types/BedrockAgentCore.d.ts +192 -0
  108. package/dist-types/BedrockAgentCoreClient.d.ts +223 -0
  109. package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
  110. package/dist-types/auth/httpAuthSchemeProvider.d.ts +75 -0
  111. package/dist-types/commands/CreateEventCommand.d.ts +133 -0
  112. package/dist-types/commands/DeleteEventCommand.d.ts +96 -0
  113. package/dist-types/commands/DeleteMemoryRecordCommand.d.ts +94 -0
  114. package/dist-types/commands/GetBrowserSessionCommand.d.ts +108 -0
  115. package/dist-types/commands/GetCodeInterpreterSessionCommand.d.ts +93 -0
  116. package/dist-types/commands/GetEventCommand.d.ts +117 -0
  117. package/dist-types/commands/GetMemoryRecordCommand.d.ts +104 -0
  118. package/dist-types/commands/GetResourceApiKeyCommand.d.ts +91 -0
  119. package/dist-types/commands/GetResourceOauth2TokenCommand.d.ts +102 -0
  120. package/dist-types/commands/GetWorkloadAccessTokenCommand.d.ts +90 -0
  121. package/dist-types/commands/GetWorkloadAccessTokenForJWTCommand.d.ts +91 -0
  122. package/dist-types/commands/GetWorkloadAccessTokenForUserIdCommand.d.ts +91 -0
  123. package/dist-types/commands/InvokeAgentRuntimeCommand.d.ts +126 -0
  124. package/dist-types/commands/InvokeCodeInterpreterCommand.d.ts +174 -0
  125. package/dist-types/commands/ListActorsCommand.d.ts +100 -0
  126. package/dist-types/commands/ListBrowserSessionsCommand.d.ts +100 -0
  127. package/dist-types/commands/ListCodeInterpreterSessionsCommand.d.ts +100 -0
  128. package/dist-types/commands/ListEventsCommand.d.ts +128 -0
  129. package/dist-types/commands/ListMemoryRecordsCommand.d.ts +111 -0
  130. package/dist-types/commands/ListSessionsCommand.d.ts +103 -0
  131. package/dist-types/commands/RetrieveMemoryRecordsCommand.d.ts +115 -0
  132. package/dist-types/commands/StartBrowserSessionCommand.d.ts +111 -0
  133. package/dist-types/commands/StartCodeInterpreterSessionCommand.d.ts +98 -0
  134. package/dist-types/commands/StopBrowserSessionCommand.d.ts +97 -0
  135. package/dist-types/commands/StopCodeInterpreterSessionCommand.d.ts +97 -0
  136. package/dist-types/commands/UpdateBrowserStreamCommand.d.ts +111 -0
  137. package/dist-types/commands/index.d.ts +26 -0
  138. package/dist-types/endpoint/EndpointParameters.d.ts +38 -0
  139. package/dist-types/endpoint/endpointResolver.d.ts +5 -0
  140. package/dist-types/endpoint/ruleset.d.ts +2 -0
  141. package/dist-types/extensionConfiguration.d.ts +9 -0
  142. package/dist-types/index.d.ts +14 -0
  143. package/dist-types/models/BedrockAgentCoreServiceException.d.ts +14 -0
  144. package/dist-types/models/index.d.ts +1 -0
  145. package/dist-types/models/models_0.d.ts +2440 -0
  146. package/dist-types/pagination/Interfaces.d.ts +8 -0
  147. package/dist-types/pagination/ListActorsPaginator.d.ts +7 -0
  148. package/dist-types/pagination/ListEventsPaginator.d.ts +7 -0
  149. package/dist-types/pagination/ListMemoryRecordsPaginator.d.ts +7 -0
  150. package/dist-types/pagination/ListSessionsPaginator.d.ts +7 -0
  151. package/dist-types/pagination/RetrieveMemoryRecordsPaginator.d.ts +7 -0
  152. package/dist-types/pagination/index.d.ts +6 -0
  153. package/dist-types/protocols/Aws_restJson1.d.ts +236 -0
  154. package/dist-types/runtimeConfig.browser.d.ts +52 -0
  155. package/dist-types/runtimeConfig.d.ts +52 -0
  156. package/dist-types/runtimeConfig.native.d.ts +51 -0
  157. package/dist-types/runtimeConfig.shared.d.ts +22 -0
  158. package/dist-types/runtimeExtensions.d.ts +17 -0
  159. package/dist-types/ts3.4/BedrockAgentCore.d.ts +449 -0
  160. package/dist-types/ts3.4/BedrockAgentCoreClient.d.ts +288 -0
  161. package/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +32 -0
  162. package/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +47 -0
  163. package/dist-types/ts3.4/commands/CreateEventCommand.d.ts +47 -0
  164. package/dist-types/ts3.4/commands/DeleteEventCommand.d.ts +47 -0
  165. package/dist-types/ts3.4/commands/DeleteMemoryRecordCommand.d.ts +51 -0
  166. package/dist-types/ts3.4/commands/GetBrowserSessionCommand.d.ts +51 -0
  167. package/dist-types/ts3.4/commands/GetCodeInterpreterSessionCommand.d.ts +51 -0
  168. package/dist-types/ts3.4/commands/GetEventCommand.d.ts +47 -0
  169. package/dist-types/ts3.4/commands/GetMemoryRecordCommand.d.ts +50 -0
  170. package/dist-types/ts3.4/commands/GetResourceApiKeyCommand.d.ts +51 -0
  171. package/dist-types/ts3.4/commands/GetResourceOauth2TokenCommand.d.ts +51 -0
  172. package/dist-types/ts3.4/commands/GetWorkloadAccessTokenCommand.d.ts +51 -0
  173. package/dist-types/ts3.4/commands/GetWorkloadAccessTokenForJWTCommand.d.ts +51 -0
  174. package/dist-types/ts3.4/commands/GetWorkloadAccessTokenForUserIdCommand.d.ts +51 -0
  175. package/dist-types/ts3.4/commands/InvokeAgentRuntimeCommand.d.ts +66 -0
  176. package/dist-types/ts3.4/commands/InvokeCodeInterpreterCommand.d.ts +51 -0
  177. package/dist-types/ts3.4/commands/ListActorsCommand.d.ts +47 -0
  178. package/dist-types/ts3.4/commands/ListBrowserSessionsCommand.d.ts +51 -0
  179. package/dist-types/ts3.4/commands/ListCodeInterpreterSessionsCommand.d.ts +51 -0
  180. package/dist-types/ts3.4/commands/ListEventsCommand.d.ts +47 -0
  181. package/dist-types/ts3.4/commands/ListMemoryRecordsCommand.d.ts +50 -0
  182. package/dist-types/ts3.4/commands/ListSessionsCommand.d.ts +47 -0
  183. package/dist-types/ts3.4/commands/RetrieveMemoryRecordsCommand.d.ts +51 -0
  184. package/dist-types/ts3.4/commands/StartBrowserSessionCommand.d.ts +51 -0
  185. package/dist-types/ts3.4/commands/StartCodeInterpreterSessionCommand.d.ts +51 -0
  186. package/dist-types/ts3.4/commands/StopBrowserSessionCommand.d.ts +51 -0
  187. package/dist-types/ts3.4/commands/StopCodeInterpreterSessionCommand.d.ts +51 -0
  188. package/dist-types/ts3.4/commands/UpdateBrowserStreamCommand.d.ts +51 -0
  189. package/dist-types/ts3.4/commands/index.d.ts +26 -0
  190. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +51 -0
  191. package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
  192. package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
  193. package/dist-types/ts3.4/extensionConfiguration.d.ts +9 -0
  194. package/dist-types/ts3.4/index.d.ts +9 -0
  195. package/dist-types/ts3.4/models/BedrockAgentCoreServiceException.d.ts +9 -0
  196. package/dist-types/ts3.4/models/index.d.ts +1 -0
  197. package/dist-types/ts3.4/models/models_0.d.ts +872 -0
  198. package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
  199. package/dist-types/ts3.4/pagination/ListActorsPaginator.d.ts +11 -0
  200. package/dist-types/ts3.4/pagination/ListEventsPaginator.d.ts +11 -0
  201. package/dist-types/ts3.4/pagination/ListMemoryRecordsPaginator.d.ts +11 -0
  202. package/dist-types/ts3.4/pagination/ListSessionsPaginator.d.ts +11 -0
  203. package/dist-types/ts3.4/pagination/RetrieveMemoryRecordsPaginator.d.ts +11 -0
  204. package/dist-types/ts3.4/pagination/index.d.ts +6 -0
  205. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +321 -0
  206. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +96 -0
  207. package/dist-types/ts3.4/runtimeConfig.d.ts +93 -0
  208. package/dist-types/ts3.4/runtimeConfig.native.d.ts +100 -0
  209. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +24 -0
  210. package/dist-types/ts3.4/runtimeExtensions.d.ts +13 -0
  211. package/package.json +105 -0
@@ -0,0 +1,1367 @@
1
+ import { awsExpectUnion as __expectUnion, loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
2
+ import { requestBuilder as rb } from "@smithy/core";
3
+ import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, isSerializableHeaderValue, limitedParseDouble as __limitedParseDouble, map, parseEpochTimestamp as __parseEpochTimestamp, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, take, withBaseException, } from "@smithy/smithy-client";
4
+ import { v4 as generateIdempotencyToken } from "uuid";
5
+ import { BedrockAgentCoreServiceException as __BaseException } from "../models/BedrockAgentCoreServiceException";
6
+ import { AccessDeniedException, ConflictException, InternalServerException, InvalidInputException, PayloadType, ResourceNotFoundException, RuntimeClientError, ServiceException, ServiceQuotaExceededException, ThrottledException, ThrottlingException, UnauthorizedException, ValidationException, } from "../models/models_0";
7
+ export const se_CreateEventCommand = async (input, context) => {
8
+ const b = rb(input, context);
9
+ const headers = {
10
+ "content-type": "application/json",
11
+ };
12
+ b.bp("/memories/{memoryId}/events");
13
+ b.p("memoryId", () => input.memoryId, "{memoryId}", false);
14
+ let body;
15
+ body = JSON.stringify(take(input, {
16
+ actorId: [],
17
+ branch: (_) => _json(_),
18
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
19
+ eventTimestamp: (_) => _.getTime() / 1_000,
20
+ payload: (_) => se_PayloadTypeList(_, context),
21
+ sessionId: [],
22
+ }));
23
+ b.m("POST").h(headers).b(body);
24
+ return b.build();
25
+ };
26
+ export const se_DeleteEventCommand = async (input, context) => {
27
+ const b = rb(input, context);
28
+ const headers = {};
29
+ b.bp("/memories/{memoryId}/actor/{actorId}/sessions/{sessionId}/events/{eventId}");
30
+ b.p("memoryId", () => input.memoryId, "{memoryId}", false);
31
+ b.p("sessionId", () => input.sessionId, "{sessionId}", false);
32
+ b.p("eventId", () => input.eventId, "{eventId}", false);
33
+ b.p("actorId", () => input.actorId, "{actorId}", false);
34
+ let body;
35
+ b.m("DELETE").h(headers).b(body);
36
+ return b.build();
37
+ };
38
+ export const se_DeleteMemoryRecordCommand = async (input, context) => {
39
+ const b = rb(input, context);
40
+ const headers = {};
41
+ b.bp("/memories/{memoryId}/memoryRecords/{memoryRecordId}");
42
+ b.p("memoryId", () => input.memoryId, "{memoryId}", false);
43
+ b.p("memoryRecordId", () => input.memoryRecordId, "{memoryRecordId}", false);
44
+ let body;
45
+ b.m("DELETE").h(headers).b(body);
46
+ return b.build();
47
+ };
48
+ export const se_GetBrowserSessionCommand = async (input, context) => {
49
+ const b = rb(input, context);
50
+ const headers = {};
51
+ b.bp("/browsers/{browserIdentifier}/sessions/get");
52
+ b.p("browserIdentifier", () => input.browserIdentifier, "{browserIdentifier}", false);
53
+ const query = map({
54
+ [_sI]: [, __expectNonNull(input[_sI], `sessionId`)],
55
+ });
56
+ let body;
57
+ b.m("GET").h(headers).q(query).b(body);
58
+ return b.build();
59
+ };
60
+ export const se_GetCodeInterpreterSessionCommand = async (input, context) => {
61
+ const b = rb(input, context);
62
+ const headers = {};
63
+ b.bp("/code-interpreters/{codeInterpreterIdentifier}/sessions/get");
64
+ b.p("codeInterpreterIdentifier", () => input.codeInterpreterIdentifier, "{codeInterpreterIdentifier}", false);
65
+ const query = map({
66
+ [_sI]: [, __expectNonNull(input[_sI], `sessionId`)],
67
+ });
68
+ let body;
69
+ b.m("GET").h(headers).q(query).b(body);
70
+ return b.build();
71
+ };
72
+ export const se_GetEventCommand = async (input, context) => {
73
+ const b = rb(input, context);
74
+ const headers = {};
75
+ b.bp("/memories/{memoryId}/actor/{actorId}/sessions/{sessionId}/events/{eventId}");
76
+ b.p("memoryId", () => input.memoryId, "{memoryId}", false);
77
+ b.p("sessionId", () => input.sessionId, "{sessionId}", false);
78
+ b.p("actorId", () => input.actorId, "{actorId}", false);
79
+ b.p("eventId", () => input.eventId, "{eventId}", false);
80
+ let body;
81
+ b.m("GET").h(headers).b(body);
82
+ return b.build();
83
+ };
84
+ export const se_GetMemoryRecordCommand = async (input, context) => {
85
+ const b = rb(input, context);
86
+ const headers = {};
87
+ b.bp("/memories/{memoryId}/memoryRecord/{memoryRecordId}");
88
+ b.p("memoryId", () => input.memoryId, "{memoryId}", false);
89
+ b.p("memoryRecordId", () => input.memoryRecordId, "{memoryRecordId}", false);
90
+ let body;
91
+ b.m("GET").h(headers).b(body);
92
+ return b.build();
93
+ };
94
+ export const se_GetResourceApiKeyCommand = async (input, context) => {
95
+ const b = rb(input, context);
96
+ const headers = {
97
+ "content-type": "application/json",
98
+ };
99
+ b.bp("/identities/api-key");
100
+ let body;
101
+ body = JSON.stringify(take(input, {
102
+ resourceCredentialProviderName: [],
103
+ workloadIdentityToken: [],
104
+ }));
105
+ b.m("POST").h(headers).b(body);
106
+ return b.build();
107
+ };
108
+ export const se_GetResourceOauth2TokenCommand = async (input, context) => {
109
+ const b = rb(input, context);
110
+ const headers = {
111
+ "content-type": "application/json",
112
+ };
113
+ b.bp("/identities/oauth2/token");
114
+ let body;
115
+ body = JSON.stringify(take(input, {
116
+ customParameters: (_) => _json(_),
117
+ forceAuthentication: [],
118
+ oauth2Flow: [],
119
+ resourceCredentialProviderName: [],
120
+ resourceOauth2ReturnUrl: [],
121
+ scopes: (_) => _json(_),
122
+ userId: [],
123
+ workloadIdentityToken: [],
124
+ }));
125
+ b.m("POST").h(headers).b(body);
126
+ return b.build();
127
+ };
128
+ export const se_GetWorkloadAccessTokenCommand = async (input, context) => {
129
+ const b = rb(input, context);
130
+ const headers = {
131
+ "content-type": "application/json",
132
+ };
133
+ b.bp("/identities/GetWorkloadAccessToken");
134
+ let body;
135
+ body = JSON.stringify(take(input, {
136
+ workloadName: [],
137
+ }));
138
+ b.m("POST").h(headers).b(body);
139
+ return b.build();
140
+ };
141
+ export const se_GetWorkloadAccessTokenForJWTCommand = async (input, context) => {
142
+ const b = rb(input, context);
143
+ const headers = {
144
+ "content-type": "application/json",
145
+ };
146
+ b.bp("/identities/GetWorkloadAccessTokenForJWT");
147
+ let body;
148
+ body = JSON.stringify(take(input, {
149
+ userToken: [],
150
+ workloadName: [],
151
+ }));
152
+ b.m("POST").h(headers).b(body);
153
+ return b.build();
154
+ };
155
+ export const se_GetWorkloadAccessTokenForUserIdCommand = async (input, context) => {
156
+ const b = rb(input, context);
157
+ const headers = {
158
+ "content-type": "application/json",
159
+ };
160
+ b.bp("/identities/GetWorkloadAccessTokenForUserId");
161
+ let body;
162
+ body = JSON.stringify(take(input, {
163
+ userId: [],
164
+ workloadName: [],
165
+ }));
166
+ b.m("POST").h(headers).b(body);
167
+ return b.build();
168
+ };
169
+ export const se_InvokeAgentRuntimeCommand = async (input, context) => {
170
+ const b = rb(input, context);
171
+ const headers = map({}, isSerializableHeaderValue, {
172
+ [_ct]: input[_cT] || "application/octet-stream",
173
+ [_a]: input[_a],
174
+ [_msi]: input[_mSI],
175
+ [_xabarsi]: input[_rSI] ?? generateIdempotencyToken(),
176
+ [_mpv]: input[_mPV],
177
+ [_xabarui]: input[_rUI],
178
+ [_xati]: input[_tI],
179
+ [_t]: input[_tP],
180
+ [_tr]: input[_tS],
181
+ [_b]: input[_b],
182
+ });
183
+ b.bp("/runtimes/{agentRuntimeArn}/invocations");
184
+ b.p("agentRuntimeArn", () => input.agentRuntimeArn, "{agentRuntimeArn}", false);
185
+ const query = map({
186
+ [_q]: [, input[_q]],
187
+ });
188
+ let body;
189
+ if (input.payload !== undefined) {
190
+ body = input.payload;
191
+ }
192
+ b.m("POST").h(headers).q(query).b(body);
193
+ return b.build();
194
+ };
195
+ export const se_InvokeCodeInterpreterCommand = async (input, context) => {
196
+ const b = rb(input, context);
197
+ const headers = map({}, isSerializableHeaderValue, {
198
+ "content-type": "application/json",
199
+ [_xacisi]: input[_sI],
200
+ });
201
+ b.bp("/code-interpreters/{codeInterpreterIdentifier}/tools/invoke");
202
+ b.p("codeInterpreterIdentifier", () => input.codeInterpreterIdentifier, "{codeInterpreterIdentifier}", false);
203
+ let body;
204
+ body = JSON.stringify(take(input, {
205
+ arguments: (_) => se_ToolArguments(_, context),
206
+ name: [],
207
+ }));
208
+ b.m("POST").h(headers).b(body);
209
+ return b.build();
210
+ };
211
+ export const se_ListActorsCommand = async (input, context) => {
212
+ const b = rb(input, context);
213
+ const headers = {
214
+ "content-type": "application/json",
215
+ };
216
+ b.bp("/memories/{memoryId}/actors");
217
+ b.p("memoryId", () => input.memoryId, "{memoryId}", false);
218
+ let body;
219
+ body = JSON.stringify(take(input, {
220
+ maxResults: [],
221
+ nextToken: [],
222
+ }));
223
+ b.m("POST").h(headers).b(body);
224
+ return b.build();
225
+ };
226
+ export const se_ListBrowserSessionsCommand = async (input, context) => {
227
+ const b = rb(input, context);
228
+ const headers = {
229
+ "content-type": "application/json",
230
+ };
231
+ b.bp("/browsers/{browserIdentifier}/sessions/list");
232
+ b.p("browserIdentifier", () => input.browserIdentifier, "{browserIdentifier}", false);
233
+ let body;
234
+ body = JSON.stringify(take(input, {
235
+ maxResults: [],
236
+ nextToken: [],
237
+ status: [],
238
+ }));
239
+ b.m("POST").h(headers).b(body);
240
+ return b.build();
241
+ };
242
+ export const se_ListCodeInterpreterSessionsCommand = async (input, context) => {
243
+ const b = rb(input, context);
244
+ const headers = {
245
+ "content-type": "application/json",
246
+ };
247
+ b.bp("/code-interpreters/{codeInterpreterIdentifier}/sessions/list");
248
+ b.p("codeInterpreterIdentifier", () => input.codeInterpreterIdentifier, "{codeInterpreterIdentifier}", false);
249
+ let body;
250
+ body = JSON.stringify(take(input, {
251
+ maxResults: [],
252
+ nextToken: [],
253
+ status: [],
254
+ }));
255
+ b.m("POST").h(headers).b(body);
256
+ return b.build();
257
+ };
258
+ export const se_ListEventsCommand = async (input, context) => {
259
+ const b = rb(input, context);
260
+ const headers = {
261
+ "content-type": "application/json",
262
+ };
263
+ b.bp("/memories/{memoryId}/actor/{actorId}/sessions/{sessionId}");
264
+ b.p("memoryId", () => input.memoryId, "{memoryId}", false);
265
+ b.p("sessionId", () => input.sessionId, "{sessionId}", false);
266
+ b.p("actorId", () => input.actorId, "{actorId}", false);
267
+ let body;
268
+ body = JSON.stringify(take(input, {
269
+ filter: (_) => _json(_),
270
+ includePayloads: [],
271
+ maxResults: [],
272
+ nextToken: [],
273
+ }));
274
+ b.m("POST").h(headers).b(body);
275
+ return b.build();
276
+ };
277
+ export const se_ListMemoryRecordsCommand = async (input, context) => {
278
+ const b = rb(input, context);
279
+ const headers = {
280
+ "content-type": "application/json",
281
+ };
282
+ b.bp("/memories/{memoryId}/memoryRecords");
283
+ b.p("memoryId", () => input.memoryId, "{memoryId}", false);
284
+ let body;
285
+ body = JSON.stringify(take(input, {
286
+ maxResults: [],
287
+ memoryStrategyId: [],
288
+ namespace: [],
289
+ nextToken: [],
290
+ }));
291
+ b.m("POST").h(headers).b(body);
292
+ return b.build();
293
+ };
294
+ export const se_ListSessionsCommand = async (input, context) => {
295
+ const b = rb(input, context);
296
+ const headers = {
297
+ "content-type": "application/json",
298
+ };
299
+ b.bp("/memories/{memoryId}/actor/{actorId}/sessions");
300
+ b.p("memoryId", () => input.memoryId, "{memoryId}", false);
301
+ b.p("actorId", () => input.actorId, "{actorId}", false);
302
+ let body;
303
+ body = JSON.stringify(take(input, {
304
+ maxResults: [],
305
+ nextToken: [],
306
+ }));
307
+ b.m("POST").h(headers).b(body);
308
+ return b.build();
309
+ };
310
+ export const se_RetrieveMemoryRecordsCommand = async (input, context) => {
311
+ const b = rb(input, context);
312
+ const headers = {
313
+ "content-type": "application/json",
314
+ };
315
+ b.bp("/memories/{memoryId}/retrieve");
316
+ b.p("memoryId", () => input.memoryId, "{memoryId}", false);
317
+ let body;
318
+ body = JSON.stringify(take(input, {
319
+ maxResults: [],
320
+ namespace: [],
321
+ nextToken: [],
322
+ searchCriteria: (_) => _json(_),
323
+ }));
324
+ b.m("POST").h(headers).b(body);
325
+ return b.build();
326
+ };
327
+ export const se_StartBrowserSessionCommand = async (input, context) => {
328
+ const b = rb(input, context);
329
+ const headers = {
330
+ "content-type": "application/json",
331
+ };
332
+ b.bp("/browsers/{browserIdentifier}/sessions/start");
333
+ b.p("browserIdentifier", () => input.browserIdentifier, "{browserIdentifier}", false);
334
+ let body;
335
+ body = JSON.stringify(take(input, {
336
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
337
+ name: [],
338
+ sessionTimeoutSeconds: [],
339
+ viewPort: (_) => _json(_),
340
+ }));
341
+ b.m("PUT").h(headers).b(body);
342
+ return b.build();
343
+ };
344
+ export const se_StartCodeInterpreterSessionCommand = async (input, context) => {
345
+ const b = rb(input, context);
346
+ const headers = {
347
+ "content-type": "application/json",
348
+ };
349
+ b.bp("/code-interpreters/{codeInterpreterIdentifier}/sessions/start");
350
+ b.p("codeInterpreterIdentifier", () => input.codeInterpreterIdentifier, "{codeInterpreterIdentifier}", false);
351
+ let body;
352
+ body = JSON.stringify(take(input, {
353
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
354
+ name: [],
355
+ sessionTimeoutSeconds: [],
356
+ }));
357
+ b.m("PUT").h(headers).b(body);
358
+ return b.build();
359
+ };
360
+ export const se_StopBrowserSessionCommand = async (input, context) => {
361
+ const b = rb(input, context);
362
+ const headers = {
363
+ "content-type": "application/json",
364
+ };
365
+ b.bp("/browsers/{browserIdentifier}/sessions/stop");
366
+ b.p("browserIdentifier", () => input.browserIdentifier, "{browserIdentifier}", false);
367
+ const query = map({
368
+ [_sI]: [, __expectNonNull(input[_sI], `sessionId`)],
369
+ });
370
+ let body;
371
+ body = JSON.stringify(take(input, {
372
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
373
+ }));
374
+ b.m("PUT").h(headers).q(query).b(body);
375
+ return b.build();
376
+ };
377
+ export const se_StopCodeInterpreterSessionCommand = async (input, context) => {
378
+ const b = rb(input, context);
379
+ const headers = {
380
+ "content-type": "application/json",
381
+ };
382
+ b.bp("/code-interpreters/{codeInterpreterIdentifier}/sessions/stop");
383
+ b.p("codeInterpreterIdentifier", () => input.codeInterpreterIdentifier, "{codeInterpreterIdentifier}", false);
384
+ const query = map({
385
+ [_sI]: [, __expectNonNull(input[_sI], `sessionId`)],
386
+ });
387
+ let body;
388
+ body = JSON.stringify(take(input, {
389
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
390
+ }));
391
+ b.m("PUT").h(headers).q(query).b(body);
392
+ return b.build();
393
+ };
394
+ export const se_UpdateBrowserStreamCommand = async (input, context) => {
395
+ const b = rb(input, context);
396
+ const headers = {
397
+ "content-type": "application/json",
398
+ };
399
+ b.bp("/browsers/{browserIdentifier}/sessions/streams/update");
400
+ b.p("browserIdentifier", () => input.browserIdentifier, "{browserIdentifier}", false);
401
+ const query = map({
402
+ [_sI]: [, __expectNonNull(input[_sI], `sessionId`)],
403
+ });
404
+ let body;
405
+ body = JSON.stringify(take(input, {
406
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
407
+ streamUpdate: (_) => _json(_),
408
+ }));
409
+ b.m("PUT").h(headers).q(query).b(body);
410
+ return b.build();
411
+ };
412
+ export const de_CreateEventCommand = async (output, context) => {
413
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
414
+ return de_CommandError(output, context);
415
+ }
416
+ const contents = map({
417
+ $metadata: deserializeMetadata(output),
418
+ });
419
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
420
+ const doc = take(data, {
421
+ event: (_) => de_Event(_, context),
422
+ });
423
+ Object.assign(contents, doc);
424
+ return contents;
425
+ };
426
+ export const de_DeleteEventCommand = async (output, context) => {
427
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
428
+ return de_CommandError(output, context);
429
+ }
430
+ const contents = map({
431
+ $metadata: deserializeMetadata(output),
432
+ });
433
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
434
+ const doc = take(data, {
435
+ eventId: __expectString,
436
+ });
437
+ Object.assign(contents, doc);
438
+ return contents;
439
+ };
440
+ export const de_DeleteMemoryRecordCommand = async (output, context) => {
441
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
442
+ return de_CommandError(output, context);
443
+ }
444
+ const contents = map({
445
+ $metadata: deserializeMetadata(output),
446
+ });
447
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
448
+ const doc = take(data, {
449
+ memoryRecordId: __expectString,
450
+ });
451
+ Object.assign(contents, doc);
452
+ return contents;
453
+ };
454
+ export const de_GetBrowserSessionCommand = async (output, context) => {
455
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
456
+ return de_CommandError(output, context);
457
+ }
458
+ const contents = map({
459
+ $metadata: deserializeMetadata(output),
460
+ });
461
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
462
+ const doc = take(data, {
463
+ browserIdentifier: __expectString,
464
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
465
+ lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
466
+ name: __expectString,
467
+ sessionId: __expectString,
468
+ sessionReplayArtifact: __expectString,
469
+ sessionTimeoutSeconds: __expectInt32,
470
+ status: __expectString,
471
+ streams: _json,
472
+ viewPort: _json,
473
+ });
474
+ Object.assign(contents, doc);
475
+ return contents;
476
+ };
477
+ export const de_GetCodeInterpreterSessionCommand = async (output, context) => {
478
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
479
+ return de_CommandError(output, context);
480
+ }
481
+ const contents = map({
482
+ $metadata: deserializeMetadata(output),
483
+ });
484
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
485
+ const doc = take(data, {
486
+ codeInterpreterIdentifier: __expectString,
487
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
488
+ name: __expectString,
489
+ sessionId: __expectString,
490
+ sessionTimeoutSeconds: __expectInt32,
491
+ status: __expectString,
492
+ });
493
+ Object.assign(contents, doc);
494
+ return contents;
495
+ };
496
+ export const de_GetEventCommand = async (output, context) => {
497
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
498
+ return de_CommandError(output, context);
499
+ }
500
+ const contents = map({
501
+ $metadata: deserializeMetadata(output),
502
+ });
503
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
504
+ const doc = take(data, {
505
+ event: (_) => de_Event(_, context),
506
+ });
507
+ Object.assign(contents, doc);
508
+ return contents;
509
+ };
510
+ export const de_GetMemoryRecordCommand = async (output, context) => {
511
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
512
+ return de_CommandError(output, context);
513
+ }
514
+ const contents = map({
515
+ $metadata: deserializeMetadata(output),
516
+ });
517
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
518
+ const doc = take(data, {
519
+ memoryRecord: (_) => de_MemoryRecord(_, context),
520
+ });
521
+ Object.assign(contents, doc);
522
+ return contents;
523
+ };
524
+ export const de_GetResourceApiKeyCommand = async (output, context) => {
525
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
526
+ return de_CommandError(output, context);
527
+ }
528
+ const contents = map({
529
+ $metadata: deserializeMetadata(output),
530
+ });
531
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
532
+ const doc = take(data, {
533
+ apiKey: __expectString,
534
+ });
535
+ Object.assign(contents, doc);
536
+ return contents;
537
+ };
538
+ export const de_GetResourceOauth2TokenCommand = async (output, context) => {
539
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
540
+ return de_CommandError(output, context);
541
+ }
542
+ const contents = map({
543
+ $metadata: deserializeMetadata(output),
544
+ });
545
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
546
+ const doc = take(data, {
547
+ accessToken: __expectString,
548
+ authorizationUrl: __expectString,
549
+ });
550
+ Object.assign(contents, doc);
551
+ return contents;
552
+ };
553
+ export const de_GetWorkloadAccessTokenCommand = async (output, context) => {
554
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
555
+ return de_CommandError(output, context);
556
+ }
557
+ const contents = map({
558
+ $metadata: deserializeMetadata(output),
559
+ });
560
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
561
+ const doc = take(data, {
562
+ workloadAccessToken: __expectString,
563
+ });
564
+ Object.assign(contents, doc);
565
+ return contents;
566
+ };
567
+ export const de_GetWorkloadAccessTokenForJWTCommand = async (output, context) => {
568
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
569
+ return de_CommandError(output, context);
570
+ }
571
+ const contents = map({
572
+ $metadata: deserializeMetadata(output),
573
+ });
574
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
575
+ const doc = take(data, {
576
+ workloadAccessToken: __expectString,
577
+ });
578
+ Object.assign(contents, doc);
579
+ return contents;
580
+ };
581
+ export const de_GetWorkloadAccessTokenForUserIdCommand = async (output, context) => {
582
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
583
+ return de_CommandError(output, context);
584
+ }
585
+ const contents = map({
586
+ $metadata: deserializeMetadata(output),
587
+ });
588
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
589
+ const doc = take(data, {
590
+ workloadAccessToken: __expectString,
591
+ });
592
+ Object.assign(contents, doc);
593
+ return contents;
594
+ };
595
+ export const de_InvokeAgentRuntimeCommand = async (output, context) => {
596
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
597
+ return de_CommandError(output, context);
598
+ }
599
+ const contents = map({
600
+ $metadata: deserializeMetadata(output),
601
+ [_rSI]: [, output.headers[_xabarsi]],
602
+ [_mSI]: [, output.headers[_msi]],
603
+ [_mPV]: [, output.headers[_mpv]],
604
+ [_tI]: [, output.headers[_xati]],
605
+ [_tP]: [, output.headers[_t]],
606
+ [_tS]: [, output.headers[_tr]],
607
+ [_b]: [, output.headers[_b]],
608
+ [_cT]: [, output.headers[_ct]],
609
+ });
610
+ const data = output.body;
611
+ context.sdkStreamMixin(data);
612
+ contents.response = data;
613
+ map(contents, {
614
+ statusCode: [, output.statusCode],
615
+ });
616
+ return contents;
617
+ };
618
+ export const de_InvokeCodeInterpreterCommand = async (output, context) => {
619
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
620
+ return de_CommandError(output, context);
621
+ }
622
+ const contents = map({
623
+ $metadata: deserializeMetadata(output),
624
+ [_sI]: [, output.headers[_xacisi]],
625
+ });
626
+ const data = output.body;
627
+ contents.stream = de_CodeInterpreterStreamOutput(data, context);
628
+ return contents;
629
+ };
630
+ export const de_ListActorsCommand = async (output, context) => {
631
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
632
+ return de_CommandError(output, context);
633
+ }
634
+ const contents = map({
635
+ $metadata: deserializeMetadata(output),
636
+ });
637
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
638
+ const doc = take(data, {
639
+ actorSummaries: _json,
640
+ nextToken: __expectString,
641
+ });
642
+ Object.assign(contents, doc);
643
+ return contents;
644
+ };
645
+ export const de_ListBrowserSessionsCommand = async (output, context) => {
646
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
647
+ return de_CommandError(output, context);
648
+ }
649
+ const contents = map({
650
+ $metadata: deserializeMetadata(output),
651
+ });
652
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
653
+ const doc = take(data, {
654
+ items: (_) => de_BrowserSessionSummaries(_, context),
655
+ nextToken: __expectString,
656
+ });
657
+ Object.assign(contents, doc);
658
+ return contents;
659
+ };
660
+ export const de_ListCodeInterpreterSessionsCommand = async (output, context) => {
661
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
662
+ return de_CommandError(output, context);
663
+ }
664
+ const contents = map({
665
+ $metadata: deserializeMetadata(output),
666
+ });
667
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
668
+ const doc = take(data, {
669
+ items: (_) => de_CodeInterpreterSessionSummaries(_, context),
670
+ nextToken: __expectString,
671
+ });
672
+ Object.assign(contents, doc);
673
+ return contents;
674
+ };
675
+ export const de_ListEventsCommand = async (output, context) => {
676
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
677
+ return de_CommandError(output, context);
678
+ }
679
+ const contents = map({
680
+ $metadata: deserializeMetadata(output),
681
+ });
682
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
683
+ const doc = take(data, {
684
+ events: (_) => de_EventList(_, context),
685
+ nextToken: __expectString,
686
+ });
687
+ Object.assign(contents, doc);
688
+ return contents;
689
+ };
690
+ export const de_ListMemoryRecordsCommand = async (output, context) => {
691
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
692
+ return de_CommandError(output, context);
693
+ }
694
+ const contents = map({
695
+ $metadata: deserializeMetadata(output),
696
+ });
697
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
698
+ const doc = take(data, {
699
+ memoryRecordSummaries: (_) => de_MemoryRecordSummaryList(_, context),
700
+ nextToken: __expectString,
701
+ });
702
+ Object.assign(contents, doc);
703
+ return contents;
704
+ };
705
+ export const de_ListSessionsCommand = async (output, context) => {
706
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
707
+ return de_CommandError(output, context);
708
+ }
709
+ const contents = map({
710
+ $metadata: deserializeMetadata(output),
711
+ });
712
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
713
+ const doc = take(data, {
714
+ nextToken: __expectString,
715
+ sessionSummaries: (_) => de_SessionSummaryList(_, context),
716
+ });
717
+ Object.assign(contents, doc);
718
+ return contents;
719
+ };
720
+ export const de_RetrieveMemoryRecordsCommand = async (output, context) => {
721
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
722
+ return de_CommandError(output, context);
723
+ }
724
+ const contents = map({
725
+ $metadata: deserializeMetadata(output),
726
+ });
727
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
728
+ const doc = take(data, {
729
+ memoryRecordSummaries: (_) => de_MemoryRecordSummaryList(_, context),
730
+ nextToken: __expectString,
731
+ });
732
+ Object.assign(contents, doc);
733
+ return contents;
734
+ };
735
+ export const de_StartBrowserSessionCommand = async (output, context) => {
736
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
737
+ return de_CommandError(output, context);
738
+ }
739
+ const contents = map({
740
+ $metadata: deserializeMetadata(output),
741
+ });
742
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
743
+ const doc = take(data, {
744
+ browserIdentifier: __expectString,
745
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
746
+ sessionId: __expectString,
747
+ streams: _json,
748
+ });
749
+ Object.assign(contents, doc);
750
+ return contents;
751
+ };
752
+ export const de_StartCodeInterpreterSessionCommand = async (output, context) => {
753
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
754
+ return de_CommandError(output, context);
755
+ }
756
+ const contents = map({
757
+ $metadata: deserializeMetadata(output),
758
+ });
759
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
760
+ const doc = take(data, {
761
+ codeInterpreterIdentifier: __expectString,
762
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
763
+ sessionId: __expectString,
764
+ });
765
+ Object.assign(contents, doc);
766
+ return contents;
767
+ };
768
+ export const de_StopBrowserSessionCommand = async (output, context) => {
769
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
770
+ return de_CommandError(output, context);
771
+ }
772
+ const contents = map({
773
+ $metadata: deserializeMetadata(output),
774
+ });
775
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
776
+ const doc = take(data, {
777
+ browserIdentifier: __expectString,
778
+ lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
779
+ sessionId: __expectString,
780
+ });
781
+ Object.assign(contents, doc);
782
+ return contents;
783
+ };
784
+ export const de_StopCodeInterpreterSessionCommand = async (output, context) => {
785
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
786
+ return de_CommandError(output, context);
787
+ }
788
+ const contents = map({
789
+ $metadata: deserializeMetadata(output),
790
+ });
791
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
792
+ const doc = take(data, {
793
+ codeInterpreterIdentifier: __expectString,
794
+ lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
795
+ sessionId: __expectString,
796
+ });
797
+ Object.assign(contents, doc);
798
+ return contents;
799
+ };
800
+ export const de_UpdateBrowserStreamCommand = async (output, context) => {
801
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
802
+ return de_CommandError(output, context);
803
+ }
804
+ const contents = map({
805
+ $metadata: deserializeMetadata(output),
806
+ });
807
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
808
+ const doc = take(data, {
809
+ browserIdentifier: __expectString,
810
+ sessionId: __expectString,
811
+ streams: _json,
812
+ updatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
813
+ });
814
+ Object.assign(contents, doc);
815
+ return contents;
816
+ };
817
+ const de_CommandError = async (output, context) => {
818
+ const parsedOutput = {
819
+ ...output,
820
+ body: await parseErrorBody(output.body, context),
821
+ };
822
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
823
+ switch (errorCode) {
824
+ case "AccessDeniedException":
825
+ case "com.amazonaws.bedrockagentcore#AccessDeniedException":
826
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
827
+ case "InvalidInputException":
828
+ case "com.amazonaws.bedrockagentcore#InvalidInputException":
829
+ throw await de_InvalidInputExceptionRes(parsedOutput, context);
830
+ case "ResourceNotFoundException":
831
+ case "com.amazonaws.bedrockagentcore#ResourceNotFoundException":
832
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
833
+ case "ServiceException":
834
+ case "com.amazonaws.bedrockagentcore#ServiceException":
835
+ throw await de_ServiceExceptionRes(parsedOutput, context);
836
+ case "ServiceQuotaExceededException":
837
+ case "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException":
838
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
839
+ case "ThrottledException":
840
+ case "com.amazonaws.bedrockagentcore#ThrottledException":
841
+ throw await de_ThrottledExceptionRes(parsedOutput, context);
842
+ case "ValidationException":
843
+ case "com.amazonaws.bedrockagentcore#ValidationException":
844
+ throw await de_ValidationExceptionRes(parsedOutput, context);
845
+ case "InternalServerException":
846
+ case "com.amazonaws.bedrockagentcore#InternalServerException":
847
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
848
+ case "ThrottlingException":
849
+ case "com.amazonaws.bedrockagentcore#ThrottlingException":
850
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
851
+ case "UnauthorizedException":
852
+ case "com.amazonaws.bedrockagentcore#UnauthorizedException":
853
+ throw await de_UnauthorizedExceptionRes(parsedOutput, context);
854
+ case "RuntimeClientError":
855
+ case "com.amazonaws.bedrockagentcore#RuntimeClientError":
856
+ throw await de_RuntimeClientErrorRes(parsedOutput, context);
857
+ case "ConflictException":
858
+ case "com.amazonaws.bedrockagentcore#ConflictException":
859
+ throw await de_ConflictExceptionRes(parsedOutput, context);
860
+ default:
861
+ const parsedBody = parsedOutput.body;
862
+ return throwDefaultError({
863
+ output,
864
+ parsedBody,
865
+ errorCode,
866
+ });
867
+ }
868
+ };
869
+ const throwDefaultError = withBaseException(__BaseException);
870
+ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
871
+ const contents = map({});
872
+ const data = parsedOutput.body;
873
+ const doc = take(data, {
874
+ message: __expectString,
875
+ });
876
+ Object.assign(contents, doc);
877
+ const exception = new AccessDeniedException({
878
+ $metadata: deserializeMetadata(parsedOutput),
879
+ ...contents,
880
+ });
881
+ return __decorateServiceException(exception, parsedOutput.body);
882
+ };
883
+ const de_ConflictExceptionRes = async (parsedOutput, context) => {
884
+ const contents = map({});
885
+ const data = parsedOutput.body;
886
+ const doc = take(data, {
887
+ message: __expectString,
888
+ });
889
+ Object.assign(contents, doc);
890
+ const exception = new ConflictException({
891
+ $metadata: deserializeMetadata(parsedOutput),
892
+ ...contents,
893
+ });
894
+ return __decorateServiceException(exception, parsedOutput.body);
895
+ };
896
+ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
897
+ const contents = map({});
898
+ const data = parsedOutput.body;
899
+ const doc = take(data, {
900
+ message: __expectString,
901
+ });
902
+ Object.assign(contents, doc);
903
+ const exception = new InternalServerException({
904
+ $metadata: deserializeMetadata(parsedOutput),
905
+ ...contents,
906
+ });
907
+ return __decorateServiceException(exception, parsedOutput.body);
908
+ };
909
+ const de_InvalidInputExceptionRes = async (parsedOutput, context) => {
910
+ const contents = map({});
911
+ const data = parsedOutput.body;
912
+ const doc = take(data, {
913
+ message: __expectString,
914
+ });
915
+ Object.assign(contents, doc);
916
+ const exception = new InvalidInputException({
917
+ $metadata: deserializeMetadata(parsedOutput),
918
+ ...contents,
919
+ });
920
+ return __decorateServiceException(exception, parsedOutput.body);
921
+ };
922
+ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
923
+ const contents = map({});
924
+ const data = parsedOutput.body;
925
+ const doc = take(data, {
926
+ message: __expectString,
927
+ });
928
+ Object.assign(contents, doc);
929
+ const exception = new ResourceNotFoundException({
930
+ $metadata: deserializeMetadata(parsedOutput),
931
+ ...contents,
932
+ });
933
+ return __decorateServiceException(exception, parsedOutput.body);
934
+ };
935
+ const de_RuntimeClientErrorRes = async (parsedOutput, context) => {
936
+ const contents = map({});
937
+ const data = parsedOutput.body;
938
+ const doc = take(data, {
939
+ message: __expectString,
940
+ });
941
+ Object.assign(contents, doc);
942
+ const exception = new RuntimeClientError({
943
+ $metadata: deserializeMetadata(parsedOutput),
944
+ ...contents,
945
+ });
946
+ return __decorateServiceException(exception, parsedOutput.body);
947
+ };
948
+ const de_ServiceExceptionRes = async (parsedOutput, context) => {
949
+ const contents = map({});
950
+ const data = parsedOutput.body;
951
+ const doc = take(data, {
952
+ message: __expectString,
953
+ });
954
+ Object.assign(contents, doc);
955
+ const exception = new ServiceException({
956
+ $metadata: deserializeMetadata(parsedOutput),
957
+ ...contents,
958
+ });
959
+ return __decorateServiceException(exception, parsedOutput.body);
960
+ };
961
+ const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
962
+ const contents = map({});
963
+ const data = parsedOutput.body;
964
+ const doc = take(data, {
965
+ message: __expectString,
966
+ });
967
+ Object.assign(contents, doc);
968
+ const exception = new ServiceQuotaExceededException({
969
+ $metadata: deserializeMetadata(parsedOutput),
970
+ ...contents,
971
+ });
972
+ return __decorateServiceException(exception, parsedOutput.body);
973
+ };
974
+ const de_ThrottledExceptionRes = async (parsedOutput, context) => {
975
+ const contents = map({});
976
+ const data = parsedOutput.body;
977
+ const doc = take(data, {
978
+ message: __expectString,
979
+ });
980
+ Object.assign(contents, doc);
981
+ const exception = new ThrottledException({
982
+ $metadata: deserializeMetadata(parsedOutput),
983
+ ...contents,
984
+ });
985
+ return __decorateServiceException(exception, parsedOutput.body);
986
+ };
987
+ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
988
+ const contents = map({});
989
+ const data = parsedOutput.body;
990
+ const doc = take(data, {
991
+ message: __expectString,
992
+ });
993
+ Object.assign(contents, doc);
994
+ const exception = new ThrottlingException({
995
+ $metadata: deserializeMetadata(parsedOutput),
996
+ ...contents,
997
+ });
998
+ return __decorateServiceException(exception, parsedOutput.body);
999
+ };
1000
+ const de_UnauthorizedExceptionRes = async (parsedOutput, context) => {
1001
+ const contents = map({});
1002
+ const data = parsedOutput.body;
1003
+ const doc = take(data, {
1004
+ message: __expectString,
1005
+ });
1006
+ Object.assign(contents, doc);
1007
+ const exception = new UnauthorizedException({
1008
+ $metadata: deserializeMetadata(parsedOutput),
1009
+ ...contents,
1010
+ });
1011
+ return __decorateServiceException(exception, parsedOutput.body);
1012
+ };
1013
+ const de_ValidationExceptionRes = async (parsedOutput, context) => {
1014
+ const contents = map({});
1015
+ const data = parsedOutput.body;
1016
+ const doc = take(data, {
1017
+ fieldList: _json,
1018
+ message: __expectString,
1019
+ reason: __expectString,
1020
+ });
1021
+ Object.assign(contents, doc);
1022
+ const exception = new ValidationException({
1023
+ $metadata: deserializeMetadata(parsedOutput),
1024
+ ...contents,
1025
+ });
1026
+ return __decorateServiceException(exception, parsedOutput.body);
1027
+ };
1028
+ const de_CodeInterpreterStreamOutput = (output, context) => {
1029
+ return context.eventStreamMarshaller.deserialize(output, async (event) => {
1030
+ if (event["result"] != null) {
1031
+ return {
1032
+ result: await de_CodeInterpreterResult_event(event["result"], context),
1033
+ };
1034
+ }
1035
+ if (event["accessDeniedException"] != null) {
1036
+ return {
1037
+ accessDeniedException: await de_AccessDeniedException_event(event["accessDeniedException"], context),
1038
+ };
1039
+ }
1040
+ if (event["conflictException"] != null) {
1041
+ return {
1042
+ conflictException: await de_ConflictException_event(event["conflictException"], context),
1043
+ };
1044
+ }
1045
+ if (event["internalServerException"] != null) {
1046
+ return {
1047
+ internalServerException: await de_InternalServerException_event(event["internalServerException"], context),
1048
+ };
1049
+ }
1050
+ if (event["resourceNotFoundException"] != null) {
1051
+ return {
1052
+ resourceNotFoundException: await de_ResourceNotFoundException_event(event["resourceNotFoundException"], context),
1053
+ };
1054
+ }
1055
+ if (event["serviceQuotaExceededException"] != null) {
1056
+ return {
1057
+ serviceQuotaExceededException: await de_ServiceQuotaExceededException_event(event["serviceQuotaExceededException"], context),
1058
+ };
1059
+ }
1060
+ if (event["throttlingException"] != null) {
1061
+ return {
1062
+ throttlingException: await de_ThrottlingException_event(event["throttlingException"], context),
1063
+ };
1064
+ }
1065
+ if (event["validationException"] != null) {
1066
+ return {
1067
+ validationException: await de_ValidationException_event(event["validationException"], context),
1068
+ };
1069
+ }
1070
+ return { $unknown: event };
1071
+ });
1072
+ };
1073
+ const de_AccessDeniedException_event = async (output, context) => {
1074
+ const parsedOutput = {
1075
+ ...output,
1076
+ body: await parseBody(output.body, context),
1077
+ };
1078
+ return de_AccessDeniedExceptionRes(parsedOutput, context);
1079
+ };
1080
+ const de_CodeInterpreterResult_event = async (output, context) => {
1081
+ const contents = {};
1082
+ const data = await parseBody(output.body, context);
1083
+ Object.assign(contents, de_CodeInterpreterResult(data, context));
1084
+ return contents;
1085
+ };
1086
+ const de_ConflictException_event = async (output, context) => {
1087
+ const parsedOutput = {
1088
+ ...output,
1089
+ body: await parseBody(output.body, context),
1090
+ };
1091
+ return de_ConflictExceptionRes(parsedOutput, context);
1092
+ };
1093
+ const de_InternalServerException_event = async (output, context) => {
1094
+ const parsedOutput = {
1095
+ ...output,
1096
+ body: await parseBody(output.body, context),
1097
+ };
1098
+ return de_InternalServerExceptionRes(parsedOutput, context);
1099
+ };
1100
+ const de_ResourceNotFoundException_event = async (output, context) => {
1101
+ const parsedOutput = {
1102
+ ...output,
1103
+ body: await parseBody(output.body, context),
1104
+ };
1105
+ return de_ResourceNotFoundExceptionRes(parsedOutput, context);
1106
+ };
1107
+ const de_ServiceQuotaExceededException_event = async (output, context) => {
1108
+ const parsedOutput = {
1109
+ ...output,
1110
+ body: await parseBody(output.body, context),
1111
+ };
1112
+ return de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
1113
+ };
1114
+ const de_ThrottlingException_event = async (output, context) => {
1115
+ const parsedOutput = {
1116
+ ...output,
1117
+ body: await parseBody(output.body, context),
1118
+ };
1119
+ return de_ThrottlingExceptionRes(parsedOutput, context);
1120
+ };
1121
+ const de_ValidationException_event = async (output, context) => {
1122
+ const parsedOutput = {
1123
+ ...output,
1124
+ body: await parseBody(output.body, context),
1125
+ };
1126
+ return de_ValidationExceptionRes(parsedOutput, context);
1127
+ };
1128
+ const se_Document = (input, context) => {
1129
+ return input;
1130
+ };
1131
+ const se_InputContentBlock = (input, context) => {
1132
+ return take(input, {
1133
+ blob: context.base64Encoder,
1134
+ path: [],
1135
+ text: [],
1136
+ });
1137
+ };
1138
+ const se_InputContentBlockList = (input, context) => {
1139
+ return input
1140
+ .filter((e) => e != null)
1141
+ .map((entry) => {
1142
+ return se_InputContentBlock(entry, context);
1143
+ });
1144
+ };
1145
+ const se_PayloadType = (input, context) => {
1146
+ return PayloadType.visit(input, {
1147
+ blob: (value) => ({ blob: se_Document(value, context) }),
1148
+ conversational: (value) => ({ conversational: _json(value) }),
1149
+ _: (name, value) => ({ [name]: value }),
1150
+ });
1151
+ };
1152
+ const se_PayloadTypeList = (input, context) => {
1153
+ return input
1154
+ .filter((e) => e != null)
1155
+ .map((entry) => {
1156
+ return se_PayloadType(entry, context);
1157
+ });
1158
+ };
1159
+ const se_ToolArguments = (input, context) => {
1160
+ return take(input, {
1161
+ clearContext: [],
1162
+ code: [],
1163
+ command: [],
1164
+ content: (_) => se_InputContentBlockList(_, context),
1165
+ directoryPath: [],
1166
+ language: [],
1167
+ path: [],
1168
+ paths: _json,
1169
+ taskId: [],
1170
+ });
1171
+ };
1172
+ const de_BrowserSessionSummaries = (output, context) => {
1173
+ const retVal = (output || [])
1174
+ .filter((e) => e != null)
1175
+ .map((entry) => {
1176
+ return de_BrowserSessionSummary(entry, context);
1177
+ });
1178
+ return retVal;
1179
+ };
1180
+ const de_BrowserSessionSummary = (output, context) => {
1181
+ return take(output, {
1182
+ browserIdentifier: __expectString,
1183
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
1184
+ lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
1185
+ name: __expectString,
1186
+ sessionId: __expectString,
1187
+ status: __expectString,
1188
+ });
1189
+ };
1190
+ const de_CodeInterpreterResult = (output, context) => {
1191
+ return take(output, {
1192
+ content: (_) => de_ContentBlockList(_, context),
1193
+ isError: __expectBoolean,
1194
+ structuredContent: (_) => de_ToolResultStructuredContent(_, context),
1195
+ });
1196
+ };
1197
+ const de_CodeInterpreterSessionSummaries = (output, context) => {
1198
+ const retVal = (output || [])
1199
+ .filter((e) => e != null)
1200
+ .map((entry) => {
1201
+ return de_CodeInterpreterSessionSummary(entry, context);
1202
+ });
1203
+ return retVal;
1204
+ };
1205
+ const de_CodeInterpreterSessionSummary = (output, context) => {
1206
+ return take(output, {
1207
+ codeInterpreterIdentifier: __expectString,
1208
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
1209
+ lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
1210
+ name: __expectString,
1211
+ sessionId: __expectString,
1212
+ status: __expectString,
1213
+ });
1214
+ };
1215
+ const de_ContentBlock = (output, context) => {
1216
+ return take(output, {
1217
+ data: context.base64Decoder,
1218
+ description: __expectString,
1219
+ mimeType: __expectString,
1220
+ name: __expectString,
1221
+ resource: (_) => de_ResourceContent(_, context),
1222
+ size: __expectLong,
1223
+ text: __expectString,
1224
+ type: __expectString,
1225
+ uri: __expectString,
1226
+ });
1227
+ };
1228
+ const de_ContentBlockList = (output, context) => {
1229
+ const retVal = (output || [])
1230
+ .filter((e) => e != null)
1231
+ .map((entry) => {
1232
+ return de_ContentBlock(entry, context);
1233
+ });
1234
+ return retVal;
1235
+ };
1236
+ const de_Document = (output, context) => {
1237
+ return output;
1238
+ };
1239
+ const de_Event = (output, context) => {
1240
+ return take(output, {
1241
+ actorId: __expectString,
1242
+ branch: _json,
1243
+ eventId: __expectString,
1244
+ eventTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1245
+ memoryId: __expectString,
1246
+ payload: (_) => de_PayloadTypeList(_, context),
1247
+ sessionId: __expectString,
1248
+ });
1249
+ };
1250
+ const de_EventList = (output, context) => {
1251
+ const retVal = (output || [])
1252
+ .filter((e) => e != null)
1253
+ .map((entry) => {
1254
+ return de_Event(entry, context);
1255
+ });
1256
+ return retVal;
1257
+ };
1258
+ const de_MemoryRecord = (output, context) => {
1259
+ return take(output, {
1260
+ content: (_) => _json(__expectUnion(_)),
1261
+ createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1262
+ memoryRecordId: __expectString,
1263
+ memoryStrategyId: __expectString,
1264
+ namespaces: _json,
1265
+ });
1266
+ };
1267
+ const de_MemoryRecordSummary = (output, context) => {
1268
+ return take(output, {
1269
+ content: (_) => _json(__expectUnion(_)),
1270
+ createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1271
+ memoryRecordId: __expectString,
1272
+ memoryStrategyId: __expectString,
1273
+ namespaces: _json,
1274
+ score: __limitedParseDouble,
1275
+ });
1276
+ };
1277
+ const de_MemoryRecordSummaryList = (output, context) => {
1278
+ const retVal = (output || [])
1279
+ .filter((e) => e != null)
1280
+ .map((entry) => {
1281
+ return de_MemoryRecordSummary(entry, context);
1282
+ });
1283
+ return retVal;
1284
+ };
1285
+ const de_PayloadType = (output, context) => {
1286
+ if (output.blob != null) {
1287
+ return {
1288
+ blob: de_Document(output.blob, context),
1289
+ };
1290
+ }
1291
+ if (output.conversational != null) {
1292
+ return {
1293
+ conversational: _json(output.conversational),
1294
+ };
1295
+ }
1296
+ return { $unknown: Object.entries(output)[0] };
1297
+ };
1298
+ const de_PayloadTypeList = (output, context) => {
1299
+ const retVal = (output || [])
1300
+ .filter((e) => e != null)
1301
+ .map((entry) => {
1302
+ return de_PayloadType(__expectUnion(entry), context);
1303
+ });
1304
+ return retVal;
1305
+ };
1306
+ const de_ResourceContent = (output, context) => {
1307
+ return take(output, {
1308
+ blob: context.base64Decoder,
1309
+ mimeType: __expectString,
1310
+ text: __expectString,
1311
+ type: __expectString,
1312
+ uri: __expectString,
1313
+ });
1314
+ };
1315
+ const de_SessionSummary = (output, context) => {
1316
+ return take(output, {
1317
+ actorId: __expectString,
1318
+ createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1319
+ sessionId: __expectString,
1320
+ });
1321
+ };
1322
+ const de_SessionSummaryList = (output, context) => {
1323
+ const retVal = (output || [])
1324
+ .filter((e) => e != null)
1325
+ .map((entry) => {
1326
+ return de_SessionSummary(entry, context);
1327
+ });
1328
+ return retVal;
1329
+ };
1330
+ const de_ToolResultStructuredContent = (output, context) => {
1331
+ return take(output, {
1332
+ executionTime: __limitedParseDouble,
1333
+ exitCode: __expectInt32,
1334
+ stderr: __expectString,
1335
+ stdout: __expectString,
1336
+ taskId: __expectString,
1337
+ taskStatus: __expectString,
1338
+ });
1339
+ };
1340
+ const deserializeMetadata = (output) => ({
1341
+ httpStatusCode: output.statusCode,
1342
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1343
+ extendedRequestId: output.headers["x-amz-id-2"],
1344
+ cfId: output.headers["x-amz-cf-id"],
1345
+ });
1346
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1347
+ const _a = "accept";
1348
+ const _b = "baggage";
1349
+ const _cT = "contentType";
1350
+ const _ct = "content-type";
1351
+ const _mPV = "mcpProtocolVersion";
1352
+ const _mSI = "mcpSessionId";
1353
+ const _mpv = "mcp-protocol-version";
1354
+ const _msi = "mcp-session-id";
1355
+ const _q = "qualifier";
1356
+ const _rSI = "runtimeSessionId";
1357
+ const _rUI = "runtimeUserId";
1358
+ const _sI = "sessionId";
1359
+ const _t = "traceparent";
1360
+ const _tI = "traceId";
1361
+ const _tP = "traceParent";
1362
+ const _tS = "traceState";
1363
+ const _tr = "tracestate";
1364
+ const _xabarsi = "x-amzn-bedrock-agentcore-runtime-session-id";
1365
+ const _xabarui = "x-amzn-bedrock-agentcore-runtime-user-id";
1366
+ const _xacisi = "x-amzn-code-interpreter-session-id";
1367
+ const _xati = "x-amzn-trace-id";