@aws/lsp-codewhisperer 0.0.39 → 0.0.41

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 (432) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/node_modules/@amzn/codewhisperer-streaming/README.md +56 -0
  3. package/node_modules/@amzn/codewhisperer-streaming/dist-cjs/protocols/Aws_restJson1.js +2 -0
  4. package/node_modules/@amzn/codewhisperer-streaming/dist-es/protocols/Aws_restJson1.js +2 -0
  5. package/node_modules/@amzn/codewhisperer-streaming/dist-types/commands/GenerateAssistantResponseCommand.d.ts +3 -0
  6. package/node_modules/@amzn/codewhisperer-streaming/dist-types/commands/GenerateTaskAssistPlanCommand.d.ts +3 -0
  7. package/node_modules/@amzn/codewhisperer-streaming/dist-types/commands/SendMessageCommand.d.ts +3 -0
  8. package/node_modules/@amzn/codewhisperer-streaming/dist-types/models/models_0.d.ts +10 -0
  9. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/abort-controller/package.json +2 -2
  10. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +0 -2
  11. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +0 -1
  12. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-pool.d.ts +1 -2
  13. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/readable.mock.d.ts +0 -3
  14. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/set-connection-timeout.d.ts +0 -7
  15. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/set-socket-keep-alive.d.ts +0 -7
  16. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +0 -7
  17. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/stream-collector/collector.d.ts +0 -3
  18. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/stream-collector/readable.mock.d.ts +0 -3
  19. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts +0 -1
  20. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-manager.d.ts +0 -1
  21. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-pool.d.ts +1 -2
  22. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/ts3.4/readable.mock.d.ts +0 -1
  23. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts +0 -1
  24. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-keep-alive.d.ts +0 -1
  25. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +0 -1
  26. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/collector.d.ts +0 -1
  27. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/readable.mock.d.ts +0 -1
  28. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/ts3.4/write-request-body.d.ts +0 -1
  29. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/write-request-body.d.ts +0 -2
  30. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/package.json +5 -5
  31. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/LICENSE +201 -0
  32. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/README.md +115 -0
  33. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/abort-handler.js +1 -0
  34. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/abort.js +1 -0
  35. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/auth/HttpApiKeyAuth.js +1 -0
  36. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/auth/HttpAuthScheme.js +1 -0
  37. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/auth/HttpAuthSchemeProvider.js +1 -0
  38. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/auth/HttpSigner.js +1 -0
  39. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/auth/IdentityProviderConfig.js +1 -0
  40. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/auth/auth.js +1 -0
  41. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/auth/index.js +1 -0
  42. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/blob/blob-payload-input-types.js +1 -0
  43. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/checksum.js +1 -0
  44. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/client.js +1 -0
  45. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/command.js +1 -0
  46. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/connection/config.js +1 -0
  47. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/connection/index.js +1 -0
  48. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/connection/manager.js +1 -0
  49. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/connection/pool.js +1 -0
  50. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/crypto.js +1 -0
  51. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/downlevel-ts3.4/transform/type-transform.js +1 -0
  52. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/encode.js +1 -0
  53. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/endpoint.js +1 -0
  54. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/endpoints/EndpointRuleObject.js +1 -0
  55. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/endpoints/ErrorRuleObject.js +1 -0
  56. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/endpoints/RuleSetObject.js +1 -0
  57. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/endpoints/TreeRuleObject.js +1 -0
  58. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/endpoints/index.js +1 -0
  59. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/endpoints/shared.js +1 -0
  60. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/eventStream.js +1 -0
  61. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/extensions/checksum.js +1 -0
  62. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/extensions/defaultClientConfiguration.js +1 -0
  63. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/extensions/defaultExtensionConfiguration.js +1 -0
  64. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/extensions/index.js +1 -0
  65. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/extensions/retry.js +1 -0
  66. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/externals-check/browser-externals-check.js +1 -0
  67. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/feature-ids.js +1 -0
  68. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/http/httpHandlerInitialization.js +1 -0
  69. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/http.js +1 -0
  70. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/identity/apiKeyIdentity.js +1 -0
  71. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/identity/awsCredentialIdentity.js +1 -0
  72. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/identity/identity.js +1 -0
  73. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/identity/index.js +1 -0
  74. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/identity/tokenIdentity.js +1 -0
  75. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/index.js +144 -0
  76. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/logger.js +1 -0
  77. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/middleware.js +1 -0
  78. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/pagination.js +1 -0
  79. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/profile.js +1 -0
  80. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/response.js +1 -0
  81. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/retry.js +1 -0
  82. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/schema/schema.js +1 -0
  83. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/schema/sentinels.js +1 -0
  84. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/schema/traits.js +1 -0
  85. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/serde.js +1 -0
  86. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/shapes.js +1 -0
  87. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/signature.js +1 -0
  88. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/stream.js +1 -0
  89. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/streaming-payload/streaming-blob-common-types.js +1 -0
  90. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/streaming-payload/streaming-blob-payload-input-types.js +1 -0
  91. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/streaming-payload/streaming-blob-payload-output-types.js +1 -0
  92. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/transfer.js +1 -0
  93. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/transform/client-method-transforms.js +1 -0
  94. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/transform/client-payload-blob-type-narrow.js +1 -0
  95. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/transform/exact.js +1 -0
  96. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/transform/mutable.js +1 -0
  97. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/transform/no-undefined.js +1 -0
  98. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/transform/type-transform.js +1 -0
  99. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/uri.js +1 -0
  100. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/util.js +1 -0
  101. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-cjs/waiter.js +1 -0
  102. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/abort-handler.js +1 -0
  103. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/abort.js +1 -0
  104. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/auth/HttpApiKeyAuth.js +5 -0
  105. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/auth/HttpAuthScheme.js +1 -0
  106. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/auth/HttpAuthSchemeProvider.js +1 -0
  107. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/auth/HttpSigner.js +1 -0
  108. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/auth/IdentityProviderConfig.js +1 -0
  109. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/auth/auth.js +5 -0
  110. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/auth/index.js +6 -0
  111. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/blob/blob-payload-input-types.js +1 -0
  112. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/checksum.js +1 -0
  113. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/client.js +1 -0
  114. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/command.js +1 -0
  115. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/connection/config.js +1 -0
  116. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/connection/index.js +3 -0
  117. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/connection/manager.js +1 -0
  118. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/connection/pool.js +1 -0
  119. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/crypto.js +1 -0
  120. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/downlevel-ts3.4/transform/type-transform.js +1 -0
  121. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/encode.js +1 -0
  122. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/endpoint.js +5 -0
  123. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/endpoints/EndpointRuleObject.js +1 -0
  124. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/endpoints/ErrorRuleObject.js +1 -0
  125. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/endpoints/RuleSetObject.js +1 -0
  126. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/endpoints/TreeRuleObject.js +1 -0
  127. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/endpoints/index.js +5 -0
  128. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/endpoints/shared.js +1 -0
  129. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/eventStream.js +1 -0
  130. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/extensions/checksum.js +38 -0
  131. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/extensions/defaultClientConfiguration.js +7 -0
  132. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/extensions/defaultExtensionConfiguration.js +1 -0
  133. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/extensions/index.js +3 -0
  134. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/extensions/retry.js +1 -0
  135. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/externals-check/browser-externals-check.js +1 -0
  136. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/feature-ids.js +1 -0
  137. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/http/httpHandlerInitialization.js +1 -0
  138. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/http.js +5 -0
  139. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/identity/apiKeyIdentity.js +1 -0
  140. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/identity/awsCredentialIdentity.js +1 -0
  141. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/identity/identity.js +1 -0
  142. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/identity/index.js +4 -0
  143. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/identity/tokenIdentity.js +1 -0
  144. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/index.js +40 -0
  145. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/logger.js +1 -0
  146. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/middleware.js +1 -0
  147. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/pagination.js +1 -0
  148. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/profile.js +6 -0
  149. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/response.js +1 -0
  150. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/retry.js +1 -0
  151. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/schema/schema.js +1 -0
  152. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/schema/sentinels.js +1 -0
  153. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/schema/traits.js +1 -0
  154. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/serde.js +1 -0
  155. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/shapes.js +1 -0
  156. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/signature.js +1 -0
  157. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/stream.js +1 -0
  158. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-common-types.js +1 -0
  159. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-input-types.js +1 -0
  160. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-output-types.js +1 -0
  161. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/transfer.js +6 -0
  162. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/transform/client-method-transforms.js +1 -0
  163. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/transform/client-payload-blob-type-narrow.js +1 -0
  164. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/transform/exact.js +1 -0
  165. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/transform/mutable.js +1 -0
  166. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/transform/no-undefined.js +1 -0
  167. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/transform/type-transform.js +1 -0
  168. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/uri.js +1 -0
  169. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/util.js +1 -0
  170. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-es/waiter.js +1 -0
  171. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/abort-handler.d.ts +7 -0
  172. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/abort.d.ts +50 -0
  173. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/auth/HttpApiKeyAuth.d.ts +7 -0
  174. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/auth/HttpAuthScheme.d.ts +49 -0
  175. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/auth/HttpAuthSchemeProvider.d.ts +20 -0
  176. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/auth/HttpSigner.d.ts +41 -0
  177. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/auth/IdentityProviderConfig.d.ts +14 -0
  178. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/auth/auth.d.ts +57 -0
  179. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/auth/index.d.ts +6 -0
  180. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/blob/blob-payload-input-types.d.ts +40 -0
  181. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/checksum.d.ts +63 -0
  182. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/client.d.ts +57 -0
  183. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/command.d.ts +25 -0
  184. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/connection/config.d.ts +10 -0
  185. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/connection/index.d.ts +3 -0
  186. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/connection/manager.d.ts +34 -0
  187. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/connection/pool.d.ts +32 -0
  188. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/crypto.d.ts +60 -0
  189. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/downlevel-ts3.4/transform/type-transform.d.ts +25 -0
  190. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/encode.d.ts +31 -0
  191. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/endpoint.d.ts +77 -0
  192. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/endpoints/EndpointRuleObject.d.ts +27 -0
  193. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/endpoints/ErrorRuleObject.d.ts +10 -0
  194. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/endpoints/RuleSetObject.d.ts +28 -0
  195. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/endpoints/TreeRuleObject.d.ts +16 -0
  196. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/endpoints/index.d.ts +5 -0
  197. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/endpoints/shared.d.ts +55 -0
  198. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/eventStream.d.ts +137 -0
  199. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/extensions/checksum.d.ts +58 -0
  200. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/extensions/defaultClientConfiguration.d.ts +33 -0
  201. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/extensions/defaultExtensionConfiguration.d.ts +9 -0
  202. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/extensions/index.d.ts +4 -0
  203. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/extensions/retry.d.ts +18 -0
  204. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/externals-check/browser-externals-check.d.ts +35 -0
  205. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/feature-ids.d.ts +16 -0
  206. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/http/httpHandlerInitialization.d.ts +121 -0
  207. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/http.d.ts +112 -0
  208. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/identity/apiKeyIdentity.d.ts +14 -0
  209. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/identity/awsCredentialIdentity.d.ts +31 -0
  210. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/identity/identity.d.ts +15 -0
  211. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/identity/index.d.ts +4 -0
  212. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/identity/tokenIdentity.d.ts +14 -0
  213. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/index.d.ts +40 -0
  214. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/logger.d.ts +13 -0
  215. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/middleware.d.ts +534 -0
  216. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/pagination.d.ts +33 -0
  217. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/profile.d.ts +30 -0
  218. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/response.d.ts +40 -0
  219. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/retry.d.ts +133 -0
  220. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/schema/schema.d.ts +263 -0
  221. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/schema/sentinels.d.ts +65 -0
  222. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/schema/traits.d.ts +46 -0
  223. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/serde.d.ts +114 -0
  224. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/shapes.d.ts +82 -0
  225. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/signature.d.ts +155 -0
  226. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/stream.d.ts +22 -0
  227. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-common-types.d.ts +32 -0
  228. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-payload-input-types.d.ts +60 -0
  229. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-payload-output-types.d.ts +51 -0
  230. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/transfer.d.ts +41 -0
  231. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/transform/client-method-transforms.d.ts +26 -0
  232. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/transform/client-payload-blob-type-narrow.d.ts +77 -0
  233. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/transform/exact.d.ts +6 -0
  234. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/transform/mutable.d.ts +6 -0
  235. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/transform/no-undefined.d.ts +68 -0
  236. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/transform/type-transform.d.ts +34 -0
  237. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/abort-handler.d.ts +7 -0
  238. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/abort.d.ts +50 -0
  239. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpApiKeyAuth.d.ts +7 -0
  240. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpAuthScheme.d.ts +49 -0
  241. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpAuthSchemeProvider.d.ts +20 -0
  242. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpSigner.d.ts +41 -0
  243. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/auth/IdentityProviderConfig.d.ts +14 -0
  244. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/auth/auth.d.ts +57 -0
  245. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/auth/index.d.ts +6 -0
  246. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/blob/blob-payload-input-types.d.ts +40 -0
  247. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/checksum.d.ts +63 -0
  248. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/client.d.ts +57 -0
  249. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/command.d.ts +25 -0
  250. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/connection/config.d.ts +10 -0
  251. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/connection/index.d.ts +3 -0
  252. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/connection/manager.d.ts +34 -0
  253. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/connection/pool.d.ts +32 -0
  254. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/crypto.d.ts +60 -0
  255. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/downlevel-ts3.4/transform/type-transform.d.ts +41 -0
  256. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/encode.d.ts +31 -0
  257. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/endpoint.d.ts +77 -0
  258. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/endpoints/EndpointRuleObject.d.ts +27 -0
  259. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/endpoints/ErrorRuleObject.d.ts +10 -0
  260. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/endpoints/RuleSetObject.d.ts +28 -0
  261. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/endpoints/TreeRuleObject.d.ts +16 -0
  262. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/endpoints/index.d.ts +5 -0
  263. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/endpoints/shared.d.ts +55 -0
  264. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/eventStream.d.ts +137 -0
  265. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/extensions/checksum.d.ts +58 -0
  266. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/extensions/defaultClientConfiguration.d.ts +33 -0
  267. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/extensions/defaultExtensionConfiguration.d.ts +9 -0
  268. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/extensions/index.d.ts +4 -0
  269. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/extensions/retry.d.ts +18 -0
  270. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/externals-check/browser-externals-check.d.ts +35 -0
  271. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/feature-ids.d.ts +16 -0
  272. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/http/httpHandlerInitialization.d.ts +121 -0
  273. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/http.d.ts +112 -0
  274. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/identity/apiKeyIdentity.d.ts +14 -0
  275. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/identity/awsCredentialIdentity.d.ts +31 -0
  276. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/identity/identity.d.ts +15 -0
  277. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/identity/index.d.ts +4 -0
  278. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/identity/tokenIdentity.d.ts +14 -0
  279. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/index.d.ts +40 -0
  280. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/logger.d.ts +13 -0
  281. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/middleware.d.ts +534 -0
  282. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/pagination.d.ts +33 -0
  283. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/profile.d.ts +30 -0
  284. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/response.d.ts +40 -0
  285. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/retry.d.ts +133 -0
  286. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/schema/schema.d.ts +278 -0
  287. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/schema/sentinels.d.ts +65 -0
  288. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/schema/traits.d.ts +46 -0
  289. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/serde.d.ts +114 -0
  290. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/shapes.d.ts +82 -0
  291. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/signature.d.ts +155 -0
  292. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/stream.d.ts +22 -0
  293. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-common-types.d.ts +32 -0
  294. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-payload-input-types.d.ts +60 -0
  295. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-payload-output-types.d.ts +51 -0
  296. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/transfer.d.ts +41 -0
  297. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/transform/client-method-transforms.d.ts +26 -0
  298. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/transform/client-payload-blob-type-narrow.d.ts +81 -0
  299. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/transform/exact.d.ts +14 -0
  300. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/transform/mutable.d.ts +6 -0
  301. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/transform/no-undefined.d.ts +88 -0
  302. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/transform/type-transform.d.ts +41 -0
  303. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/uri.d.ts +17 -0
  304. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/util.d.ts +192 -0
  305. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/ts3.4/waiter.d.ts +35 -0
  306. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/uri.d.ts +17 -0
  307. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/util.d.ts +176 -0
  308. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/dist-types/waiter.d.ts +35 -0
  309. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/types/package.json +60 -0
  310. package/node_modules/@amzn/codewhisperer-streaming/package.json +1 -1
  311. package/out/client/sigv4/service.json +8 -0
  312. package/out/client/token/bearer-token-service.json +20 -0
  313. package/out/language-server/agenticChat/agenticChatController.d.ts +9 -3
  314. package/out/language-server/agenticChat/agenticChatController.js +379 -85
  315. package/out/language-server/agenticChat/agenticChatController.js.map +1 -1
  316. package/out/language-server/agenticChat/agenticChatResultStream.d.ts +9 -0
  317. package/out/language-server/agenticChat/agenticChatResultStream.js +41 -1
  318. package/out/language-server/agenticChat/agenticChatResultStream.js.map +1 -1
  319. package/out/language-server/agenticChat/constants.d.ts +0 -1
  320. package/out/language-server/agenticChat/constants.js +1 -2
  321. package/out/language-server/agenticChat/constants.js.map +1 -1
  322. package/out/language-server/agenticChat/context/addtionalContextProvider.d.ts +2 -3
  323. package/out/language-server/agenticChat/context/addtionalContextProvider.js +3 -5
  324. package/out/language-server/agenticChat/context/addtionalContextProvider.js.map +1 -1
  325. package/out/language-server/agenticChat/context/agenticChatTriggerContext.d.ts +1 -0
  326. package/out/language-server/agenticChat/context/agenticChatTriggerContext.js +15 -2
  327. package/out/language-server/agenticChat/context/agenticChatTriggerContext.js.map +1 -1
  328. package/out/language-server/agenticChat/context/contextCommandsProvider.d.ts +1 -1
  329. package/out/language-server/agenticChat/context/contextCommandsProvider.js +8 -24
  330. package/out/language-server/agenticChat/context/contextCommandsProvider.js.map +1 -1
  331. package/out/language-server/agenticChat/errors.d.ts +2 -1
  332. package/out/language-server/agenticChat/errors.js +11 -1
  333. package/out/language-server/agenticChat/errors.js.map +1 -1
  334. package/out/language-server/agenticChat/tabBarController.d.ts +10 -1
  335. package/out/language-server/agenticChat/tabBarController.js +54 -27
  336. package/out/language-server/agenticChat/tabBarController.js.map +1 -1
  337. package/out/language-server/agenticChat/tools/chatDb/chatDb.d.ts +8 -9
  338. package/out/language-server/agenticChat/tools/chatDb/chatDb.js +58 -124
  339. package/out/language-server/agenticChat/tools/chatDb/chatDb.js.map +1 -1
  340. package/out/language-server/agenticChat/tools/codeSearch.js +1 -1
  341. package/out/language-server/agenticChat/tools/codeSearch.js.map +1 -1
  342. package/out/language-server/agenticChat/tools/executeBash.d.ts +10 -2
  343. package/out/language-server/agenticChat/tools/executeBash.js +80 -21
  344. package/out/language-server/agenticChat/tools/executeBash.js.map +1 -1
  345. package/out/language-server/agenticChat/tools/fsRead.js +1 -1
  346. package/out/language-server/agenticChat/tools/fsRead.js.map +1 -1
  347. package/out/language-server/agenticChat/tools/fsWrite.js +1 -1
  348. package/out/language-server/agenticChat/tools/fsWrite.js.map +1 -1
  349. package/out/language-server/agenticChat/tools/{fileSearch.d.ts → fuzzySearch.d.ts} +17 -11
  350. package/out/language-server/agenticChat/tools/{fileSearch.js → fuzzySearch.js} +53 -55
  351. package/out/language-server/agenticChat/tools/fuzzySearch.js.map +1 -0
  352. package/out/language-server/agenticChat/tools/grepSearch.d.ts +74 -0
  353. package/out/language-server/agenticChat/tools/grepSearch.js +254 -0
  354. package/out/language-server/agenticChat/tools/grepSearch.js.map +1 -0
  355. package/out/language-server/agenticChat/tools/listDirectory.js +1 -1
  356. package/out/language-server/agenticChat/tools/listDirectory.js.map +1 -1
  357. package/out/language-server/agenticChat/tools/toolServer.js +14 -5
  358. package/out/language-server/agenticChat/tools/toolServer.js.map +1 -1
  359. package/out/language-server/agenticChat/tools/toolShared.d.ts +1 -1
  360. package/out/language-server/agenticChat/tools/toolShared.js +2 -2
  361. package/out/language-server/agenticChat/tools/toolShared.js.map +1 -1
  362. package/out/language-server/chat/chatController.d.ts +1 -1
  363. package/out/language-server/chat/chatController.js.map +1 -1
  364. package/out/language-server/chat/chatSessionService.d.ts +13 -0
  365. package/out/language-server/chat/chatSessionService.js +28 -4
  366. package/out/language-server/chat/chatSessionService.js.map +1 -1
  367. package/out/language-server/chat/contexts/triggerContext.js +1 -0
  368. package/out/language-server/chat/contexts/triggerContext.js.map +1 -1
  369. package/out/language-server/chat/telemetry/chatTelemetryController.d.ts +5 -4
  370. package/out/language-server/chat/telemetry/chatTelemetryController.js +29 -5
  371. package/out/language-server/chat/telemetry/chatTelemetryController.js.map +1 -1
  372. package/out/language-server/inline-completion/codePercentage.js +1 -0
  373. package/out/language-server/inline-completion/codePercentage.js.map +1 -1
  374. package/out/language-server/inline-completion/codeWhispererServer.d.ts +1 -0
  375. package/out/language-server/inline-completion/codeWhispererServer.js +55 -19
  376. package/out/language-server/inline-completion/codeWhispererServer.js.map +1 -1
  377. package/out/language-server/inline-completion/session/sessionManager.d.ts +5 -1
  378. package/out/language-server/inline-completion/session/sessionManager.js +4 -0
  379. package/out/language-server/inline-completion/session/sessionManager.js.map +1 -1
  380. package/out/language-server/localProjectContext/localProjectContextServer.js +8 -8
  381. package/out/language-server/localProjectContext/localProjectContextServer.js.map +1 -1
  382. package/out/language-server/workspaceContext/artifactManager.d.ts +1 -1
  383. package/out/language-server/workspaceContext/artifactManager.js +55 -22
  384. package/out/language-server/workspaceContext/artifactManager.js.map +1 -1
  385. package/out/language-server/workspaceContext/client.d.ts +1 -2
  386. package/out/language-server/workspaceContext/client.js +8 -16
  387. package/out/language-server/workspaceContext/client.js.map +1 -1
  388. package/out/language-server/workspaceContext/dependency/dependencyDiscoverer.d.ts +2 -0
  389. package/out/language-server/workspaceContext/dependency/dependencyDiscoverer.js +11 -1
  390. package/out/language-server/workspaceContext/dependency/dependencyDiscoverer.js.map +1 -1
  391. package/out/language-server/workspaceContext/dependency/dependencyHandler/DependencyWatcher.d.ts +17 -0
  392. package/out/language-server/workspaceContext/dependency/dependencyHandler/DependencyWatcher.js +75 -0
  393. package/out/language-server/workspaceContext/dependency/dependencyHandler/DependencyWatcher.js.map +1 -0
  394. package/out/language-server/workspaceContext/dependency/dependencyHandler/JSTSDependencyHandler.js +9 -9
  395. package/out/language-server/workspaceContext/dependency/dependencyHandler/JSTSDependencyHandler.js.map +1 -1
  396. package/out/language-server/workspaceContext/dependency/dependencyHandler/JavaDependencyHandler.js +9 -9
  397. package/out/language-server/workspaceContext/dependency/dependencyHandler/JavaDependencyHandler.js.map +1 -1
  398. package/out/language-server/workspaceContext/dependency/dependencyHandler/LanguageDependencyHandler.d.ts +7 -5
  399. package/out/language-server/workspaceContext/dependency/dependencyHandler/LanguageDependencyHandler.js +21 -15
  400. package/out/language-server/workspaceContext/dependency/dependencyHandler/LanguageDependencyHandler.js.map +1 -1
  401. package/out/language-server/workspaceContext/dependency/dependencyHandler/LanguageDependencyHandlerFactory.d.ts +1 -1
  402. package/out/language-server/workspaceContext/dependency/dependencyHandler/LanguageDependencyHandlerFactory.js +4 -4
  403. package/out/language-server/workspaceContext/dependency/dependencyHandler/LanguageDependencyHandlerFactory.js.map +1 -1
  404. package/out/language-server/workspaceContext/dependency/dependencyHandler/PythonDependencyHandler.js +38 -29
  405. package/out/language-server/workspaceContext/dependency/dependencyHandler/PythonDependencyHandler.js.map +1 -1
  406. package/out/language-server/workspaceContext/javaManager.js +1 -1
  407. package/out/language-server/workspaceContext/javaManager.js.map +1 -1
  408. package/out/language-server/workspaceContext/util.d.ts +1 -0
  409. package/out/language-server/workspaceContext/util.js +12 -6
  410. package/out/language-server/workspaceContext/util.js.map +1 -1
  411. package/out/language-server/workspaceContext/workspaceContextServer.js +266 -236
  412. package/out/language-server/workspaceContext/workspaceContextServer.js.map +1 -1
  413. package/out/language-server/workspaceContext/workspaceFolderManager.d.ts +21 -50
  414. package/out/language-server/workspaceContext/workspaceFolderManager.js +254 -496
  415. package/out/language-server/workspaceContext/workspaceFolderManager.js.map +1 -1
  416. package/out/shared/languageDetection.d.ts +1 -1
  417. package/out/shared/languageDetection.js +4 -0
  418. package/out/shared/languageDetection.js.map +1 -1
  419. package/out/shared/localProjectContextController.d.ts +5 -3
  420. package/out/shared/localProjectContextController.js +47 -21
  421. package/out/shared/localProjectContextController.js.map +1 -1
  422. package/out/shared/telemetry/telemetryService.d.ts +10 -1
  423. package/out/shared/telemetry/telemetryService.js +36 -7
  424. package/out/shared/telemetry/telemetryService.js.map +1 -1
  425. package/out/shared/telemetry/types.d.ts +39 -0
  426. package/out/shared/telemetry/types.js +1 -0
  427. package/out/shared/telemetry/types.js.map +1 -1
  428. package/package.json +8 -6
  429. package/out/language-server/agenticChat/tools/fileSearch.js.map +0 -1
  430. package/out/shared/initializeUtils.d.ts +0 -3
  431. package/out/shared/initializeUtils.js +0 -32
  432. package/out/shared/initializeUtils.js.map +0 -1
