@aws/lsp-codewhisperer 0.0.9 → 0.0.11

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 (323) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/node_modules/@amzn/codewhisperer-streaming/package.json +4 -4
  3. package/node_modules/@aws/lsp-fqn/out/common/commonFqnWorkerPool.js +12 -25
  4. package/node_modules/@aws/lsp-fqn/out/common/commonFqnWorkerPool.js.map +1 -1
  5. package/node_modules/@aws/lsp-fqn/out/common/fqnExtractor.js +1 -2
  6. package/node_modules/@aws/lsp-fqn/out/common/fqnExtractor.js.map +1 -1
  7. package/node_modules/@aws/lsp-fqn/package.json +1 -1
  8. package/node_modules/@aws/lsp-fqn/tsconfig.tsbuildinfo +1 -1
  9. package/out/client/streamingClient/codewhispererStreamingClient.d.ts +5 -0
  10. package/out/client/streamingClient/codewhispererStreamingClient.js +25 -0
  11. package/out/client/streamingClient/codewhispererStreamingClient.js.map +1 -0
  12. package/out/client/token/bearer-token-service.json +55 -2
  13. package/out/index.d.ts +1 -0
  14. package/out/index.js +1 -0
  15. package/out/index.js.map +1 -1
  16. package/out/language-server/chat/chatController.js +104 -108
  17. package/out/language-server/chat/chatController.js.map +1 -1
  18. package/out/language-server/chat/chatController.test.js +16 -1
  19. package/out/language-server/chat/chatController.test.js.map +1 -1
  20. package/out/language-server/chat/chatEventParser.js +28 -34
  21. package/out/language-server/chat/chatEventParser.js.map +1 -1
  22. package/out/language-server/chat/chatSessionManagementService.js +22 -36
  23. package/out/language-server/chat/chatSessionManagementService.js.map +1 -1
  24. package/out/language-server/chat/chatSessionService.js +24 -37
  25. package/out/language-server/chat/chatSessionService.js.map +1 -1
  26. package/out/language-server/chat/constants.d.ts +2 -0
  27. package/out/language-server/chat/constants.js +32 -0
  28. package/out/language-server/chat/constants.js.map +1 -0
  29. package/out/language-server/chat/contexts/documentContext.js +11 -24
  30. package/out/language-server/chat/contexts/documentContext.js.map +1 -1
  31. package/out/language-server/chat/contexts/documentFqnExtractor.js +67 -78
  32. package/out/language-server/chat/contexts/documentFqnExtractor.js.map +1 -1
  33. package/out/language-server/chat/contexts/triggerContext.js +32 -44
  34. package/out/language-server/chat/contexts/triggerContext.js.map +1 -1
  35. package/out/language-server/chat/quickActions.d.ts +0 -1
  36. package/out/language-server/chat/quickActions.js +1 -28
  37. package/out/language-server/chat/quickActions.js.map +1 -1
  38. package/out/language-server/chat/telemetry/chatTelemetryController.js +114 -126
  39. package/out/language-server/chat/telemetry/chatTelemetryController.js.map +1 -1
  40. package/out/language-server/chat/utils.d.ts +6 -0
  41. package/out/language-server/chat/utils.js +60 -0
  42. package/out/language-server/chat/utils.js.map +1 -0
  43. package/out/language-server/codeWhispererService.js +13 -11
  44. package/out/language-server/codeWhispererService.js.map +1 -1
  45. package/out/language-server/constants.d.ts +3 -0
  46. package/out/language-server/constants.js +7 -0
  47. package/out/language-server/constants.js.map +1 -0
  48. package/out/language-server/dependencyGraph/csharpDependencyGraph.js +2 -2
  49. package/out/language-server/dependencyGraph/csharpDependencyGraph.js.map +1 -1
  50. package/out/language-server/dependencyGraph/dependencyGraph.js +12 -9
  51. package/out/language-server/dependencyGraph/dependencyGraph.js.map +1 -1
  52. package/out/language-server/dependencyGraph/gitIgnoreFilter.js +1 -0
  53. package/out/language-server/dependencyGraph/gitIgnoreFilter.js.map +1 -1
  54. package/out/language-server/netTransform/artifactManager.d.ts +29 -0
  55. package/out/language-server/netTransform/artifactManager.js +191 -0
  56. package/out/language-server/netTransform/artifactManager.js.map +1 -0
  57. package/out/language-server/netTransform/converter.d.ts +9 -0
  58. package/out/language-server/netTransform/converter.js +108 -0
  59. package/out/language-server/netTransform/converter.js.map +1 -0
  60. package/out/language-server/netTransform/metrics.d.ts +17 -0
  61. package/out/language-server/netTransform/metrics.js +222 -0
  62. package/out/language-server/netTransform/metrics.js.map +1 -0
  63. package/out/language-server/netTransform/models.d.ts +84 -0
  64. package/out/language-server/netTransform/models.js +12 -0
  65. package/out/language-server/netTransform/models.js.map +1 -0
  66. package/out/language-server/netTransform/resources/SupportedProjects.d.ts +2 -0
  67. package/out/language-server/netTransform/resources/SupportedProjects.js +26 -0
  68. package/out/language-server/netTransform/resources/SupportedProjects.js.map +1 -0
  69. package/out/language-server/netTransform/tests/converter.test.d.ts +1 -0
  70. package/out/language-server/netTransform/tests/converter.test.js +265 -0
  71. package/out/language-server/netTransform/tests/converter.test.js.map +1 -0
  72. package/out/language-server/netTransform/tests/mockData.d.ts +21 -0
  73. package/out/language-server/netTransform/tests/mockData.js +60 -0
  74. package/out/language-server/netTransform/tests/mockData.js.map +1 -0
  75. package/out/language-server/netTransform/tests/transformHandler.test.d.ts +1 -0
  76. package/out/language-server/netTransform/tests/transformHandler.test.js +242 -0
  77. package/out/language-server/netTransform/tests/transformHandler.test.js.map +1 -0
  78. package/out/language-server/netTransform/tests/validation.test.d.ts +1 -0
  79. package/out/language-server/netTransform/tests/validation.test.js +80 -0
  80. package/out/language-server/netTransform/tests/validation.test.js.map +1 -0
  81. package/out/language-server/netTransform/transformHandler.d.ts +27 -0
  82. package/out/language-server/netTransform/transformHandler.js +315 -0
  83. package/out/language-server/netTransform/transformHandler.js.map +1 -0
  84. package/out/language-server/netTransform/validation.d.ts +9 -0
  85. package/out/language-server/netTransform/validation.js +79 -0
  86. package/out/language-server/netTransform/validation.js.map +1 -0
  87. package/out/language-server/netTransformServer.d.ts +5 -6
  88. package/out/language-server/netTransformServer.js +149 -15
  89. package/out/language-server/netTransformServer.js.map +1 -1
  90. package/out/language-server/proxy-server.d.ts +1 -0
  91. package/out/language-server/proxy-server.js +16 -1
  92. package/out/language-server/proxy-server.js.map +1 -1
  93. package/out/language-server/securityScan/securityScanDiagnosticsProvider.js +10 -6
  94. package/out/language-server/securityScan/securityScanDiagnosticsProvider.js.map +1 -1
  95. package/out/language-server/securityScan/securityScanHandler.js +4 -0
  96. package/out/language-server/securityScan/securityScanHandler.js.map +1 -1
  97. package/out/language-server/session/sessionManager.js +35 -15
  98. package/out/language-server/session/sessionManager.js.map +1 -1
  99. package/out/language-server/telemetry/codeDiffTracker.js +69 -80
  100. package/out/language-server/telemetry/codeDiffTracker.js.map +1 -1
  101. package/out/language-server/telemetry/codePercentage.js +3 -0
  102. package/out/language-server/telemetry/codePercentage.js.map +1 -1
  103. package/out/language-server/telemetry/metric.js +8 -21
  104. package/out/language-server/telemetry/metric.js.map +1 -1
  105. package/out/language-server/telemetry/types.d.ts +38 -0
  106. package/out/language-server/telemetry/types.js.map +1 -1
  107. package/out/language-server/utils.d.ts +2 -5
  108. package/out/language-server/utils.js +25 -49
  109. package/out/language-server/utils.js.map +1 -1
  110. package/package.json +5 -2
  111. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/HISTORY.md +0 -395
  112. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/LICENSE +0 -201
  113. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/README.md +0 -530
  114. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/dist/worker.js +0 -288
  115. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/dist/worker.js.map +0 -1
  116. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/dist/worker.min.js +0 -2
  117. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/dist/worker.min.js.map +0 -1
  118. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/dist/workerpool.js +0 -1737
  119. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/dist/workerpool.js.map +0 -1
  120. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/dist/workerpool.min.js +0 -3
  121. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/dist/workerpool.min.js.LICENSE.txt +0 -24
  122. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/dist/workerpool.min.js.map +0 -1
  123. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/package.json +0 -57
  124. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/src/Pool.js +0 -476
  125. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/src/Promise.js +0 -293
  126. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/src/WorkerHandler.js +0 -547
  127. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/src/debug-port-allocator.js +0 -28
  128. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/src/environment.js +0 -30
  129. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/src/generated/embeddedWorker.js +0 -6
  130. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/src/header.js +0 -24
  131. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/src/index.js +0 -60
  132. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/src/requireFoolWebpack.js +0 -8
  133. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/src/transfer.js +0 -12
  134. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/src/types.js +0 -46
  135. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/src/validateOptions.js +0 -51
  136. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/src/worker.js +0 -256
  137. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/types/Pool.d.ts +0 -130
  138. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/types/Promise.d.ts +0 -125
  139. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/types/WorkerHandler.d.ts +0 -89
  140. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/types/debug-port-allocator.d.ts +0 -8
  141. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/types/environment.d.ts +0 -4
  142. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/types/generated/embeddedWorker.d.ts +0 -2
  143. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/types/index.d.ts +0 -43
  144. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/types/transfer.d.ts +0 -19
  145. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/types/types.d.ts +0 -99
  146. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/types/validateOptions.d.ts +0 -4
  147. package/node_modules/@aws/lsp-fqn/node_modules/workerpool/types/worker.d.ts +0 -8
  148. package/node_modules/@aws-sdk/middleware-recursion-detection/LICENSE +0 -201
  149. package/node_modules/@aws-sdk/middleware-recursion-detection/README.md +0 -10
  150. package/node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/index.js +0 -39
  151. package/node_modules/@aws-sdk/middleware-recursion-detection/dist-es/index.js +0 -34
  152. package/node_modules/@aws-sdk/middleware-recursion-detection/dist-types/index.d.ts +0 -18
  153. package/node_modules/@aws-sdk/middleware-recursion-detection/dist-types/ts3.4/index.d.ts +0 -18
  154. package/node_modules/@aws-sdk/middleware-recursion-detection/package.json +0 -59
  155. package/node_modules/@aws-sdk/middleware-user-agent/LICENSE +0 -201
  156. package/node_modules/@aws-sdk/middleware-user-agent/README.md +0 -4
  157. package/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/configurations.js +0 -10
  158. package/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/constants.js +0 -10
  159. package/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js +0 -5
  160. package/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/user-agent-middleware.js +0 -79
  161. package/node_modules/@aws-sdk/middleware-user-agent/dist-es/configurations.js +0 -6
  162. package/node_modules/@aws-sdk/middleware-user-agent/dist-es/constants.js +0 -7
  163. package/node_modules/@aws-sdk/middleware-user-agent/dist-es/index.js +0 -2
  164. package/node_modules/@aws-sdk/middleware-user-agent/dist-es/user-agent-middleware.js +0 -72
  165. package/node_modules/@aws-sdk/middleware-user-agent/dist-types/configurations.d.ts +0 -31
  166. package/node_modules/@aws-sdk/middleware-user-agent/dist-types/constants.d.ts +0 -7
  167. package/node_modules/@aws-sdk/middleware-user-agent/dist-types/index.d.ts +0 -2
  168. package/node_modules/@aws-sdk/middleware-user-agent/dist-types/ts3.4/configurations.d.ts +0 -17
  169. package/node_modules/@aws-sdk/middleware-user-agent/dist-types/ts3.4/constants.d.ts +0 -7
  170. package/node_modules/@aws-sdk/middleware-user-agent/dist-types/ts3.4/index.d.ts +0 -2
  171. package/node_modules/@aws-sdk/middleware-user-agent/dist-types/ts3.4/user-agent-middleware.d.ts +0 -20
  172. package/node_modules/@aws-sdk/middleware-user-agent/dist-types/user-agent-middleware.d.ts +0 -17
  173. package/node_modules/@aws-sdk/middleware-user-agent/package.json +0 -61
  174. package/node_modules/@aws-sdk/util-locate-window/LICENSE +0 -201
  175. package/node_modules/@aws-sdk/util-locate-window/README.md +0 -4
  176. package/node_modules/@aws-sdk/util-locate-window/dist-cjs/index.js +0 -41
  177. package/node_modules/@aws-sdk/util-locate-window/dist-es/index.js +0 -10
  178. package/node_modules/@aws-sdk/util-locate-window/dist-types/index.d.ts +0 -6
  179. package/node_modules/@aws-sdk/util-locate-window/dist-types/ts3.4/index.d.ts +0 -1
  180. package/node_modules/@aws-sdk/util-locate-window/package.json +0 -52
  181. package/node_modules/@smithy/eventstream-serde-config-resolver/LICENSE +0 -201
  182. package/node_modules/@smithy/eventstream-serde-config-resolver/README.md +0 -10
  183. package/node_modules/@smithy/eventstream-serde-config-resolver/dist-cjs/EventStreamSerdeConfig.js +0 -1
  184. package/node_modules/@smithy/eventstream-serde-config-resolver/dist-cjs/index.js +0 -37
  185. package/node_modules/@smithy/eventstream-serde-config-resolver/dist-es/EventStreamSerdeConfig.js +0 -4
  186. package/node_modules/@smithy/eventstream-serde-config-resolver/dist-es/index.js +0 -1
  187. package/node_modules/@smithy/eventstream-serde-config-resolver/dist-types/EventStreamSerdeConfig.d.ts +0 -24
  188. package/node_modules/@smithy/eventstream-serde-config-resolver/dist-types/index.d.ts +0 -4
  189. package/node_modules/@smithy/eventstream-serde-config-resolver/dist-types/ts3.4/EventStreamSerdeConfig.d.ts +0 -24
  190. package/node_modules/@smithy/eventstream-serde-config-resolver/dist-types/ts3.4/index.d.ts +0 -4
  191. package/node_modules/@smithy/eventstream-serde-config-resolver/package.json +0 -61
  192. package/node_modules/@smithy/util-utf8/LICENSE +0 -201
  193. package/node_modules/@smithy/util-utf8/README.md +0 -4
  194. package/node_modules/@smithy/util-utf8/dist-cjs/fromUtf8.browser.js +0 -1
  195. package/node_modules/@smithy/util-utf8/dist-cjs/fromUtf8.js +0 -1
  196. package/node_modules/@smithy/util-utf8/dist-cjs/index.js +0 -65
  197. package/node_modules/@smithy/util-utf8/dist-cjs/toUint8Array.js +0 -1
  198. package/node_modules/@smithy/util-utf8/dist-cjs/toUtf8.browser.js +0 -1
  199. package/node_modules/@smithy/util-utf8/dist-cjs/toUtf8.js +0 -1
  200. package/node_modules/@smithy/util-utf8/dist-es/fromUtf8.browser.js +0 -1
  201. package/node_modules/@smithy/util-utf8/dist-es/fromUtf8.js +0 -5
  202. package/node_modules/@smithy/util-utf8/dist-es/index.js +0 -3
  203. package/node_modules/@smithy/util-utf8/dist-es/toUint8Array.js +0 -10
  204. package/node_modules/@smithy/util-utf8/dist-es/toUtf8.browser.js +0 -9
  205. package/node_modules/@smithy/util-utf8/dist-es/toUtf8.js +0 -10
  206. package/node_modules/@smithy/util-utf8/dist-types/fromUtf8.browser.d.ts +0 -1
  207. package/node_modules/@smithy/util-utf8/dist-types/fromUtf8.d.ts +0 -1
  208. package/node_modules/@smithy/util-utf8/dist-types/index.d.ts +0 -3
  209. package/node_modules/@smithy/util-utf8/dist-types/toUint8Array.d.ts +0 -1
  210. package/node_modules/@smithy/util-utf8/dist-types/toUtf8.browser.d.ts +0 -7
  211. package/node_modules/@smithy/util-utf8/dist-types/toUtf8.d.ts +0 -7
  212. package/node_modules/@smithy/util-utf8/dist-types/ts3.4/fromUtf8.browser.d.ts +0 -1
  213. package/node_modules/@smithy/util-utf8/dist-types/ts3.4/fromUtf8.d.ts +0 -1
  214. package/node_modules/@smithy/util-utf8/dist-types/ts3.4/index.d.ts +0 -3
  215. package/node_modules/@smithy/util-utf8/dist-types/ts3.4/toUint8Array.d.ts +0 -1
  216. package/node_modules/@smithy/util-utf8/dist-types/ts3.4/toUtf8.browser.d.ts +0 -7
  217. package/node_modules/@smithy/util-utf8/dist-types/ts3.4/toUtf8.d.ts +0 -7
  218. package/node_modules/@smithy/util-utf8/package.json +0 -66
  219. package/node_modules/bowser/CHANGELOG.md +0 -218
  220. package/node_modules/bowser/LICENSE +0 -39
  221. package/node_modules/bowser/README.md +0 -179
  222. package/node_modules/bowser/bundled.js +0 -1
  223. package/node_modules/bowser/es5.js +0 -1
  224. package/node_modules/bowser/index.d.ts +0 -250
  225. package/node_modules/bowser/package.json +0 -83
  226. package/node_modules/bowser/src/bowser.js +0 -77
  227. package/node_modules/bowser/src/constants.js +0 -116
  228. package/node_modules/bowser/src/parser-browsers.js +0 -700
  229. package/node_modules/bowser/src/parser-engines.js +0 -120
  230. package/node_modules/bowser/src/parser-os.js +0 -199
  231. package/node_modules/bowser/src/parser-platforms.js +0 -266
  232. package/node_modules/bowser/src/parser.js +0 -496
  233. package/node_modules/bowser/src/utils.js +0 -309
  234. package/node_modules/tslib/CopyrightNotice.txt +0 -15
  235. package/node_modules/tslib/LICENSE.txt +0 -12
  236. package/node_modules/tslib/README.md +0 -164
  237. package/node_modules/tslib/SECURITY.md +0 -41
  238. package/node_modules/tslib/modules/index.d.ts +0 -37
  239. package/node_modules/tslib/modules/index.js +0 -68
  240. package/node_modules/tslib/modules/package.json +0 -3
  241. package/node_modules/tslib/package.json +0 -47
  242. package/node_modules/tslib/tslib.d.ts +0 -453
  243. package/node_modules/tslib/tslib.es6.html +0 -1
  244. package/node_modules/tslib/tslib.es6.js +0 -374
  245. package/node_modules/tslib/tslib.es6.mjs +0 -373
  246. package/node_modules/tslib/tslib.html +0 -1
  247. package/node_modules/tslib/tslib.js +0 -424
  248. package/node_modules/uuid/CHANGELOG.md +0 -274
  249. package/node_modules/uuid/CONTRIBUTING.md +0 -18
  250. package/node_modules/uuid/LICENSE.md +0 -9
  251. package/node_modules/uuid/README.md +0 -466
  252. package/node_modules/uuid/dist/bin/uuid +0 -2
  253. package/node_modules/uuid/dist/commonjs-browser/index.js +0 -79
  254. package/node_modules/uuid/dist/commonjs-browser/md5.js +0 -223
  255. package/node_modules/uuid/dist/commonjs-browser/native.js +0 -11
  256. package/node_modules/uuid/dist/commonjs-browser/nil.js +0 -8
  257. package/node_modules/uuid/dist/commonjs-browser/parse.js +0 -45
  258. package/node_modules/uuid/dist/commonjs-browser/regex.js +0 -8
  259. package/node_modules/uuid/dist/commonjs-browser/rng.js +0 -25
  260. package/node_modules/uuid/dist/commonjs-browser/sha1.js +0 -104
  261. package/node_modules/uuid/dist/commonjs-browser/stringify.js +0 -44
  262. package/node_modules/uuid/dist/commonjs-browser/v1.js +0 -107
  263. package/node_modules/uuid/dist/commonjs-browser/v3.js +0 -16
  264. package/node_modules/uuid/dist/commonjs-browser/v35.js +0 -80
  265. package/node_modules/uuid/dist/commonjs-browser/v4.js +0 -43
  266. package/node_modules/uuid/dist/commonjs-browser/v5.js +0 -16
  267. package/node_modules/uuid/dist/commonjs-browser/validate.js +0 -17
  268. package/node_modules/uuid/dist/commonjs-browser/version.js +0 -21
  269. package/node_modules/uuid/dist/esm-browser/index.js +0 -9
  270. package/node_modules/uuid/dist/esm-browser/md5.js +0 -215
  271. package/node_modules/uuid/dist/esm-browser/native.js +0 -4
  272. package/node_modules/uuid/dist/esm-browser/nil.js +0 -1
  273. package/node_modules/uuid/dist/esm-browser/parse.js +0 -35
  274. package/node_modules/uuid/dist/esm-browser/regex.js +0 -1
  275. package/node_modules/uuid/dist/esm-browser/rng.js +0 -18
  276. package/node_modules/uuid/dist/esm-browser/sha1.js +0 -96
  277. package/node_modules/uuid/dist/esm-browser/stringify.js +0 -33
  278. package/node_modules/uuid/dist/esm-browser/v1.js +0 -95
  279. package/node_modules/uuid/dist/esm-browser/v3.js +0 -4
  280. package/node_modules/uuid/dist/esm-browser/v35.js +0 -66
  281. package/node_modules/uuid/dist/esm-browser/v4.js +0 -29
  282. package/node_modules/uuid/dist/esm-browser/v5.js +0 -4
  283. package/node_modules/uuid/dist/esm-browser/validate.js +0 -7
  284. package/node_modules/uuid/dist/esm-browser/version.js +0 -11
  285. package/node_modules/uuid/dist/esm-node/index.js +0 -9
  286. package/node_modules/uuid/dist/esm-node/md5.js +0 -13
  287. package/node_modules/uuid/dist/esm-node/native.js +0 -4
  288. package/node_modules/uuid/dist/esm-node/nil.js +0 -1
  289. package/node_modules/uuid/dist/esm-node/parse.js +0 -35
  290. package/node_modules/uuid/dist/esm-node/regex.js +0 -1
  291. package/node_modules/uuid/dist/esm-node/rng.js +0 -12
  292. package/node_modules/uuid/dist/esm-node/sha1.js +0 -13
  293. package/node_modules/uuid/dist/esm-node/stringify.js +0 -33
  294. package/node_modules/uuid/dist/esm-node/v1.js +0 -95
  295. package/node_modules/uuid/dist/esm-node/v3.js +0 -4
  296. package/node_modules/uuid/dist/esm-node/v35.js +0 -66
  297. package/node_modules/uuid/dist/esm-node/v4.js +0 -29
  298. package/node_modules/uuid/dist/esm-node/v5.js +0 -4
  299. package/node_modules/uuid/dist/esm-node/validate.js +0 -7
  300. package/node_modules/uuid/dist/esm-node/version.js +0 -11
  301. package/node_modules/uuid/dist/index.js +0 -79
  302. package/node_modules/uuid/dist/md5-browser.js +0 -223
  303. package/node_modules/uuid/dist/md5.js +0 -23
  304. package/node_modules/uuid/dist/native-browser.js +0 -11
  305. package/node_modules/uuid/dist/native.js +0 -15
  306. package/node_modules/uuid/dist/nil.js +0 -8
  307. package/node_modules/uuid/dist/parse.js +0 -45
  308. package/node_modules/uuid/dist/regex.js +0 -8
  309. package/node_modules/uuid/dist/rng-browser.js +0 -25
  310. package/node_modules/uuid/dist/rng.js +0 -24
  311. package/node_modules/uuid/dist/sha1-browser.js +0 -104
  312. package/node_modules/uuid/dist/sha1.js +0 -23
  313. package/node_modules/uuid/dist/stringify.js +0 -44
  314. package/node_modules/uuid/dist/uuid-bin.js +0 -85
  315. package/node_modules/uuid/dist/v1.js +0 -107
  316. package/node_modules/uuid/dist/v3.js +0 -16
  317. package/node_modules/uuid/dist/v35.js +0 -80
  318. package/node_modules/uuid/dist/v4.js +0 -43
  319. package/node_modules/uuid/dist/v5.js +0 -16
  320. package/node_modules/uuid/dist/validate.js +0 -17
  321. package/node_modules/uuid/dist/version.js +0 -21
  322. package/node_modules/uuid/package.json +0 -135
  323. package/node_modules/uuid/wrapper.mjs +0 -10