@@ -3,43 +3,51 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WorkspaceFolderManager = void 0;
4
4
  const client_1 = require("./client");
5
5
  const util_1 = require("./util");
6
+ const vscode_uri_1 = require("vscode-uri");
7
+ const path = require("path");
6
8
  class WorkspaceFolderManager {
7
9
  serviceManager;
8
10
  logging;
9
11
  artifactManager;
10
12
  dependencyDiscoverer;
11
- workspaceMap;
12
13
  static instance;
14
+ workspaceIdentifier;
15
+ workspaceState;
16
+ remoteWorkspaceIdPromise;
17
+ remoteWorkspaceIdResolver;
13
18
  workspaceFolders;
14
19
  credentialsProvider;
15
20
  INITIAL_CHECK_INTERVAL = 40 * 1000; // 40 seconds
16
- INITIAL_TIMEOUT = 2 * 60 * 1000; // 2 minutes
21
+ INITIAL_CONNECTION_TIMEOUT = 2 * 60 * 1000; // 2 minutes
17
22
  CONTINUOUS_MONITOR_INTERVAL = 5 * 60 * 1000; // 5 minutes
18
- monitorIntervals = new Map();
23
+ MESSAGE_PUBLISH_INTERVAL = 100; // 100 milliseconds
24
+ continuousMonitorInterval;
25
+ optOutMonitorInterval;
26
+ messageQueueConsumerInterval;
19
27
  isOptedOut = false;
20
- static createInstance(serviceManager, logging, artifactManager, dependencyDiscoverer, workspaceFolders, credentialsProvider) {
28
+ static createInstance(serviceManager, logging, artifactManager, dependencyDiscoverer, workspaceFolders, credentialsProvider, workspaceIdentifier) {
21
29
  if (!this.instance) {
22
- this.instance = new WorkspaceFolderManager(serviceManager, logging, artifactManager, dependencyDiscoverer, workspaceFolders, credentialsProvider);
30
+ this.instance = new WorkspaceFolderManager(serviceManager, logging, artifactManager, dependencyDiscoverer, workspaceFolders, credentialsProvider, workspaceIdentifier);
23
31
  }
24
32
  return this.instance;
25
33
  }
26
34
  static getInstance() {
27
35
  return this.instance;
28
36
  }
29
- constructor(serviceManager, logging, artifactManager, dependencyDiscoverer, workspaceFolders, credentialsProvider) {
37
+ constructor(serviceManager, logging, artifactManager, dependencyDiscoverer, workspaceFolders, credentialsProvider, workspaceIdentifier) {
30
38
  this.serviceManager = serviceManager;
31
39
  this.logging = logging;
32
40
  this.artifactManager = artifactManager;
33
41
  this.dependencyDiscoverer = dependencyDiscoverer;
34
- this.workspaceMap = new Map();
35
42
  this.workspaceFolders = workspaceFolders;
36
43
  this.credentialsProvider = credentialsProvider;
44
+ this.workspaceIdentifier = workspaceIdentifier;
37
45
  this.dependencyDiscoverer.dependencyHandlerRegistry.forEach(handler => {
38
- handler.onDependencyChange(async (workspaceFolder, zips) => {
46
+ handler.onDependencyChange(async (workspaceFolder, zips, addWSFolderPathInS3) => {
39
47
  try {
40
48
  this.logging.log(`Dependency change detected in ${workspaceFolder.uri}`);
41
49
  // Process the dependencies
42
- await this.handleDependencyChanges(zips);
50
+ await this.handleDependencyChanges(zips, addWSFolderPathInS3);
43
51
  // Clean up only after successful processing
44
52
  await handler.cleanupZipFiles(zips);
45
53
  }
@@ -48,6 +56,27 @@ class WorkspaceFolderManager {
48
56
  }
49
57
  });
50
58
  });
59
+ this.remoteWorkspaceIdPromise = new Promise(resolve => {
60
+ this.remoteWorkspaceIdResolver = resolve;
61
+ });
62
+ this.workspaceState = {
63
+ remoteWorkspaceState: 'CREATION_PENDING',
64
+ messageQueue: [],
65
+ };
66
+ this.messageQueueConsumerInterval = setInterval(() => {
67
+ if (this.workspaceState.webSocketClient && this.workspaceState.webSocketClient.isConnected()) {
68
+ const message = this.workspaceState.messageQueue[0];
69
+ if (message) {
70
+ try {
71
+ this.workspaceState.webSocketClient.send(message);
72
+ this.workspaceState.messageQueue.shift();
73
+ }
74
+ catch (error) {
75
+ this.logging.error(`Error sending message: ${error}`);
76
+ }
77
+ }
78
+ }
79
+ }, this.MESSAGE_PUBLISH_INTERVAL);
51
80
  }
52
81
  /**
53
82
  * The function is used to track the latest state of workspace folders.
@@ -57,42 +86,15 @@ class WorkspaceFolderManager {
57
86
  updateWorkspaceFolders(workspaceFolders) {
58
87
  this.workspaceFolders = workspaceFolders;
59
88
  }
60
- getWorkspaces() {
61
- return this.workspaceMap;
62
- }
63
- getWorkspaceDetailsWithId(fileUri, workspaceFolders) {
64
- const workspaceRoot = (0, util_1.findWorkspaceRootFolder)(fileUri, workspaceFolders ?? this.workspaceFolders);
65
- if (!workspaceRoot) {
66
- return null;
67
- }
68
- const workspaceDetails = this.getWorkspaces().get(workspaceRoot.uri);
69
- if (!workspaceDetails) {
70
- this.logging.log(`Workspace details not found for workspace folder ${workspaceRoot.uri}`);
71
- return null;
72
- }
73
- if (!workspaceDetails.workspaceId) {
74
- this.logging.log(`Workspace initialization in progress - workspaceId not yet assigned for: ${workspaceRoot.uri}`);
75
- return { workspaceDetails, workspaceRoot };
76
- }
77
- return { workspaceDetails, workspaceRoot };
78
- }
79
- getWorkspaceFolder(fileUri) {
80
- return (0, util_1.findWorkspaceRootFolder)(fileUri, this.workspaceFolders);
81
- }
82
- getWorkspaceId(workspaceFolder) {
83
- if (!workspaceFolder) {
84
- return undefined;
85
- }
86
- const workspaceDetails = this.getWorkspaces().get(workspaceFolder.uri);
87
- if (!workspaceDetails || !workspaceDetails.workspaceId) {
88
- this.logging.log(`Unable to retrieve workspaceId - workspace initialization incomplete for: ${workspaceFolder.uri}`);
89
- return undefined;
90
- }
91
- return workspaceDetails.workspaceId;
89
+ getWorkspaceFolder(fileUri, workspaceFolders) {
90
+ return (0, util_1.findWorkspaceRootFolder)(fileUri, workspaceFolders ?? this.workspaceFolders);
92
91
  }
93
92
  getOptOutStatus() {
94
93
  return this.isOptedOut;
95
94
  }
95
+ getWorkspaceState() {
96
+ return this.workspaceState;
97
+ }
96
98
  async processNewWorkspaceFolders(folders) {
97
99
  // Check if user is opted in before trying to process any files
98
100
  const { optOut } = await this.listWorkspaceMetadata();
@@ -103,47 +105,32 @@ class WorkspaceFolderManager {
103
105
  await this.startOptOutMonitor();
104
106
  return;
105
107
  }
106
- // CreateWorkspace and Setup state machine workflow
107
- for (const folder of folders) {
108
- await this.handleNewWorkspace(folder.uri).catch(e => {
109
- this.logging.warn(`Error processing new workspace ${folder.uri} with error: ${e}`);
110
- });
111
- }
112
- // Snapshot the workspace
113
- this.snapshotWorkspace(folders).catch(e => {
114
- this.logging.warn(`Error during snapshot workspace: ${e}`);
108
+ // Wait for remote workspace id
109
+ await this.waitForRemoteWorkspaceId();
110
+ // Sync workspace source codes
111
+ await this.syncSourceCodesToS3(folders).catch(e => {
112
+ this.logging.warn(`Error during syncing workspace source codes: ${e}`);
115
113
  });
116
- }
117
- async snapshotWorkspace(folders) {
118
- let sourceCodeMetadata = [];
119
- sourceCodeMetadata = await this.artifactManager.addWorkspaceFolders(folders);
120
- // Kick off dependency discovery but don't wait
114
+ // Kick off dependency discovery but don't wait
121
115
  this.dependencyDiscoverer.searchDependencies(folders).catch(e => {
122
116
  this.logging.warn(`Error during dependency discovery: ${e}`);
123
117
  });
124
- const fileMetadataMap = new Map();
125
- sourceCodeMetadata.forEach((fileMetadata) => {
126
- let metadata = fileMetadataMap.get(fileMetadata.workspaceFolder.uri);
127
- if (!metadata) {
128
- metadata = [];
129
- fileMetadataMap.set(fileMetadata.workspaceFolder.uri, metadata);
130
- }
131
- metadata.push(fileMetadata);
132
- });
133
- folders.forEach(folder => {
134
- const workspaceDetails = this.getWorkspaces().get(folder.uri);
135
- if (workspaceDetails) {
136
- workspaceDetails.requiresS3Upload = true;
137
- }
138
- });
139
- await this.uploadWithTimeout(fileMetadataMap);
140
118
  }
141
- async uploadToS3(fileMetadata) {
119
+ async syncSourceCodesToS3(folders) {
120
+ let sourceCodeMetadata = [];
121
+ sourceCodeMetadata = await this.artifactManager.addWorkspaceFolders(folders);
122
+ await this.uploadS3AndQueueEvents(sourceCodeMetadata);
123
+ this.artifactManager.cleanup(true, folders);
124
+ }
125
+ async uploadToS3(fileMetadata, addWSFolderPathInS3 = true) {
142
126
  let relativePath = fileMetadata.relativePath.replace(fileMetadata.workspaceFolder.name, '');
143
127
  relativePath = relativePath.startsWith('/') ? relativePath.slice(1) : relativePath;
144
- const workspaceId = this.getWorkspaces().get(fileMetadata.workspaceFolder.uri)?.workspaceId ?? '';
128
+ if (addWSFolderPathInS3) {
129
+ relativePath = path.join(vscode_uri_1.URI.parse(fileMetadata.workspaceFolder.uri).path.slice(1), relativePath);
130
+ }
131
+ const workspaceId = this.workspaceState.workspaceId;
145
132
  if (!workspaceId) {
146
- this.logging.warn(`Workspace ID is not found for folder ${fileMetadata.workspaceFolder.uri}, skipping S3 upload`);
133
+ this.logging.warn(`Workspace ID is not found, skipping S3 upload`);
147
134
  return;
148
135
  }
149
136
  let s3Url;
@@ -175,13 +162,9 @@ class WorkspaceFolderManager {
175
162
  return s3Url;
176
163
  }
177
164
  async clearAllWorkspaceResources() {
178
- for (const workspace of this.monitorIntervals.keys()) {
179
- this.stopMonitoring(workspace);
180
- }
181
- for (const { webSocketClient } of this.workspaceMap.values()) {
182
- webSocketClient?.destroyClient();
183
- }
184
- this.workspaceMap.clear();
165
+ this.stopContinuousMonitoring();
166
+ this.resetRemoteWorkspaceId();
167
+ this.workspaceState.webSocketClient?.destroyClient();
185
168
  this.artifactManager.cleanup();
186
169
  this.dependencyDiscoverer.dispose();
187
170
  }
@@ -191,84 +174,40 @@ class WorkspaceFolderManager {
191
174
  * @param workspaceFolder
192
175
  */
193
176
  async processWorkspaceFoldersDeletion(workspaceFolders) {
177
+ const workspaceId = await this.waitForRemoteWorkspaceId();
194
178
  for (const folder of workspaceFolders) {
195
- const workspaceDetails = this.workspaceMap.get(folder.uri);
196
- const websocketClient = workspaceDetails?.webSocketClient;
197
179
  const languagesMap = this.artifactManager.getLanguagesForWorkspaceFolder(folder);
198
180
  const programmingLanguages = languagesMap ? Array.from(languagesMap.keys()) : [];
199
- if (websocketClient) {
200
- for (const language of programmingLanguages) {
201
- // Wait for message being sent before disconnecting
202
- await websocketClient
203
- .send(JSON.stringify({
204
- method: 'workspace/didChangeWorkspaceFolders',
205
- params: {
206
- workspaceFoldersChangeEvent: {
207
- added: [],
208
- removed: [
209
- {
210
- uri: '/',
211
- name: folder.name,
212
- },
213
- ],
214
- },
215
- workspaceChangeMetadata: {
216
- workspaceId: this.getWorkspaces().get(folder.uri)?.workspaceId ?? '',
217
- programmingLanguage: language,
218
- },
181
+ for (const language of programmingLanguages) {
182
+ const message = JSON.stringify({
183
+ method: 'workspace/didChangeWorkspaceFolders',
184
+ params: {
185
+ workspaceFoldersChangeEvent: {
186
+ added: [],
187
+ removed: [
188
+ {
189
+ uri: folder.uri,
190
+ name: folder.name,
191
+ },
192
+ ],
219
193
  },
220
- }))
221
- .catch(e => {
222
- this.logging.error(`Error sending didChangeWorkspaceFolders message: ${e}`);
223
- });
224
- }
225
- websocketClient.disconnect();
194
+ workspaceChangeMetadata: {
195
+ workspaceId: workspaceId,
196
+ programmingLanguage: language,
197
+ },
198
+ },
199
+ });
200
+ this.workspaceState.messageQueue.push(message);
226
201
  }
227
- this.removeWorkspaceEntry(folder.uri);
228
202
  this.dependencyDiscoverer.disposeWorkspaceFolder(folder);
229
- this.stopMonitoring(folder.uri);
230
203
  }
231
204
  await this.artifactManager.removeWorkspaceFolders(workspaceFolders);
232
205
  }
233
- processRemoteWorkspaceRefresh(workspaceFolders) {
234
- for (const folder of workspaceFolders) {
235
- const workspaceDetails = this.workspaceMap.get(folder.uri);
236
- const websocketClient = workspaceDetails?.webSocketClient;
237
- if (websocketClient) {
238
- websocketClient.destroyClient();
239
- }
240
- this.removeWorkspaceEntry(folder.uri);
241
- this.dependencyDiscoverer.disposeWorkspaceFolder(folder);
242
- }
243
- }
244
- updateWorkspaceEntry(workspaceRoot, workspaceState) {
245
- if (!workspaceState.messageQueue) {
246
- workspaceState.messageQueue = [];
247
- }
248
- if (!this.workspaceMap.has(workspaceRoot)) {
249
- workspaceState.requiresS3Upload = true;
250
- this.workspaceMap.set(workspaceRoot, workspaceState);
251
- }
252
- else {
253
- const existingWorkspaceState = this.workspaceMap.get(workspaceRoot);
254
- if (existingWorkspaceState) {
255
- existingWorkspaceState.remoteWorkspaceState =
256
- workspaceState.remoteWorkspaceState ?? existingWorkspaceState.remoteWorkspaceState;
257
- existingWorkspaceState.webSocketClient =
258
- workspaceState.webSocketClient ?? existingWorkspaceState.webSocketClient;
259
- existingWorkspaceState.workspaceId = workspaceState.workspaceId ?? existingWorkspaceState.workspaceId;
260
- existingWorkspaceState.messageQueue = workspaceState.messageQueue ?? existingWorkspaceState.messageQueue;
261
- }
262
- }
263
- }
264
- removeWorkspaceEntry(workspaceRoot) {
265
- this.workspaceMap.delete(workspaceRoot);
266
- }
267
- async handleDependencyChanges(zips) {
206
+ async handleDependencyChanges(zips, addWSFolderPathInS3) {
268
207
  this.logging.log(`Processing ${zips.length} dependency changes`);
269
208
  for (const zip of zips) {
270
209
  try {
271
- const s3Url = await this.uploadToS3(zip);
210
+ const s3Url = await this.uploadToS3(zip, addWSFolderPathInS3);
272
211
  if (!s3Url) {
273
212
  continue;
274
213
  }
@@ -280,46 +219,20 @@ class WorkspaceFolderManager {
280
219
  }
281
220
  }
282
221
  notifyDependencyChange(fileMetadata, s3Url) {
283
- const workspaceDetails = this.getWorkspaces().get(fileMetadata.workspaceFolder.uri);
284
- if (!workspaceDetails) {
285
- return;
286
- }
287
222
  const message = JSON.stringify({
288
223
  method: 'didChangeDependencyPaths',
289
224
  params: {
290
225
  event: { paths: [] },
291
226
  workspaceChangeMetadata: {
292
- workspaceId: workspaceDetails.workspaceId,
227
+ workspaceId: this.workspaceState.workspaceId,
293
228
  s3Path: (0, util_1.cleanUrl)(s3Url),
294
229
  programmingLanguage: fileMetadata.language,
295
230
  },
296
231
  },
297
232
  });
298
- if (!workspaceDetails.webSocketClient) {
299
- this.logging.log(`WebSocket client is not connected yet: ${fileMetadata.workspaceFolder.uri} adding didChangeDependencyPaths message to queue`);
300
- workspaceDetails.messageQueue?.push(message);
301
- }
302
- else {
303
- workspaceDetails.webSocketClient.send(message).catch(e => {
304
- this.logging.error(`Error sending didChangeDependencyPaths message: ${e}`);
305
- });
306
- }
307
- }
308
- async createNewWorkspace(workspace) {
309
- const createWorkspaceResult = await this.createWorkspace(workspace);
310
- const workspaceDetails = createWorkspaceResult.response;
311
- if (!workspaceDetails) {
312
- this.logging.warn(`Failed to create remote workspace for ${workspace}`);
313
- return createWorkspaceResult;
314
- }
315
- this.updateWorkspaceEntry(workspace, {
316
- remoteWorkspaceState: workspaceDetails.workspace.workspaceStatus,
317
- workspaceId: workspaceDetails.workspace.workspaceId,
318
- });
319
- return createWorkspaceResult;
233
+ this.workspaceState.messageQueue.push(message);
320
234
  }
321
- async establishConnection(workspace, existingMetadata) {
322
- const existingState = this.workspaceMap.get(workspace);
235
+ async establishConnection(existingMetadata) {
323
236
  if (!existingMetadata.environmentId) {
324
237
  throw new Error('No environment ID found for ready workspace');
325
238
  }
@@ -328,81 +241,53 @@ class WorkspaceFolderManager {
328
241
  }
329
242
  const websocketUrl = existingMetadata.environmentAddress;
330
243
  this.logging.log(`Establishing connection to ${websocketUrl}`);
331
- if (existingState?.webSocketClient) {
332
- const websocketConnectionState = existingState.webSocketClient.getWebsocketReadyState();
244
+ if (this.workspaceState.webSocketClient) {
245
+ const websocketConnectionState = this.workspaceState.webSocketClient.getWebsocketReadyState();
333
246
  if (websocketConnectionState === 'OPEN') {
334
- this.logging.log(`Active connection already exists for ${workspace}`);
247
+ this.logging.log(`Active websocket connection already exists.}`);
335
248
  return;
336
249
  }
337
250
  // If the client exists but isn't connected, it might be in the process of connecting
338
251
  if (websocketConnectionState === 'CONNECTING') {
339
- this.logging.log(`Connection attempt already in progress for ${workspace}`);
252
+ this.logging.log(`Connection attempt already in progress.`);
340
253
  return;
341
254
  }
342
255
  }
343
256
  const webSocketClient = new client_1.WebSocketClient(websocketUrl, this.logging, this.credentialsProvider);
344
- this.updateWorkspaceEntry(workspace, {
345
- remoteWorkspaceState: 'CONNECTED',
346
- webSocketClient,
347
- messageQueue: existingState?.messageQueue || [],
348
- });
349
- await this.processMessagesInQueue(workspace);
350
- }
351
- async handleNewWorkspace(workspace, queueEvents) {
352
- this.logging.log(`Processing new workspace ${workspace}`);
353
- // First check if the workspace already exists in the workspace map
354
- const existingWorkspace = this.workspaceMap.get(workspace);
355
- if (existingWorkspace) {
356
- this.logging.log(`Workspace ${workspace} already exists in memory`);
357
- return;
358
- }
359
- // Check if workspace exists remotely
360
- const { metadata, optOut } = await this.listWorkspaceMetadata(workspace);
361
- if (optOut) {
362
- this.logging.log(`Not creating a new workspace ${workspace}, user is opted out`);
363
- this.isOptedOut = true;
364
- await this.clearAllWorkspaceResources();
365
- await this.startOptOutMonitor();
366
- return;
367
- }
368
- if (metadata) {
369
- // Workspace exists remotely, add to map with current state
370
- this.updateWorkspaceEntry(workspace, {
371
- workspaceId: metadata.workspaceId,
372
- remoteWorkspaceState: metadata.workspaceStatus,
373
- messageQueue: queueEvents ?? [],
374
- });
375
- // We don't attempt a connection here even if remote workspace is ready and leave the connection attempt to the workspace status monitor
376
- }
377
- else {
378
- // Create new workspace
379
- const createWorkspaceResult = await this.createNewWorkspace(workspace);
380
- if (createWorkspaceResult.error && createWorkspaceResult.error.retryable) {
381
- this.logging.log(`Workspace creation failed with retryable error, starting monitor`);
382
- // todo, consider whether we should add the failed env to the map or not and what to do in the create failure case
383
- this.updateWorkspaceEntry(workspace, {
384
- remoteWorkspaceState: 'CREATION_PENDING',
385
- messageQueue: queueEvents ?? [],
386
- });
387
- }
257
+ this.workspaceState.remoteWorkspaceState = 'CONNECTED';
258
+ this.workspaceState.webSocketClient = webSocketClient;
259
+ }
260
+ async initializeWorkspaceStatusMonitor() {
261
+ this.logging.log(`Initializing workspace status check for workspace [${this.workspaceIdentifier}]`);
262
+ // Perform a one-time checkRemoteWorkspaceStatusAndReact first
263
+ // Pass skipUploads as true since it would be handled by processNewWorkspaceFolders
264
+ await this.checkRemoteWorkspaceStatusAndReact(true);
265
+ // Set up continuous monitoring which periodically invokes checkRemoteWorkspaceStatusAndReact
266
+ if (!this.isOptedOut) {
267
+ this.logging.log(`Starting continuous monitor for workspace [${this.workspaceIdentifier}]`);
268
+ const intervalId = setInterval(async () => {
269
+ try {
270
+ await this.checkRemoteWorkspaceStatusAndReact();
271
+ }
272
+ catch (error) {
273
+ this.logging.error(`Error monitoring workspace status: ${error}`);
274
+ }
275
+ }, this.CONTINUOUS_MONITOR_INTERVAL);
276
+ this.continuousMonitorInterval = intervalId;
388
277
  }
389
- this.startWorkspaceStatusMonitor(workspace).catch(error => {
390
- this.logging.error(`Error starting workspace monitor for ${workspace}: ${error}`);
391
- });
392
278
  }
393
- async waitForInitialConnection(workspace) {
394
- this.logging.log(`Waiting for initial connection to ${workspace}`);
279
+ async waitForInitialConnection() {
280
+ this.logging.log(`Waiting for initial connection to remote workspace`);
395
281
  return new Promise(resolve => {
396
282
  const startTime = Date.now();
397
283
  const intervalId = setInterval(async () => {
398
284
  try {
399
- const workspaceState = this.workspaceMap.get(workspace);
400
- if (!workspaceState) {
401
- this.logging.log(`Workspace ${workspace} no longer exists, stopping monitors for workspace`);
285
+ if (Date.now() - startTime >= this.INITIAL_CONNECTION_TIMEOUT) {
286
+ this.logging.warn(`Initial connection timeout.`);
402
287
  clearInterval(intervalId);
403
288
  return resolve(false);
404
289
  }
405
- const { metadata, optOut } = await this.listWorkspaceMetadata(workspace);
290
+ const { metadata, optOut } = await this.listWorkspaceMetadata(this.workspaceIdentifier);
406
291
  if (optOut) {
407
292
  this.logging.log(`User opted out during initial connection`);
408
293
  this.isOptedOut = true;
@@ -414,15 +299,12 @@ class WorkspaceFolderManager {
414
299
  // Continue polling by exiting only this iteration
415
300
  return;
416
301
  }
417
- this.updateWorkspaceEntry(workspace, {
418
- ...workspaceState,
419
- remoteWorkspaceState: metadata.workspaceStatus,
420
- });
302
+ this.workspaceState.remoteWorkspaceState = metadata.workspaceStatus;
421
303
  switch (metadata.workspaceStatus) {
422
304
  case 'READY':
423
- const client = workspaceState.webSocketClient;
305
+ const client = this.workspaceState.webSocketClient;
424
306
  if (!client || !client.isConnected()) {
425
- await this.establishConnection(workspace, metadata);
307
+ await this.establishConnection(metadata);
426
308
  }
427
309
  clearInterval(intervalId);
428
310
  return resolve(true);
@@ -430,137 +312,127 @@ class WorkspaceFolderManager {
430
312
  // Continue polling
431
313
  break;
432
314
  case 'CREATED':
433
- const createWorkspaceResult = await this.createNewWorkspace(workspace);
434
- // If createWorkspace call returns a retyrable error, next interval will retry
435
- // If the call returns non-retryable error, we will re-throw the error and it will stop the interval
436
- if (createWorkspaceResult.error && !createWorkspaceResult.error.retryable) {
437
- throw createWorkspaceResult.error.originalError;
438
- }
439
- break;
315
+ clearInterval(intervalId);
316
+ return resolve(false);
440
317
  default:
441
318
  this.logging.warn(`Unknown workspace status: ${metadata.workspaceStatus}`);
442
319
  clearInterval(intervalId);
443
320
  return resolve(false);
444
321
  }
445
- if (Date.now() - startTime >= this.INITIAL_TIMEOUT) {
446
- this.logging.warn(`Initial connection timeout for workspace ${workspace}`);
447
- clearInterval(intervalId);
448
- return resolve(false);
449
- }
450
322
  }
451
323
  catch (error) {
452
- this.logging.error(`Error during initial connection for workspace ${workspace}: ${error}`);
324
+ this.logging.error(`Error during initializing connection for workspace [${this.workspaceIdentifier}]: ${error}`);
453
325
  clearInterval(intervalId);
454
326
  return resolve(false);
455
327
  }
456
328
  }, this.INITIAL_CHECK_INTERVAL);
457
329
  });
458
330
  }
459
- startContinuousMonitor(workspace) {
460
- this.logging.log(`Starting continuous monitor for workspace ${workspace}`);
461
- const intervalId = setInterval(async () => {
462
- try {
463
- const workspaceState = this.workspaceMap.get(workspace);
464
- if (!workspaceState) {
465
- // Previously we stop monitoring the workspace if it no longer exists
466
- // But now we want to try give it a chance to re-create the workspace
467
- // this.stopMonitoring(workspace)
468
- return;
469
- }
470
- const { metadata, optOut } = await this.listWorkspaceMetadata(workspace);
471
- if (optOut) {
472
- this.logging.log('User opted out, clearing all resources and starting opt-out monitor');
473
- this.isOptedOut = true;
474
- await this.clearAllWorkspaceResources();
475
- await this.startOptOutMonitor();
476
- return;
477
- }
478
- if (!metadata) {
479
- // Workspace no longer exists, Recreate it.
480
- await this.handleWorkspaceCreatedState(workspace);
481
- return;
482
- }
483
- this.updateWorkspaceEntry(workspace, {
484
- ...workspaceState,
485
- remoteWorkspaceState: metadata.workspaceStatus,
486
- });
487
- switch (metadata.workspaceStatus) {
488
- case 'READY':
489
- // Check if connection exists
490
- const client = workspaceState.webSocketClient;
491
- if (!client || !client.isConnected()) {
492
- this.logging.log(`Workspace ${workspace} is ready but no connection exists or connection lost. Re-establishing connection...`);
493
- await this.establishConnection(workspace, metadata);
494
- }
495
- break;
496
- case 'PENDING':
497
- // Do nothing while pending
498
- break;
499
- case 'CREATED':
500
- // Workspace has no environment, Recreate it.
501
- await this.handleWorkspaceCreatedState(workspace);
502
- break;
503
- default:
504
- this.logging.warn(`Unknown workspace status: ${metadata.workspaceStatus}`);
331
+ async checkRemoteWorkspaceStatusAndReact(skipUploads = false) {
332
+ this.logging.log(`Checking remote workspace status for workspace [${this.workspaceIdentifier}]`);
333
+ const { metadata, optOut } = await this.listWorkspaceMetadata(this.workspaceIdentifier);
334
+ if (optOut) {
335
+ this.logging.log('User opted out, clearing all resources and starting opt-out monitor');
336
+ this.isOptedOut = true;
337
+ await this.clearAllWorkspaceResources();
338
+ await this.startOptOutMonitor();
339
+ return;
340
+ }
341
+ if (!metadata) {
342
+ // Workspace no longer exists, Recreate it.
343
+ this.resetRemoteWorkspaceId(); // workspaceId would change if remote record is gone
344
+ await this.handleWorkspaceCreatedState(skipUploads);
345
+ return;
346
+ }
347
+ this.workspaceState.remoteWorkspaceState = metadata.workspaceStatus;
348
+ if (this.workspaceState.workspaceId === undefined) {
349
+ this.workspaceState.workspaceId = metadata.workspaceId;
350
+ this.remoteWorkspaceIdResolver(this.workspaceState.workspaceId);
351
+ }
352
+ switch (metadata.workspaceStatus) {
353
+ case 'READY':
354
+ // Check if connection exists
355
+ const client = this.workspaceState.webSocketClient;
356
+ if (!client || !client.isConnected()) {
357
+ this.logging.log(`Workspace is ready but no connection exists or connection lost. Re-establishing connection...`);
358
+ await this.establishConnection(metadata);
505
359
  }
506
- }
507
- catch (error) {
508
- this.logging.error(`Error monitoring workspace ${workspace}: ${error}`);
509
- }
510
- }, this.CONTINUOUS_MONITOR_INTERVAL);
511
- this.monitorIntervals.set(workspace, intervalId);
360
+ break;
361
+ case 'PENDING':
362
+ // Schedule an initial connection when pending
363
+ await this.waitForInitialConnection();
364
+ break;
365
+ case 'CREATED':
366
+ // Workspace has no environment, Recreate it.
367
+ await this.handleWorkspaceCreatedState(skipUploads);
368
+ break;
369
+ default:
370
+ this.logging.warn(`Unknown workspace status: ${metadata.workspaceStatus}`);
371
+ }
372
+ }
373
+ async waitForRemoteWorkspaceId() {
374
+ // If workspaceId is already set, return it immediately
375
+ if (this.workspaceState.workspaceId) {
376
+ return this.workspaceState.workspaceId;
377
+ }
378
+ // Otherwise, wait for the promise to resolve
379
+ let waitedWorkspaceId = undefined;
380
+ while (!waitedWorkspaceId) {
381
+ waitedWorkspaceId = await this.remoteWorkspaceIdPromise;
382
+ }
383
+ return waitedWorkspaceId;
384
+ }
385
+ resetRemoteWorkspaceId() {
386
+ this.workspaceState.workspaceId = undefined;
387
+ // Store the old resolver
388
+ const oldResolver = this.remoteWorkspaceIdResolver;
389
+ // Create new promise first
390
+ this.remoteWorkspaceIdPromise = new Promise(resolve => {
391
+ this.remoteWorkspaceIdResolver = resolve;
392
+ });
393
+ // Reset the old promise
394
+ if (oldResolver) {
395
+ oldResolver('');
396
+ }
512
397
  }
513
398
  async startOptOutMonitor() {
514
- const intervalId = setInterval(async () => {
515
- try {
516
- const { optOut } = await this.listWorkspaceMetadata();
517
- if (!optOut) {
518
- this.isOptedOut = false;
519
- this.logging.log('User opted back in, stopping opt-out monitor and re-initializing workspace');
520
- clearInterval(intervalId);
521
- // Process all workspace folders
522
- await this.processNewWorkspaceFolders(this.workspaceFolders);
399
+ if (this.optOutMonitorInterval === undefined) {
400
+ const intervalId = setInterval(async () => {
401
+ try {
402
+ const { optOut } = await this.listWorkspaceMetadata();
403
+ if (!optOut) {
404
+ this.isOptedOut = false;
405
+ this.logging.log('User opted back in, stopping opt-out monitor and re-initializing workspace');
406
+ clearInterval(intervalId);
407
+ this.optOutMonitorInterval = undefined;
408
+ await this.initializeWorkspaceStatusMonitor();
409
+ }
523
410
  }
524
- }
525
- catch (error) {
526
- this.logging.error(`Error in opt-out monitor: ${error}`);
527
- }
528
- }, this.CONTINUOUS_MONITOR_INTERVAL);
411
+ catch (error) {
412
+ this.logging.error(`Error in opt-out monitor: ${error}`);
413
+ }
414
+ }, this.CONTINUOUS_MONITOR_INTERVAL);
415
+ this.optOutMonitorInterval = intervalId;
416
+ }
529
417
  }
530
- /**
531
- * Handles the workspace creation flow when a remote workspace is in CREATED state.
532
- * Attempts to create the workspace and schedules a quick connection check on success.
533
- * If the initial creation fails with a retryable error, attempts one retry before
534
- * falling back to the regular polling cycle.
535
- *
536
- * The flow is:
537
- * 1. Attempt initial workspace creation
538
- * 2. On success: Schedule a quick check to establish connection
539
- * 3. On retryable error: Attempt one immediate retry
540
- * 4. On retry success: Schedule a quick check
541
- * 5. On retry failure: Wait for next regular polling cycle
542
- *
543
- * @param workspace - The workspace to re-create
544
- */
545
- async handleWorkspaceCreatedState(workspace) {
418
+ async handleWorkspaceCreatedState(skipUploads = false) {
419
+ this.logging.log(`No READY / PENDING remote workspace found, creating a new one`);
546
420
  // If remote state is CREATED, call create API to create a new workspace
547
- // snapshot the workspace for the new environment
548
- // TODO: this workspace root in the below snapshot function needs to be changes
549
- // after we consolidate workspaceFolder into one Workspace.
550
- const folder = this.getWorkspaceFolder(workspace);
551
- if (folder) {
552
- this.processRemoteWorkspaceRefresh([folder]);
553
- }
554
- const initialResult = await this.createNewWorkspace(workspace);
555
- if (folder) {
556
- this.snapshotWorkspace([folder]).catch(e => {
557
- this.logging.warn(`Error during snapshot workspace: ${e}`);
558
- });
421
+ if (this.workspaceState.webSocketClient) {
422
+ this.workspaceState.webSocketClient.destroyClient();
423
+ this.workspaceState.webSocketClient = undefined;
559
424
  }
560
- // If creation succeeds, schedule a single connection attempt to happen in 30 seconds
425
+ const initialResult = await this.createNewWorkspace();
426
+ // If creation succeeds, establish connection
561
427
  if (initialResult.response) {
562
- this.logging.log(`Workspace ${workspace} created successfully, scheduling quick check for connection`);
563
- this.scheduleQuickCheck(workspace);
428
+ this.logging.log(`Workspace [${this.workspaceIdentifier}] created successfully, establishing connection`);
429
+ await this.waitForInitialConnection();
430
+ if (!skipUploads) {
431
+ await this.syncSourceCodesToS3(this.workspaceFolders);
432
+ this.dependencyDiscoverer.reSyncDependenciesToS3(this.workspaceFolders).catch(e => {
433
+ this.logging.warn(`Error during re-syncing dependencies: ${e}`);
434
+ });
435
+ }
564
436
  return;
565
437
  }
566
438
  // If creation fails with a non-retryable error, don't do anything
@@ -568,84 +440,42 @@ class WorkspaceFolderManager {
568
440
  if (!initialResult.error?.retryable) {
569
441
  return;
570
442
  }
571
- this.logging.warn(`Retryable error for workspace ${workspace} creation: ${initialResult.error}. Attempting single retry...`);
572
- const retryResult = await this.createNewWorkspace(workspace);
443
+ this.logging.warn(`Retryable error for workspace creation: ${initialResult.error}. Attempting single retry...`);
444
+ const retryResult = await this.createNewWorkspace();
445
+ // If re-creation fails, wait for the next polling cycle
573
446
  if (retryResult.error) {
574
- this.logging.warn(`Retry failed for workspace ${workspace}: ${retryResult.error}. Will wait for next polling cycle`);
447
+ this.logging.warn(`Workspace creation retry failed: ${retryResult.error}. Will wait for the next polling cycle`);
575
448
  return;
576
449
  }
577
- this.logging.log(`Retry succeeded for workspace ${workspace}, scheduling quick check for connection`);
578
- this.scheduleQuickCheck(workspace);
579
- }
580
- /**
581
- * Schedules a one-time check after workspace creation to establish connection as soon as possible.
582
- * This avoids waiting for the regular 5-minute polling interval when we know the workspace
583
- * should be ready soon. Default check delay is 40 seconds after successful workspace creation.
584
- *
585
- * @param workspace - The workspace to check
586
- * @param delayMs - Optional delay in milliseconds before the check (defaults to 40 seconds)
587
- */
588
- scheduleQuickCheck(workspace, delayMs = this.INITIAL_CHECK_INTERVAL) {
589
- this.logging.log(`Scheduling quick check for workspace ${workspace} in ${delayMs}ms`);
590
- setTimeout(async () => {
591
- try {
592
- const workspaceState = this.workspaceMap.get(workspace);
593
- if (!workspaceState) {
594
- this.logging.log(`Workspace state not found for: ${workspace} during quick check`);
595
- return;
596
- }
597
- const { metadata, optOut } = await this.listWorkspaceMetadata(workspace);
598
- if (optOut) {
599
- this.logging.log(`User is opted out during quick check`);
600
- this.isOptedOut = true;
601
- await this.clearAllWorkspaceResources();
602
- await this.startOptOutMonitor();
603
- return;
604
- }
605
- if (!metadata) {
606
- this.logging.log(`No metadata available for workspace: ${workspace} during quick check`);
607
- return;
608
- }
609
- if (metadata.workspaceStatus === 'READY') {
610
- this.logging.log(`Quick check found workspace ${workspace} is ready, attempting connection`);
611
- await this.establishConnection(workspace, metadata);
612
- }
613
- else {
614
- this.logging.log(`Quick check found workspace ${workspace} state is ${metadata.workspaceStatus}`);
615
- }
616
- }
617
- catch (error) {
618
- this.logging.error(`Error during quick check for workspace ${workspace}: ${error}`);
619
- }
620
- }, delayMs);
621
- }
622
- stopMonitoring(workspace) {
623
- this.logging.log(`Stopping monitoring for workspace ${workspace}`);
624
- const intervalId = this.monitorIntervals.get(workspace);
625
- if (intervalId) {
626
- clearInterval(intervalId);
627
- this.monitorIntervals.delete(workspace);
450
+ this.logging.log(`Retry succeeded for workspace creation, establishing connection`);
451
+ await this.waitForInitialConnection();
452
+ if (!skipUploads) {
453
+ await this.syncSourceCodesToS3(this.workspaceFolders);
454
+ this.dependencyDiscoverer.reSyncDependenciesToS3(this.workspaceFolders).catch(e => {
455
+ this.logging.warn(`Error during re-syncing dependencies: ${e}`);
456
+ });
628
457
  }
629
458
  }
630
- async startWorkspaceStatusMonitor(workspace) {
631
- const success = await this.waitForInitialConnection(workspace);
632
- this.logging.log(`Initial connection ${success ? 'successful' : 'failed'} for ${workspace}, starting continuous monitor`);
633
- if (!success && this.isOptedOut) {
634
- // If initial connection fails due to opt out, do not start the continuous monitor
635
- // The opt-out monitor will already be started
636
- return;
459
+ stopContinuousMonitoring() {
460
+ this.logging.log(`Stopping monitoring for workspace [${this.workspaceIdentifier}]`);
461
+ if (this.continuousMonitorInterval) {
462
+ clearInterval(this.continuousMonitorInterval);
463
+ this.continuousMonitorInterval = undefined;
637
464
  }
638
- this.startContinuousMonitor(workspace);
639
465
  }
640
- // could this cause messages to be lost??????
641
- async processMessagesInQueue(workspaceRoot) {
642
- const workspaceDetails = this.workspaceMap.get(workspaceRoot);
643
- while (workspaceDetails?.messageQueue && workspaceDetails.messageQueue.length > 0) {
644
- const message = workspaceDetails.messageQueue.shift();
645
- await workspaceDetails.webSocketClient?.send(message).catch(error => {
646
- this.logging.error(`Error sending message: ${error}`);
647
- });
466
+ async createNewWorkspace() {
467
+ const createWorkspaceResult = await this.createWorkspace(this.workspaceIdentifier);
468
+ const workspaceDetails = createWorkspaceResult.response;
469
+ if (!workspaceDetails) {
470
+ this.logging.warn(`Failed to create remote workspace for [${this.workspaceIdentifier}]`);
471
+ return createWorkspaceResult;
472
+ }
473
+ this.workspaceState.remoteWorkspaceState = workspaceDetails.workspace.workspaceStatus;
474
+ if (this.workspaceState.workspaceId === undefined) {
475
+ this.workspaceState.workspaceId = workspaceDetails.workspace.workspaceId;
476
+ this.remoteWorkspaceIdResolver(this.workspaceState.workspaceId);
648
477
  }
478
+ return createWorkspaceResult;
649
479
  }
650
480
  /**
651
481
  * All the filesMetadata elements passed to the function belongs to the same workspace folder.
@@ -656,112 +486,40 @@ class WorkspaceFolderManager {
656
486
  if (filesMetadata.length == 0) {
657
487
  return;
658
488
  }
659
- const inMemoryQueueEvents = [];
660
489
  for (const fileMetadata of filesMetadata) {
661
490
  try {
662
491
  const s3Url = await this.uploadToS3(fileMetadata);
663
492
  if (!s3Url) {
664
- this.logging.warn(`Failed to get S3 URL for file in workspace: ${fileMetadata.workspaceFolder.name}`);
493
+ this.logging.warn(`Failed to get S3 URL for file in workspaceFolder: ${fileMetadata.workspaceFolder.name}`);
665
494
  continue;
666
495
  }
667
- this.logging.log(`Successfully uploaded to S3: workspace=${fileMetadata.workspaceFolder.name} language=${fileMetadata.language}`);
668
- const workspaceId = this.getWorkspaces().get(fileMetadata.workspaceFolder.uri)?.workspaceId;
669
- if (!workspaceId) {
670
- this.logging.warn(`No workspace ID found for URI: ${fileMetadata.workspaceFolder.uri}`);
671
- }
496
+ this.logging.log(`Successfully uploaded to S3: workspaceFolder=${fileMetadata.workspaceFolder.name} language=${fileMetadata.language}`);
672
497
  const event = JSON.stringify({
673
498
  method: 'workspace/didChangeWorkspaceFolders',
674
499
  params: {
675
500
  workspaceFoldersChangeEvent: {
676
501
  added: [
677
502
  {
678
- uri: '/',
503
+ uri: fileMetadata.workspaceFolder.uri,
679
504
  name: fileMetadata.workspaceFolder.name,
680
505
  },
681
506
  ],
682
507
  removed: [],
683
508
  },
684
509
  workspaceChangeMetadata: {
685
- workspaceId: workspaceId ?? '',
510
+ workspaceId: this.workspaceState.workspaceId,
686
511
  s3Path: (0, util_1.cleanUrl)(s3Url),
687
512
  programmingLanguage: fileMetadata.language,
688
513
  },
689
514
  },
690
515
  });
691
- // We add this event to the front of the queue here to prevent any race condition that might put events before the didChangeWorkspaceFolders event
692
- inMemoryQueueEvents.unshift(event);
516
+ this.workspaceState.messageQueue.push(event);
693
517
  this.logging.log(`Added didChangeWorkspaceFolders event to queue`);
694
518
  }
695
519
  catch (error) {
696
520
  this.logging.error(`Error processing file metadata:${error instanceof Error ? error.message : 'Unknown error'}, workspace=${fileMetadata.workspaceFolder.name}`);
697
521
  }
698
522
  }
699
- try {
700
- const workspaceDetails = this.getWorkspaces().get(filesMetadata[0].workspaceFolder.uri);
701
- if (!workspaceDetails) {
702
- this.logging.error(`No workspace details found for URI: ${filesMetadata[0].workspaceFolder.uri}`);
703
- return;
704
- }
705
- if (workspaceDetails.webSocketClient) {
706
- inMemoryQueueEvents.forEach((event, index) => {
707
- try {
708
- workspaceDetails.webSocketClient?.send(event).catch(error => {
709
- this.logging.error(`Error sending event: ${error instanceof Error ? error.message : 'Unknown error'}, eventIndex=${index}`);
710
- });
711
- this.logging.log(`Successfully sent event ${index + 1}/${inMemoryQueueEvents.length}`);
712
- }
713
- catch (error) {
714
- this.logging.error(`Failed to send event via WebSocket:${error instanceof Error ? error.message : 'Unknown error'}, eventIndex=${index}`);
715
- }
716
- });
717
- }
718
- else {
719
- if (workspaceDetails.messageQueue) {
720
- workspaceDetails.messageQueue.push(...inMemoryQueueEvents);
721
- this.logging.log(`Added ${inMemoryQueueEvents.length} events to message queue`);
722
- }
723
- else {
724
- this.logging.warn('No message queue available to store events');
725
- }
726
- }
727
- }
728
- catch (error) {
729
- this.logging.error(`Error in final processing: ${error instanceof Error ? error.message : 'Unknown error'}`);
730
- }
731
- this.logging.log(`Completed processing ${inMemoryQueueEvents.length} queued WebSocket events`);
732
- }
733
- async uploadWithTimeout(fileMetadataMap) {
734
- const keys = [...fileMetadataMap.keys()];
735
- const totalWorkspaces = keys.length;
736
- let workspacesWithS3UploadComplete = 0;
737
- for (const key of keys) {
738
- const workspaceDetails = this.getWorkspaces().get(key);
739
- if (!workspaceDetails) {
740
- continue;
741
- }
742
- if (workspaceDetails.workspaceId && workspaceDetails.requiresS3Upload) {
743
- this.logging.log(`Starting S3 upload for ${key}, workspace id: ${workspaceDetails.workspaceId}`);
744
- await this.uploadS3AndQueueEvents(fileMetadataMap.get(key) ?? []);
745
- workspaceDetails.requiresS3Upload = false;
746
- }
747
- // This if condition needs to be separate because workspacesWithS3UploadComplete variable is set to 0 every time this function is called
748
- // If this function is run once and uploads some of the workspace folders, we need to ensure we don't forget about already uploaded folders the next time the function is run
749
- if (workspaceDetails.workspaceId) {
750
- workspacesWithS3UploadComplete++;
751
- }
752
- }
753
- if (totalWorkspaces !== workspacesWithS3UploadComplete) {
754
- // Schedule next check if not all workspaces are complete
755
- // Notice that we don't await the uploadWithTimeout now, it is fire and forget at the moment
756
- setTimeout(() => this.uploadWithTimeout(fileMetadataMap), 3000);
757
- }
758
- else {
759
- this.logging.log(`All workspaces with S3 upload complete`);
760
- // Clean up source code zip files after S3 upload
761
- // Preserve dependencies because they might still be processing
762
- // LanguageDependencyHandler is responsible for deleting dependency zips
763
- this.artifactManager.cleanup(true);
764
- }
765
523
  }
766
524
  // TODO, this function is unused at the moment
767
525
  async deleteWorkspace(workspaceId) {