@@ -1,33 +1,20 @@
1
1
  "use strict";
2
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
- if (kind === "m") throw new TypeError("Private method is not writable");
4
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
- };
8
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
- };
13
- var _QChatTriggerContext_instances, _QChatTriggerContext_workspace, _QChatTriggerContext_documentContextExtractor, _QChatTriggerContext_extractDocumentContext, _QChatTriggerContext_guessIntentFromPrompt;
14
2
  Object.defineProperty(exports, "__esModule", { value: true });
15
3
  exports.QChatTriggerContext = void 0;
16
4
  const codewhisperer_streaming_1 = require("@amzn/codewhisperer-streaming");
17
5
  const documentContext_1 = require("./documentContext");
18
6
  class QChatTriggerContext {
7
+ #workspace;
8
+ #documentContextExtractor;
19
9
  constructor(workspace, logger) {
20
- _QChatTriggerContext_instances.add(this);
21
- _QChatTriggerContext_workspace.set(this, void 0);
22
- _QChatTriggerContext_documentContextExtractor.set(this, void 0);
23
- __classPrivateFieldSet(this, _QChatTriggerContext_workspace, workspace, "f");
24
- __classPrivateFieldSet(this, _QChatTriggerContext_documentContextExtractor, new documentContext_1.DocumentContextExtractor({ logger }), "f");
10
+ this.#workspace = workspace;
11
+ this.#documentContextExtractor = new documentContext_1.DocumentContextExtractor({ logger });
25
12
  }
26
13
  async getNewTriggerContext(params) {
27
- const documentContext = await __classPrivateFieldGet(this, _QChatTriggerContext_instances, "m", _QChatTriggerContext_extractDocumentContext).call(this, params);
14
+ const documentContext = await this.#extractDocumentContext(params);
28
15
  return {
29
16
  ...documentContext,
30
- userIntent: __classPrivateFieldGet(this, _QChatTriggerContext_instances, "m", _QChatTriggerContext_guessIntentFromPrompt).call(this, params.prompt.prompt),
17
+ userIntent: this.#guessIntentFromPrompt(params.prompt.prompt),
31
18
  };
32
19
  }
33
20
  getChatParamsFromTrigger(params, triggerContext) {
@@ -59,32 +46,33 @@ class QChatTriggerContext {
59
46
  return data;
60
47
  }
61
48
  dispose() {
62
- __classPrivateFieldGet(this, _QChatTriggerContext_documentContextExtractor, "f").dispose();
49
+ this.#documentContextExtractor.dispose();
63
50
  }
64
- }
65
- exports.QChatTriggerContext = QChatTriggerContext;
66
- _QChatTriggerContext_workspace = new WeakMap(), _QChatTriggerContext_documentContextExtractor = new WeakMap(), _QChatTriggerContext_instances = new WeakSet(), _QChatTriggerContext_extractDocumentContext = async function _QChatTriggerContext_extractDocumentContext(input) {
67
- const { textDocument: textDocumentIdentifier, cursorState = [] } = input;
68
- const textDocument = textDocumentIdentifier?.uri && (await __classPrivateFieldGet(this, _QChatTriggerContext_workspace, "f").getTextDocument(textDocumentIdentifier.uri));
69
- return textDocument
70
- ? __classPrivateFieldGet(this, _QChatTriggerContext_documentContextExtractor, "f").extractDocumentContext(textDocument, cursorState[0])
71
- : undefined;
72
- }, _QChatTriggerContext_guessIntentFromPrompt = function _QChatTriggerContext_guessIntentFromPrompt(prompt) {
73
- if (prompt === undefined) {
74
- return undefined;
75
- }
76
- else if (/^explain/i.test(prompt)) {
77
- return codewhisperer_streaming_1.UserIntent.EXPLAIN_CODE_SELECTION;
78
- }
79
- else if (/^refactor/i.test(prompt)) {
80
- return codewhisperer_streaming_1.UserIntent.SUGGEST_ALTERNATE_IMPLEMENTATION;
51
+ async #extractDocumentContext(input) {
52
+ const { textDocument: textDocumentIdentifier, cursorState = [] } = input;
53
+ const textDocument = textDocumentIdentifier?.uri && (await this.#workspace.getTextDocument(textDocumentIdentifier.uri));
54
+ return textDocument
55
+ ? this.#documentContextExtractor.extractDocumentContext(textDocument, cursorState[0])
56
+ : undefined;
81
57
  }
82
- else if (/^fix/i.test(prompt)) {
83
- return codewhisperer_streaming_1.UserIntent.APPLY_COMMON_BEST_PRACTICES;
84
- }
85
- else if (/^optimize/i.test(prompt)) {
86
- return codewhisperer_streaming_1.UserIntent.IMPROVE_CODE;
58
+ #guessIntentFromPrompt(prompt) {
59
+ if (prompt === undefined) {
60
+ return undefined;
61
+ }
62
+ else if (/^explain/i.test(prompt)) {
63
+ return codewhisperer_streaming_1.UserIntent.EXPLAIN_CODE_SELECTION;
64
+ }
65
+ else if (/^refactor/i.test(prompt)) {
66
+ return codewhisperer_streaming_1.UserIntent.SUGGEST_ALTERNATE_IMPLEMENTATION;
67
+ }
68
+ else if (/^fix/i.test(prompt)) {
69
+ return codewhisperer_streaming_1.UserIntent.APPLY_COMMON_BEST_PRACTICES;
70
+ }
71
+ else if (/^optimize/i.test(prompt)) {
72
+ return codewhisperer_streaming_1.UserIntent.IMPROVE_CODE;
73
+ }
74
+ return undefined;
87
75
  }
88
- return undefined;
89
- };
76
+ }
77
+ exports.QChatTriggerContext = QChatTriggerContext;
90
78
  //# sourceMappingURL=triggerContext.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"triggerContext.js","sourceRoot":"","sources":["../../../../src/language-server/chat/contexts/triggerContext.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,2EAAkH;AAGlH,uDAA6E;AAO7E,MAAa,mBAAmB;IAI5B,YAAY,SAAgC,EAAE,MAA2B;;QAHzE,iDAAiC;QACjC,g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AA;IAC5C,CAAC;CA8BJ;AArFD,kDAqFC;6MA5BG,KAAK,sDACD,KAAuD;IAEvD,MAAM,EAAE,YAAY,EAAE,sBAAsB,EAAE,WAAW,GAAG,EAAE,EAAE,GAAG,KAAK,CAAA;IAExE,MAAM,YAAY,GACd,sBAAsB,EAAE,GAAG,IAAI,CAAC,MAAM,uBAAA,IAAI,sCAAW,CAAC,eAAe,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAA;IAEtG,OAAO,YAAY;QACf,CAAC,CAAC,uBAAA,IAAI,qDAA0B,CAAC,sBAAsB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;QACrF,CAAC,CAAC,SAAS,CAAA;AACnB,CAAC,mGAEsB,MAAe;IAClC,IAAI,MAAM,KAAK,SAAS,EAAE;QACtB,OAAO,SAAS,CAAA;KACnB;SAAM,IAAI,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;QACjC,OAAO,oCAAU,CAAC,sBAAsB,CAAA;KAC3C;SAAM,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;QAClC,OAAO,oCAAU,CAAC,gCAAgC,CAAA;KACrD;SAAM,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;QAC7B,OAAO,oCAAU,CAAC,2BAA2B,CAAA;KAChD;SAAM,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;QAClC,OAAO,oCAAU,CAAC,YAAY,CAAA;KACjC;IAED,OAAO,SAAS,CAAA;AACpB,CAAC"}
1
+ {"version":3,"file":"triggerContext.js","sourceRoot":"","sources":["../../../../src/language-server/chat/contexts/triggerContext.ts"],"names":[],"mappings":";;;AACA,2EAAkH;AAGlH,uDAA6E;AAO7E,MAAa,mBAAmB;IAC5B,UAAU,CAAuB;IACjC,yBAAyB,CAA0B;IAEnD,YAAY,SAAgC,EAAE,MAA2B;QACrE,IAAI,CAAC,UAAU,GAAG,SAAS,CAAA;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sBAAsB,EAAE,WAAW,GAAG,EAAE,EAAE,GAAG,KAAK,CAAA;QAExE,MAAM,YAAY,GACd,sBAAsB,EAAE,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAA;QAEtG,OAAO,YAAY;YACf,CAAC,CAAC,IAAI,CAAC,yBAAyB,CAAC,sBAAsB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;YACrF,CAAC,CAAC,SAAS,CAAA;IACnB,CAAC;IAED,sBAAsB,CAAC,MAAe;QAClC,IAAI,MAAM,KAAK,SAAS,EAAE;YACtB,OAAO,SAAS,CAAA;SACnB;aAAM,IAAI,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YACjC,OAAO,oCAAU,CAAC,sBAAsB,CAAA;SAC3C;aAAM,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YAClC,OAAO,oCAAU,CAAC,gCAAgC,CAAA;SACrD;aAAM,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YAC7B,OAAO,oCAAU,CAAC,2BAA2B,CAAA;SAChD;aAAM,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YAClC,OAAO,oCAAU,CAAC,YAAY,CAAA;SACjC;QAED,OAAO,SAAS,CAAA;IACpB,CAAC;CACJ;AArFD,kDAqFC"}
@@ -10,4 +10,3 @@ export declare const CLEAR_QUICK_ACTION: {
10
10
  command: QuickAction;
11
11
  description: string;
12
12
  };
13
- export declare const HELP_MESSAGE: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HELP_MESSAGE = exports.CLEAR_QUICK_ACTION = exports.HELP_QUICK_ACTION = exports.QuickAction = void 0;
3
+ exports.CLEAR_QUICK_ACTION = exports.HELP_QUICK_ACTION = exports.QuickAction = void 0;
4
4
  var QuickAction;
5
5
  (function (QuickAction) {
6
6
  QuickAction["Clear"] = "/clear";
@@ -14,31 +14,4 @@ exports.CLEAR_QUICK_ACTION = {
14
14
  command: QuickAction.Clear,
15
15
  description: 'Clear this session',
16
16
  };
17
- const userGuideURL = 'https://docs.aws.amazon.com/amazonq/latest/aws-builder-use-ug/getting-started.html';
18
- exports.HELP_MESSAGE = `I'm Amazon Q, a generative AI assistant. Learn more about me below. Your feedback will help me improve.
19
- \n\n### What I can do:
20
- \n\n- Answer questions about AWS
21
- \n\n- Answer questions about general programming concepts
22
- \n\n- Explain what a line of code or code function does
23
- \n\n- Write unit tests and code
24
- \n\n- Debug and fix code
25
- \n\n- Refactor code
26
- \n\n### What I don't do right now:
27
- \n\n- Answer questions in languages other than English
28
- \n\n- Remember conversations from your previous sessions
29
- \n\n- Have information about your AWS account or your specific AWS resources
30
- \n\n### Examples of questions I can answer:
31
- \n\n- When should I use ElastiCache?
32
- \n\n- How do I create an Application Load Balancer?
33
- \n\n- Explain selected code and ask clarifying questions about it.
34
- \n\n- What is the syntax of declaring a variable in TypeScript?
35
- \n\n### Special Commands
36
- \n\n- /clear - Clear the conversation.
37
- \n\n- /help - View chat topics and commands.
38
- \n\n### Things to note:
39
- \n\n- I may not always provide completely accurate or current information.
40
- \n\n- Provide feedback by choosing the like or dislike buttons that appear below answers.
41
- \n\n- When you use Amazon Q, AWS may, for service improvement purposes, store data about your usage and content. You can opt-out of sharing this data by following the steps in AI services opt-out policies. See <a href="https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/opt-out-IDE.html">here</a>
42
- \n\n- Do not enter any confidential, sensitive, or personal information.
43
- \n\n*For additional help, visit the [Amazon Q User Guide](${userGuideURL}).*`;
44
17
  //# sourceMappingURL=quickActions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"quickActions.js","sourceRoot":"","sources":["../../../src/language-server/chat/quickActions.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAGX;AAHD,WAAY,WAAW;IACnB,+BAAgB,CAAA;IAChB,6BAAc,CAAA;AAClB,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB;AAEY,QAAA,iBAAiB,GAAG;IAC7B,OAAO,EAAE,WAAW,CAAC,IAAI;IACzB,WAAW,EAAE,2BAA2B;CAC3C,CAAA;AAEY,QAAA,kBAAkB,GAAG;IAC9B,OAAO,EAAE,WAAW,CAAC,KAAK;IAC1B,WAAW,EAAE,oBAAoB;CACpC,CAAA;AAED,MAAM,YAAY,GAAG,oFAAoF,CAAA;AAE5F,QAAA,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;4DAyBgC,YAAY,KAAK,CAAA"}
1
+ {"version":3,"file":"quickActions.js","sourceRoot":"","sources":["../../../src/language-server/chat/quickActions.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAGX;AAHD,WAAY,WAAW;IACnB,+BAAgB,CAAA;IAChB,6BAAc,CAAA;AAClB,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB;AAEY,QAAA,iBAAiB,GAAG;IAC7B,OAAO,EAAE,WAAW,CAAC,IAAI;IACzB,WAAW,EAAE,2BAA2B;CAC3C,CAAA;AAEY,QAAA,kBAAkB,GAAG;IAC9B,OAAO,EAAE,WAAW,CAAC,KAAK;IAC1B,WAAW,EAAE,oBAAoB;CACpC,CAAA"}
@@ -1,16 +1,4 @@
1
1
  "use strict";
2
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
- if (kind === "m") throw new TypeError("Private method is not writable");
4
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
- };
8
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
- };
13
- var _ChatTelemetryController_instances, _ChatTelemetryController_activeTabId, _ChatTelemetryController_tabTelemetryInfoByTabId, _ChatTelemetryController_currentTriggerByTabId, _ChatTelemetryController_credentialsProvider, _ChatTelemetryController_telemetry, _ChatTelemetryController_codeDiffTracker, _ChatTelemetryController_enqueueCodeDiffEntry, _ChatTelemetryController_handleClientTelemetry;
14
2
  Object.defineProperty(exports, "__esModule", { value: true });
15
3
  exports.convertToTelemetryUserIntent = exports.ChatTelemetryController = exports.CONVERSATION_ID_METRIC_KEY = void 0;
16
4
  const types_1 = require("../../telemetry/types");
@@ -19,44 +7,43 @@ const codewhisperer_streaming_1 = require("@amzn/codewhisperer-streaming");
19
7
  const codeDiffTracker_1 = require("../../telemetry/codeDiffTracker");
20
8
  exports.CONVERSATION_ID_METRIC_KEY = 'cwsprChatConversationId';
21
9
  class ChatTelemetryController {
10
+ #activeTabId;
11
+ #tabTelemetryInfoByTabId;
12
+ #currentTriggerByTabId = {};
13
+ #credentialsProvider;
14
+ #telemetry;
15
+ #codeDiffTracker;
22
16
  constructor(features) {
23
- _ChatTelemetryController_instances.add(this);
24
- _ChatTelemetryController_activeTabId.set(this, void 0);
25
- _ChatTelemetryController_tabTelemetryInfoByTabId.set(this, void 0);
26
- _ChatTelemetryController_currentTriggerByTabId.set(this, {});
27
- _ChatTelemetryController_credentialsProvider.set(this, void 0);
28
- _ChatTelemetryController_telemetry.set(this, void 0);
29
- _ChatTelemetryController_codeDiffTracker.set(this, void 0);
30
- __classPrivateFieldSet(this, _ChatTelemetryController_tabTelemetryInfoByTabId, {}, "f");
31
- __classPrivateFieldSet(this, _ChatTelemetryController_currentTriggerByTabId, {}, "f");
32
- __classPrivateFieldSet(this, _ChatTelemetryController_telemetry, features.telemetry, "f");
33
- __classPrivateFieldSet(this, _ChatTelemetryController_credentialsProvider, features.credentialsProvider, "f");
34
- __classPrivateFieldGet(this, _ChatTelemetryController_telemetry, "f").onClientTelemetry(params => __classPrivateFieldGet(this, _ChatTelemetryController_instances, "m", _ChatTelemetryController_handleClientTelemetry).call(this, params));
35
- __classPrivateFieldSet(this, _ChatTelemetryController_codeDiffTracker, new codeDiffTracker_1.CodeDiffTracker(features.workspace, features.logging, (entry, percentage) => this.emitModifyCodeMetric(entry, percentage)), "f");
17
+ this.#tabTelemetryInfoByTabId = {};
18
+ this.#currentTriggerByTabId = {};
19
+ this.#telemetry = features.telemetry;
20
+ this.#credentialsProvider = features.credentialsProvider;
21
+ this.#telemetry.onClientTelemetry(params => this.#handleClientTelemetry(params));
22
+ this.#codeDiffTracker = new codeDiffTracker_1.CodeDiffTracker(features.workspace, features.logging, (entry, percentage) => this.emitModifyCodeMetric(entry, percentage));
36
23
  }
37
24
  get activeTabId() {
38
- return __classPrivateFieldGet(this, _ChatTelemetryController_activeTabId, "f");
25
+ return this.#activeTabId;
39
26
  }
40
27
  set activeTabId(activeTabId) {
41
- __classPrivateFieldSet(this, _ChatTelemetryController_activeTabId, activeTabId, "f");
28
+ this.#activeTabId = activeTabId;
42
29
  }
43
30
  getCurrentTrigger(tabId) {
44
- return __classPrivateFieldGet(this, _ChatTelemetryController_currentTriggerByTabId, "f")[tabId];
31
+ return this.#currentTriggerByTabId[tabId];
45
32
  }
46
33
  getConversationId(tabId) {
47
- return tabId && __classPrivateFieldGet(this, _ChatTelemetryController_tabTelemetryInfoByTabId, "f")[tabId]?.conversationId;
34
+ return tabId && this.#tabTelemetryInfoByTabId[tabId]?.conversationId;
48
35
  }
49
36
  removeConversation(tabId) {
50
- delete __classPrivateFieldGet(this, _ChatTelemetryController_tabTelemetryInfoByTabId, "f")[tabId];
37
+ delete this.#tabTelemetryInfoByTabId[tabId];
51
38
  }
52
39
  setConversationId(tabId, conversationId) {
53
40
  this.updateTriggerInfo(tabId, { conversationId });
54
41
  }
55
42
  updateTriggerInfo(tabId, info) {
56
- __classPrivateFieldGet(this, _ChatTelemetryController_tabTelemetryInfoByTabId, "f")[tabId] = { ...__classPrivateFieldGet(this, _ChatTelemetryController_tabTelemetryInfoByTabId, "f")[tabId], ...info };
43
+ this.#tabTelemetryInfoByTabId[tabId] = { ...this.#tabTelemetryInfoByTabId[tabId], ...info };
57
44
  }
58
45
  getLastMessageTrigger(tabId) {
59
- return __classPrivateFieldGet(this, _ChatTelemetryController_tabTelemetryInfoByTabId, "f")[tabId]?.lastMessageTrigger;
46
+ return this.#tabTelemetryInfoByTabId[tabId]?.lastMessageTrigger;
60
47
  }
61
48
  emitModifyCodeMetric(entry, percentage) {
62
49
  this.emitConversationMetric({
@@ -68,22 +55,22 @@ class ChatTelemetryController {
68
55
  });
69
56
  }
70
57
  emitChatMetric(metric) {
71
- __classPrivateFieldGet(this, _ChatTelemetryController_telemetry, "f").emitMetric({
58
+ this.#telemetry.emitMetric({
72
59
  ...metric,
73
60
  data: {
74
61
  ...metric.data,
75
- credentialStartUrl: __classPrivateFieldGet(this, _ChatTelemetryController_credentialsProvider, "f").getConnectionMetadata()?.sso?.startUrl,
62
+ credentialStartUrl: this.#credentialsProvider.getConnectionMetadata()?.sso?.startUrl,
76
63
  },
77
64
  });
78
65
  }
79
66
  emitConversationMetric(metric, tabId = this.activeTabId) {
80
67
  const conversationId = this.getConversationId(tabId);
81
68
  if (conversationId) {
82
- __classPrivateFieldGet(this, _ChatTelemetryController_telemetry, "f").emitMetric({
69
+ this.#telemetry.emitMetric({
83
70
  ...metric,
84
71
  data: {
85
72
  ...metric.data,
86
- credentialStartUrl: __classPrivateFieldGet(this, _ChatTelemetryController_credentialsProvider, "f").getConnectionMetadata()?.sso?.startUrl,
73
+ credentialStartUrl: this.#credentialsProvider.getConnectionMetadata()?.sso?.startUrl,
87
74
  [exports.CONVERSATION_ID_METRIC_KEY]: conversationId,
88
75
  },
89
76
  });
@@ -149,101 +136,102 @@ class ChatTelemetryController {
149
136
  },
150
137
  }, tabId);
151
138
  }
152
- dispose() {
153
- __classPrivateFieldGet(this, _ChatTelemetryController_codeDiffTracker, "f").shutdown();
154
- }
155
- }
156
- exports.ChatTelemetryController = ChatTelemetryController;
157
- _ChatTelemetryController_activeTabId = new WeakMap(), _ChatTelemetryController_tabTelemetryInfoByTabId = new WeakMap(), _ChatTelemetryController_currentTriggerByTabId = new WeakMap(), _ChatTelemetryController_credentialsProvider = new WeakMap(), _ChatTelemetryController_telemetry = new WeakMap(), _ChatTelemetryController_codeDiffTracker = new WeakMap(), _ChatTelemetryController_instances = new WeakSet(), _ChatTelemetryController_enqueueCodeDiffEntry = function _ChatTelemetryController_enqueueCodeDiffEntry(params) {
158
- const documentUri = params.textDocument?.uri;
159
- const cursorRangeOrPosition = params.cursorState?.[0];
160
- if (params.code && documentUri && cursorRangeOrPosition) {
161
- const startPosition = 'position' in cursorRangeOrPosition ? cursorRangeOrPosition.position : cursorRangeOrPosition.range.start;
162
- const endPosition = 'position' in cursorRangeOrPosition ? cursorRangeOrPosition.position : cursorRangeOrPosition.range.end;
163
- __classPrivateFieldGet(this, _ChatTelemetryController_codeDiffTracker, "f").enqueue({
164
- messageId: params.messageId,
165
- fileUrl: documentUri,
166
- time: Date.now(),
167
- originalString: params.code,
168
- startPosition,
169
- endPosition,
170
- });
139
+ #enqueueCodeDiffEntry(params) {
140
+ const documentUri = params.textDocument?.uri;
141
+ const cursorRangeOrPosition = params.cursorState?.[0];
142
+ if (params.code && documentUri && cursorRangeOrPosition) {
143
+ const startPosition = 'position' in cursorRangeOrPosition ? cursorRangeOrPosition.position : cursorRangeOrPosition.range.start;
144
+ const endPosition = 'position' in cursorRangeOrPosition ? cursorRangeOrPosition.position : cursorRangeOrPosition.range.end;
145
+ this.#codeDiffTracker.enqueue({
146
+ messageId: params.messageId,
147
+ fileUrl: documentUri,
148
+ time: Date.now(),
149
+ originalString: params.code,
150
+ startPosition,
151
+ endPosition,
152
+ });
153
+ }
171
154
  }
172
- }, _ChatTelemetryController_handleClientTelemetry = function _ChatTelemetryController_handleClientTelemetry(params) {
173
- if ((0, clientTelemetry_1.isClientTelemetryEvent)(params)) {
174
- switch (params.name) {
175
- case clientTelemetry_1.ChatUIEventName.AddMessage:
176
- // we are trusting that the notification comes just right before the request
177
- __classPrivateFieldGet(this, _ChatTelemetryController_currentTriggerByTabId, "f")[params.tabId] = params.triggerType;
178
- break;
179
- case clientTelemetry_1.ChatUIEventName.TabAdd:
180
- __classPrivateFieldGet(this, _ChatTelemetryController_tabTelemetryInfoByTabId, "f")[params.tabId] = {
181
- ...__classPrivateFieldGet(this, _ChatTelemetryController_tabTelemetryInfoByTabId, "f")[params.tabId],
182
- startTrigger: {
183
- triggerType: params.triggerType,
184
- },
185
- };
186
- break;
187
- case clientTelemetry_1.ChatUIEventName.EnterFocusChat:
188
- this.emitChatMetric({
189
- name: types_1.ChatTelemetryEventName.EnterFocusChat,
190
- data: {},
191
- });
192
- break;
193
- case clientTelemetry_1.ChatUIEventName.ExitFocusChat:
194
- this.emitChatMetric({
195
- name: types_1.ChatTelemetryEventName.ExitFocusChat,
196
- data: {},
197
- });
198
- break;
199
- case clientTelemetry_1.ChatUIEventName.Vote:
200
- this.emitConversationMetric({
201
- name: types_1.ChatTelemetryEventName.InteractWithMessage,
202
- data: {
155
+ #handleClientTelemetry(params) {
156
+ if ((0, clientTelemetry_1.isClientTelemetryEvent)(params)) {
157
+ switch (params.name) {
158
+ case clientTelemetry_1.ChatUIEventName.AddMessage:
159
+ // we are trusting that the notification comes just right before the request
160
+ this.#currentTriggerByTabId[params.tabId] = params.triggerType;
161
+ break;
162
+ case clientTelemetry_1.ChatUIEventName.TabAdd:
163
+ this.#tabTelemetryInfoByTabId[params.tabId] = {
164
+ ...this.#tabTelemetryInfoByTabId[params.tabId],
165
+ startTrigger: {
166
+ triggerType: params.triggerType,
167
+ },
168
+ };
169
+ break;
170
+ case clientTelemetry_1.ChatUIEventName.EnterFocusChat:
171
+ this.emitChatMetric({
172
+ name: types_1.ChatTelemetryEventName.EnterFocusChat,
173
+ data: {},
174
+ });
175
+ break;
176
+ case clientTelemetry_1.ChatUIEventName.ExitFocusChat:
177
+ this.emitChatMetric({
178
+ name: types_1.ChatTelemetryEventName.ExitFocusChat,
179
+ data: {},
180
+ });
181
+ break;
182
+ case clientTelemetry_1.ChatUIEventName.Vote:
183
+ this.emitConversationMetric({
184
+ name: types_1.ChatTelemetryEventName.InteractWithMessage,
185
+ data: {
186
+ cwsprChatMessageId: params.messageId,
187
+ cwsprChatInteractionType: params.vote === clientTelemetry_1.RelevancyVoteType.UP
188
+ ? types_1.ChatInteractionType.Upvote
189
+ : types_1.ChatInteractionType.Downvote,
190
+ },
191
+ });
192
+ break;
193
+ case clientTelemetry_1.ChatUIEventName.InsertToCursorPosition:
194
+ case clientTelemetry_1.ChatUIEventName.CopyToClipboard:
195
+ if (params.name === clientTelemetry_1.ChatUIEventName.InsertToCursorPosition) {
196
+ this.#enqueueCodeDiffEntry(params);
197
+ }
198
+ this.emitConversationMetric({
199
+ name: types_1.ChatTelemetryEventName.InteractWithMessage,
200
+ data: {
201
+ cwsprChatMessageId: params.messageId,
202
+ cwsprChatInteractionType: params.name === clientTelemetry_1.ChatUIEventName.InsertToCursorPosition
203
+ ? types_1.ChatInteractionType.InsertAtCursor
204
+ : types_1.ChatInteractionType.CopySnippet,
205
+ cwsprChatAcceptedCharactersLength: params.code?.length ?? 0,
206
+ cwsprChatHasReference: Boolean(params.referenceTrackerInformation?.length),
207
+ cwsprChatCodeBlockIndex: params.codeBlockIndex,
208
+ cwsprChatTotalCodeBlocks: params.totalCodeBlocks,
209
+ },
210
+ });
211
+ break;
212
+ case clientTelemetry_1.ChatUIEventName.LinkClick:
213
+ case clientTelemetry_1.ChatUIEventName.InfoLinkClick:
214
+ this.emitInteractWithMessageMetric(params.tabId, {
203
215
  cwsprChatMessageId: params.messageId,
204
- cwsprChatInteractionType: params.vote === clientTelemetry_1.RelevancyVoteType.UP
205
- ? types_1.ChatInteractionType.Upvote
206
- : types_1.ChatInteractionType.Downvote,
207
- },
208
- });
209
- break;
210
- case clientTelemetry_1.ChatUIEventName.InsertToCursorPosition:
211
- case clientTelemetry_1.ChatUIEventName.CopyToClipboard:
212
- if (params.name === clientTelemetry_1.ChatUIEventName.InsertToCursorPosition) {
213
- __classPrivateFieldGet(this, _ChatTelemetryController_instances, "m", _ChatTelemetryController_enqueueCodeDiffEntry).call(this, params);
214
- }
215
- this.emitConversationMetric({
216
- name: types_1.ChatTelemetryEventName.InteractWithMessage,
217
- data: {
216
+ cwsprChatInteractionType: types_1.ChatInteractionType.ClickBodyLink,
217
+ cwsprChatInteractionTarget: params.link,
218
+ });
219
+ break;
220
+ case clientTelemetry_1.ChatUIEventName.SourceLinkClick:
221
+ this.emitInteractWithMessageMetric(params.tabId, {
218
222
  cwsprChatMessageId: params.messageId,
219
- cwsprChatInteractionType: params.name === clientTelemetry_1.ChatUIEventName.InsertToCursorPosition
220
- ? types_1.ChatInteractionType.InsertAtCursor
221
- : types_1.ChatInteractionType.CopySnippet,
222
- cwsprChatAcceptedCharactersLength: params.code?.length ?? 0,
223
- cwsprChatHasReference: Boolean(params.referenceTrackerInformation?.length),
224
- cwsprChatCodeBlockIndex: params.codeBlockIndex,
225
- cwsprChatTotalCodeBlocks: params.totalCodeBlocks,
226
- },
227
- });
228
- break;
229
- case clientTelemetry_1.ChatUIEventName.LinkClick:
230
- case clientTelemetry_1.ChatUIEventName.InfoLinkClick:
231
- this.emitInteractWithMessageMetric(params.tabId, {
232
- cwsprChatMessageId: params.messageId,
233
- cwsprChatInteractionType: types_1.ChatInteractionType.ClickBodyLink,
234
- cwsprChatInteractionTarget: params.link,
235
- });
236
- break;
237
- case clientTelemetry_1.ChatUIEventName.SourceLinkClick:
238
- this.emitInteractWithMessageMetric(params.tabId, {
239
- cwsprChatMessageId: params.messageId,
240
- cwsprChatInteractionType: types_1.ChatInteractionType.ClickLink,
241
- cwsprChatInteractionTarget: params.link,
242
- });
243
- break;
223
+ cwsprChatInteractionType: types_1.ChatInteractionType.ClickLink,
224
+ cwsprChatInteractionTarget: params.link,
225
+ });
226
+ break;
227
+ }
244
228
  }
245
229
  }
246
- };
230
+ dispose() {
231
+ this.#codeDiffTracker.shutdown();
232
+ }
233
+ }
234
+ exports.ChatTelemetryController = ChatTelemetryController;
247
235
  function convertToTelemetryUserIntent(userIntent) {
248
236
  switch (userIntent) {
249
237
  case codewhisperer_streaming_1.UserIntent.EXPLAIN_CODE_SELECTION:
@@ -1 +1 @@
1
- {"version":3,"file":"chatTelemetryController.js","sourceRoot":"","sources":["../../../../src/language-server/chat/telemetry/chatTelemetryController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,iDAM8B;AAE9B,uDAK0B;AAC1B,2EAA0D;AAE1D,qEAA0F;AAE7E,QAAA,0BAA0B,GAAG,yBAAyB,CAAA;AAgCnE,MAAa,uBAAuB;IAQhC,YAAY,QAAkB;;QAP9B,uDAAqB;QACrB,mEAAsE;QACtE,yDAA2D,EAAE,EAAA;QAC7D,+DAAqD;QACrD,qDAAiC;QACjC,2DAA8D;QAG1D,uBAAA,IAAI,oDAA4B,EAAE,MAAA,CAAA;QAClC,uBAAA,IAAI,kDAA0B,EAAE,MAAA,CAAA;QAChC,uBAAA,IAAI,sCAAc,QAAQ,CAAC,SAAS,MAAA,CAAA;QACpC,uBAAA,IAAI,gDAAwB,QAAQ,CAAC,mBAAmB,MAAA,CAAA;QACxD,uBAAA,IAAI,0CAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC,uBAAA,IAAI,0FAAuB,MAA3B,IAAI,EAAwB,MAAM,CAAC,CAAC,CAAA;QAChF,uBAAA,IAAI,4CAAoB,IAAI,iCAAe,CAAC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,CACpG,IAAI,CAAC,oBAAoB,CAAC,KAA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sB;YAClC,OAAO,sBAAsB,CAAA;QACjC,KAAK,oCAAU,CAAC,gCAAgC;YAC5C,OAAO,gCAAgC,CAAA;QAC3C,KAAK,oCAAU,CAAC,2BAA2B;YACvC,OAAO,0BAA0B,CAAA;QACrC,KAAK,oCAAU,CAAC,YAAY;YACxB,OAAO,aAAa,CAAA;QACxB,KAAK,oCAAU,CAAC,YAAY;YACxB,OAAO,aAAa,CAAA;QACxB,KAAK,oCAAU,CAAC,oBAAoB;YAChC,OAAO,mBAAmB,CAAA;QAC9B,KAAK,oCAAU,CAAC,aAAa;YACzB,OAAO,cAAc,CAAA;QACzB;YACI,OAAO,EAAE,CAAA;KAChB;AACL,CAAC;AAnBD,oEAmBC"}
1
+ {"version":3,"file":"chatTelemetryController.js","sourceRoot":"","sources":["../../../../src/language-server/chat/telemetry/chatTelemetryController.ts"],"names":[],"mappings":";;;AAEA,iDAM8B;AAE9B,uDAK0B;AAC1B,2EAA0D;AAE1D,qEAA0F;AAE7E,QAAA,0BAA0B,GAAG,yBAAyB,CAAA;AAgCnE,MAAa,uBAAuB;IAChC,YAAY,CAAS;IACrB,wBAAwB,CAA8C;IACtE,sBAAsB,GAAqC,EAAE,CAAA;IAC7D,oBAAoB,CAAiC;IACrD,UAAU,CAAuB;IACjC,gBAAgB,CAA8C;IAE9D,YAAY,QAAkB;QAC1B,IAAI,CAAC,wBAAwB,GAAG,EAAE,CAAA;QAClC,IAAI,CAAC,sBAAsB,GAAG,EAAE,CAAA;QAChC,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC,SAAS,CAAA;QACpC,IAAI,CAAC,oBAAoB,GAAG,QAAQ,CAAC,mBAAmB,CAAA;QACxD,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC,CAAA;QAChF,IAAI,CAAC,gBAAgB,GAAG,IAAI,iCAAe,CAAC,QAAQ,CAAC,SAAS,EAAE,QAA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AAgB,4BAA4B,CAAC,UAAuB;IAChE,QAAQ,UAAU,EAAE;QAChB,KAAK,oCAAU,CAAC,sBAAsB;YAClC,OAAO,sBAAsB,CAAA;QACjC,KAAK,oCAAU,CAAC,gCAAgC;YAC5C,OAAO,gCAAgC,CAAA;QAC3C,KAAK,oCAAU,CAAC,2BAA2B;YACvC,OAAO,0BAA0B,CAAA;QACrC,KAAK,oCAAU,CAAC,YAAY;YACxB,OAAO,aAAa,CAAA;QACxB,KAAK,oCAAU,CAAC,YAAY;YACxB,OAAO,aAAa,CAAA;QACxB,KAAK,oCAAU,CAAC,oBAAoB;YAChC,OAAO,mBAAmB,CAAA;QAC9B,KAAK,oCAAU,CAAC,aAAa;YACzB,OAAO,cAAc,CAAA;QACzB;YACI,OAAO,EAAE,CAAA;KAChB;AACL,CAAC;AAnBD,oEAmBC"}
@@ -0,0 +1,6 @@
1
+ import { ChatResult } from '@aws/language-server-runtimes/server-interface';
2
+ type AuthFollowUpType = 'full-auth' | 're-auth' | 'missing_scopes' | 'use-supported-auth';
3
+ export declare function getAuthFollowUpType(err: unknown): AuthFollowUpType | undefined;
4
+ export declare function createAuthFollowUpResult(authType: AuthFollowUpType): ChatResult;
5
+ export declare function getDefaultChatResponse(prompt?: string): ChatResult | undefined;
6
+ export {};
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDefaultChatResponse = exports.createAuthFollowUpResult = exports.getAuthFollowUpType = void 0;
4
+ const constants_1 = require("../constants");
5
+ const constants_2 = require("./constants");
6
+ const uuid_1 = require("uuid");
7
+ const AUTH_ERROR_DEFINITION_LIST = [
8
+ {
9
+ match: (err) => err.message.startsWith(constants_1.MISSING_BEARER_TOKEN_ERROR),
10
+ authFollowType: 'full-auth',
11
+ },
12
+ {
13
+ match: (err) => err.message.startsWith(constants_1.INVALID_TOKEN),
14
+ authFollowType: 're-auth',
15
+ },
16
+ {
17
+ match: (err) => err.message.startsWith(constants_1.GENERIC_UNAUTHORIZED_ERROR),
18
+ authFollowType: 'full-auth',
19
+ },
20
+ ];
21
+ function getAuthFollowUpType(err) {
22
+ return err instanceof Error
23
+ ? AUTH_ERROR_DEFINITION_LIST.find(definition => definition.match(err))?.authFollowType
24
+ : undefined;
25
+ }
26
+ exports.getAuthFollowUpType = getAuthFollowUpType;
27
+ function createAuthFollowUpResult(authType) {
28
+ let pillText;
29
+ switch (authType) {
30
+ case 'full-auth':
31
+ pillText = 'Authenticate';
32
+ break;
33
+ case 'use-supported-auth':
34
+ case 'missing_scopes':
35
+ pillText = 'Enable Amazon Q';
36
+ break;
37
+ case 're-auth':
38
+ pillText = 'Re-authenticate';
39
+ break;
40
+ }
41
+ return {
42
+ body: '',
43
+ followUp: {
44
+ text: '',
45
+ options: [{ pillText, type: authType }],
46
+ },
47
+ };
48
+ }
49
+ exports.createAuthFollowUpResult = createAuthFollowUpResult;
50
+ function getDefaultChatResponse(prompt) {
51
+ if (prompt === constants_2.DEFAULT_HELP_FOLLOW_UP_PROMPT) {
52
+ return {
53
+ messageId: (0, uuid_1.v4)(),
54
+ body: constants_2.HELP_MESSAGE,
55
+ };
56
+ }
57
+ return undefined;
58
+ }
59
+ exports.getDefaultChatResponse = getDefaultChatResponse;
60
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/language-server/chat/utils.ts"],"names":[],"mappings":";;;AACA,4CAAoG;AACpG,2CAAyE;AACzE,+BAAiC;AAMjC,MAAM,0BAA0B,GAA0B;IACtD;QACI,KAAK,EAAE,CAAC,GAAU,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,sCAA0B,CAAC;QACzE,cAAc,EAAE,WAAW;KAC9B;IACD;QACI,KAAK,EAAE,CAAC,GAAU,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,yBAAa,CAAC;QAC5D,cAAc,EAAE,SAAS;KAC5B;IACD;QACI,KAAK,EAAE,CAAC,GAAU,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,sCAA0B,CAAC;QACzE,cAAc,EAAE,WAAW;KAC9B;CACJ,CAAA;AAED,SAAgB,mBAAmB,CAAC,GAAY;IAC5C,OAAO,GAAG,YAAY,KAAK;QACvB,CAAC,CAAC,0BAA0B,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,cAAc;QACtF,CAAC,CAAC,SAAS,CAAA;AACnB,CAAC;AAJD,kDAIC;AAED,SAAgB,wBAAwB,CAAC,QAA0B;IAC/D,IAAI,QAAQ,CAAA;IACZ,QAAQ,QAAQ,EAAE;QACd,KAAK,WAAW;YACZ,QAAQ,GAAG,cAAc,CAAA;YACzB,MAAK;QACT,KAAK,oBAAoB,CAAC;QAC1B,KAAK,gBAAgB;YACjB,QAAQ,GAAG,iBAAiB,CAAA;YAC5B,MAAK;QACT,KAAK,SAAS;YACV,QAAQ,GAAG,iBAAiB,CAAA;YAC5B,MAAK;KACZ;IAED,OAAO;QACH,IAAI,EAAE,EAAE;QACR,QAAQ,EAAE;YACN,IAAI,EAAE,EAAE;YACR,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;SAC1C;KACJ,CAAA;AACL,CAAC;AAtBD,4DAsBC;AAED,SAAgB,sBAAsB,CAAC,MAAe;IAClD,IAAI,MAAM,KAAK,yCAA6B,EAAE;QAC1C,OAAO;YACH,SAAS,EAAE,IAAA,SAAI,GAAE;YACjB,IAAI,EAAE,wBAAY;SACrB,CAAA;KACJ;IAED,OAAO,SAAS,CAAA;AACpB,CAAC;AATD,wDASC"}
@@ -9,23 +9,24 @@ const AWS = require("aws-sdk");
9
9
  // Right now the only difference between the token client and the IAM client for codewhsiperer is the difference in function name
10
10
  // This abstract class can grow in the future to account for any additional changes across the clients
11
11
  class CodeWhispererServiceBase {
12
+ codeWhispererRegion = 'us-east-1';
13
+ codeWhispererEndpoint = 'https://codewhisperer.us-east-1.amazonaws.com/';
14
+ shareCodeWhispererContentWithAWS = false;
12
15
  constructor(credentialsProvider, additionalAwsConfig = {}) {
13
- this.codeWhispererRegion = 'us-east-1';
14
- this.codeWhispererEndpoint = 'https://codewhisperer.us-east-1.amazonaws.com/';
15
- this.shareCodeWhispererContentWithAWS = false;
16
- this.updateAwsConfiguration = (awsConfig) => {
17
- if (awsConfig?.proxy) {
18
- AWS.config.update({
19
- httpOptions: { agent: awsConfig.proxy },
20
- });
21
- }
22
- };
23
- this.generateItemId = () => (0, uuid_1.v4)();
24
16
  this.updateAwsConfiguration(additionalAwsConfig);
25
17
  }
18
+ updateAwsConfiguration = (awsConfig) => {
19
+ if (awsConfig?.proxy) {
20
+ AWS.config.update({
21
+ httpOptions: { agent: awsConfig.proxy },
22
+ });
23
+ }
24
+ };
25
+ generateItemId = () => (0, uuid_1.v4)();
26
26
  }
27
27
  exports.CodeWhispererServiceBase = CodeWhispererServiceBase;
28
28
  class CodeWhispererServiceIAM extends CodeWhispererServiceBase {
29
+ client;
29
30
  constructor(credentialsProvider, additionalAwsConfig = {}) {
30
31
  super(credentialsProvider, additionalAwsConfig);
31
32
  const options = {
@@ -60,6 +61,7 @@ class CodeWhispererServiceIAM extends CodeWhispererServiceBase {
60
61
  }
61
62
  exports.CodeWhispererServiceIAM = CodeWhispererServiceIAM;
62
63
  class CodeWhispererServiceToken extends CodeWhispererServiceBase {
64
+ client;
63
65
  constructor(credentialsProvider, additionalAwsConfig = {}) {
64
66
  super(credentialsProvider, additionalAwsConfig);
65
67
  const options = {