@aws/lsp-codewhisperer 0.0.32 → 0.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +233 -0
- package/README.md +18 -1
- package/node_modules/@amzn/amazon-q-developer-streaming-client/LICENSE +201 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/README.md +864 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-cjs/QDeveloperStreaming.js +15 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-cjs/QDeveloperStreamingClient.js +49 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-cjs/auth/httpAuthExtensionConfiguration.js +43 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-cjs/auth/httpAuthSchemeProvider.js +50 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-cjs/commands/GenerateCodeFromCommandsCommand.js +26 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-cjs/commands/SendMessageCommand.js +26 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-cjs/commands/index.js +5 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-cjs/endpoints.js +211 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-cjs/extensionConfiguration.js +2 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-cjs/index.js +10 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-cjs/models/QDeveloperStreamingServiceException.js +12 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-cjs/models/index.js +4 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-cjs/models/models_0.js +1051 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-cjs/protocols/Aws_json1_0.js +597 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-cjs/runtimeConfig.browser.js +40 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-cjs/runtimeConfig.js +48 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-cjs/runtimeConfig.native.js +15 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-cjs/runtimeConfig.shared.js +32 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-cjs/runtimeExtensions.js +25 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-es/QDeveloperStreaming.js +11 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-es/QDeveloperStreamingClient.js +45 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-es/auth/httpAuthSchemeProvider.js +44 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-es/commands/GenerateCodeFromCommandsCommand.js +22 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-es/commands/SendMessageCommand.js +22 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-es/commands/index.js +2 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-es/endpoints.js +207 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-es/index.js +5 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-es/models/QDeveloperStreamingServiceException.js +8 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-es/models/index.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-es/models/models_0.js +963 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-es/protocols/Aws_json1_0.js +590 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-es/runtimeConfig.browser.js +35 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-es/runtimeConfig.js +43 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-es/runtimeConfig.native.js +11 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-es/runtimeConfig.shared.js +28 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-es/runtimeExtensions.js +21 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-types/QDeveloperStreaming.d.ts +23 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-types/QDeveloperStreamingClient.d.ts +196 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-types/auth/httpAuthSchemeProvider.d.ts +61 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-types/commands/GenerateCodeFromCommandsCommand.d.ts +102 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-types/commands/SendMessageCommand.d.ts +796 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-types/commands/index.d.ts +2 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-types/endpoints.d.ts +2 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-types/extensionConfiguration.d.ts +9 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-types/index.d.ts +7 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-types/models/QDeveloperStreamingServiceException.d.ts +14 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-types/models/index.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-types/models/models_0.d.ts +2985 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-types/protocols/Aws_json1_0.d.ts +20 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-types/runtimeConfig.browser.d.ts +47 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-types/runtimeConfig.d.ts +47 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-types/runtimeConfig.native.d.ts +46 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-types/runtimeConfig.shared.d.ts +19 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/dist-types/runtimeExtensions.d.ts +17 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/README.md +4 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-cjs/index.js +294 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/auth.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/checksum.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/client.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/command.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/connection.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/credentials.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/crypto.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/dns.js +5 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/encode.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/endpoint.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/eventStream.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/extensions/index.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/feature-ids.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/http.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/identity/AnonymousIdentity.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/identity/AwsCredentialIdentity.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/identity/Identity.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/identity/LoginIdentity.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/identity/TokenIdentity.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/identity/index.js +5 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/index.js +33 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/logger.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/middleware.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/pagination.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/profile.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/request.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/response.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/retry.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/serde.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/shapes.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/signature.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/stream.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/token.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/transfer.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/uri.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/util.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/waiter.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/abort.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/auth.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/blob/blob-types.d.ts +2 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/checksum.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/client.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/command.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/connection.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/credentials.d.ts +50 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/crypto.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/dns.d.ts +85 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/encode.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/endpoint.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/eventStream.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/extensions/index.d.ts +8 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/feature-ids.d.ts +59 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/http.d.ts +33 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/identity/AnonymousIdentity.d.ts +6 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/identity/AwsCredentialIdentity.d.ts +47 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/identity/Identity.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/identity/LoginIdentity.d.ts +18 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/identity/TokenIdentity.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/identity/index.d.ts +5 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/index.d.ts +33 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/logger.d.ts +22 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/middleware.d.ts +13 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/pagination.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/profile.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/request.d.ts +7 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/response.d.ts +7 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/retry.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/serde.d.ts +24 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/shapes.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/signature.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/stream.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/token.d.ts +17 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/transfer.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/abort.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/auth.d.ts +5 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/blob/blob-types.d.ts +2 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/checksum.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/client.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/command.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/connection.d.ts +6 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/credentials.d.ts +13 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/crypto.d.ts +7 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/dns.d.ts +19 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/encode.d.ts +6 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/endpoint.d.ts +9 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/eventStream.d.ts +24 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/extensions/index.d.ts +5 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/feature-ids.d.ts +54 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/http.d.ts +17 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/AnonymousIdentity.d.ts +2 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/AwsCredentialIdentity.d.ts +25 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/Identity.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/LoginIdentity.d.ts +6 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/TokenIdentity.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/index.d.ts +5 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/index.d.ts +33 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/logger.d.ts +15 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/middleware.d.ts +47 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/pagination.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/profile.d.ts +6 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/request.d.ts +4 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/response.d.ts +4 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/retry.d.ts +12 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/serde.d.ts +16 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/shapes.d.ts +6 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/signature.d.ts +15 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/stream.d.ts +4 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/token.d.ts +4 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/transfer.d.ts +7 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/uri.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/util.d.ts +14 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/ts3.4/waiter.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/uri.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/util.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-types/waiter.d.ts +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/package.json +56 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/abort-controller/LICENSE +201 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/abort-controller/README.md +4 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/abort-controller/dist-cjs/index.js +84 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/abort-controller/dist-es/AbortController.js +9 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/abort-controller/dist-es/AbortSignal.js +20 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/abort-controller/dist-es/index.js +2 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/abort-controller/dist-types/AbortController.d.ts +16 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/abort-controller/dist-types/AbortSignal.d.ts +21 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/abort-controller/dist-types/index.d.ts +9 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/abort-controller/dist-types/ts3.4/AbortController.d.ts +16 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/abort-controller/dist-types/ts3.4/AbortSignal.d.ts +21 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/abort-controller/dist-types/ts3.4/index.d.ts +9 -0
- package/node_modules/@amzn/{codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader → amazon-q-developer-streaming-client/node_modules/@smithy/abort-controller}/package.json +21 -31
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/LICENSE +201 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/README.md +9 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-cjs/index.js +806 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-cjs/stream-collector/readable.mock.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-es/constants.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +9 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-es/index.js +3 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +209 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +86 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js +32 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +167 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-es/readable.mock.js +19 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-es/server.mock.js +88 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js +36 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js +22 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js +24 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js +11 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js +41 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-es/stream-collector/readable.mock.js +19 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-es/timing.js +4 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +56 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/constants.d.ts +5 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/get-transformed-headers.d.ts +4 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/index.d.ts +3 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +47 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +25 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-pool.d.ts +13 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +62 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/readable.mock.d.ts +15 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/server.mock.d.ts +12 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/set-connection-timeout.d.ts +9 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/set-socket-keep-alive.d.ts +13 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +9 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/stream-collector/collector.d.ts +8 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/stream-collector/index.d.ts +6 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/stream-collector/readable.mock.d.ts +15 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/timing.d.ts +8 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/ts3.4/constants.d.ts +5 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/ts3.4/get-transformed-headers.d.ts +4 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/ts3.4/index.d.ts +3 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts +46 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-manager.d.ts +25 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-pool.d.ts +13 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts +62 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/ts3.4/readable.mock.d.ts +13 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/ts3.4/server.mock.d.ts +12 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts +3 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-keep-alive.d.ts +7 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +3 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/collector.d.ts +6 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/index.d.ts +6 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/readable.mock.d.ts +13 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/ts3.4/timing.d.ts +8 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/ts3.4/write-request-body.d.ts +12 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-types/write-request-body.d.ts +13 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/package.json +67 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/CHANGELOG.md +274 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/CONTRIBUTING.md +18 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/LICENSE.md +9 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/README.md +466 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/bin/uuid +2 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/commonjs-browser/index.js +79 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/commonjs-browser/md5.js +223 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/commonjs-browser/native.js +11 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/commonjs-browser/nil.js +8 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/commonjs-browser/parse.js +45 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/commonjs-browser/regex.js +8 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/commonjs-browser/rng.js +25 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/commonjs-browser/sha1.js +104 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/commonjs-browser/stringify.js +44 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/commonjs-browser/v1.js +107 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/commonjs-browser/v3.js +16 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/commonjs-browser/v35.js +80 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/commonjs-browser/v4.js +43 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/commonjs-browser/v5.js +16 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/commonjs-browser/validate.js +17 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/commonjs-browser/version.js +21 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-browser/index.js +9 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-browser/md5.js +215 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-browser/native.js +4 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-browser/nil.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-browser/parse.js +35 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-browser/regex.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-browser/rng.js +18 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-browser/sha1.js +96 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-browser/stringify.js +33 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-browser/v1.js +95 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-browser/v3.js +4 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-browser/v35.js +66 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-browser/v4.js +29 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-browser/v5.js +4 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-browser/validate.js +7 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-browser/version.js +11 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-node/index.js +9 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-node/md5.js +13 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-node/native.js +4 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-node/nil.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-node/parse.js +35 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-node/regex.js +1 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-node/rng.js +12 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-node/sha1.js +13 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-node/stringify.js +33 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-node/v1.js +95 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-node/v3.js +4 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-node/v35.js +66 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-node/v4.js +29 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-node/v5.js +4 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-node/validate.js +7 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/esm-node/version.js +11 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/index.js +79 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/md5-browser.js +223 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/md5.js +23 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/native-browser.js +11 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/native.js +15 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/nil.js +8 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/parse.js +45 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/regex.js +8 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/rng-browser.js +25 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/rng.js +24 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/sha1-browser.js +104 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/sha1.js +23 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/stringify.js +44 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/uuid-bin.js +85 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/v1.js +107 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/v3.js +16 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/v35.js +80 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/v4.js +43 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/v5.js +16 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/validate.js +17 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/dist/version.js +21 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/package.json +135 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/node_modules/uuid/wrapper.mjs +10 -0
- package/node_modules/@amzn/amazon-q-developer-streaming-client/package.json +88 -0
- package/node_modules/@amzn/codewhisperer-streaming/README.md +121 -1
- package/node_modules/@amzn/codewhisperer-streaming/dist-cjs/CodeWhispererStreamingClient.js +1 -0
- package/node_modules/@amzn/codewhisperer-streaming/dist-cjs/endpoints.js +2 -0
- package/node_modules/@amzn/codewhisperer-streaming/dist-cjs/models/models_0.js +266 -42
- package/node_modules/@amzn/codewhisperer-streaming/dist-cjs/protocols/Aws_restJson1.js +205 -3
- package/node_modules/@amzn/codewhisperer-streaming/dist-cjs/runtimeConfig.browser.js +1 -1
- package/node_modules/@amzn/codewhisperer-streaming/dist-cjs/runtimeConfig.js +8 -6
- package/node_modules/@amzn/codewhisperer-streaming/dist-es/CodeWhispererStreamingClient.js +1 -0
- package/node_modules/@amzn/codewhisperer-streaming/dist-es/endpoints.js +2 -0
- package/node_modules/@amzn/codewhisperer-streaming/dist-es/models/models_0.js +241 -33
- package/node_modules/@amzn/codewhisperer-streaming/dist-es/protocols/Aws_restJson1.js +207 -5
- package/node_modules/@amzn/codewhisperer-streaming/dist-es/runtimeConfig.browser.js +2 -2
- package/node_modules/@amzn/codewhisperer-streaming/dist-es/runtimeConfig.js +9 -7
- package/node_modules/@amzn/codewhisperer-streaming/dist-types/CodeWhispererStreamingClient.d.ts +18 -0
- package/node_modules/@amzn/codewhisperer-streaming/dist-types/commands/ExportResultArchiveCommand.d.ts +1 -0
- package/node_modules/@amzn/codewhisperer-streaming/dist-types/commands/GenerateAssistantResponseCommand.d.ts +168 -8
- package/node_modules/@amzn/codewhisperer-streaming/dist-types/commands/GenerateTaskAssistPlanCommand.d.ts +169 -8
- package/node_modules/@amzn/codewhisperer-streaming/dist-types/commands/SendMessageCommand.d.ts +168 -8
- package/node_modules/@amzn/codewhisperer-streaming/dist-types/models/models_0.d.ts +874 -221
- package/node_modules/@amzn/codewhisperer-streaming/dist-types/runtimeConfig.browser.d.ts +6 -1
- package/node_modules/@amzn/codewhisperer-streaming/dist-types/runtimeConfig.d.ts +3 -1
- package/node_modules/@amzn/codewhisperer-streaming/dist-types/runtimeConfig.native.d.ts +3 -1
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +25 -17
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js +12 -3
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js +3 -3
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js +6 -8
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/fromSso.d.ts +6 -2
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/fromStatic.d.ts +1 -0
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/getNewSsoOidcToken.d.ts +3 -1
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/getSsoOidcClient.d.ts +4 -3
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromSso.d.ts +8 -3
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getNewSsoOidcToken.d.ts +6 -2
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getSsoOidcClient.d.ts +5 -1
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/package.json +11 -12
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-cjs/index.js +0 -1
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/feature-ids.js +1 -0
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/index.js +1 -0
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/credentials.d.ts +1 -0
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/feature-ids.d.ts +59 -0
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/identity/AwsCredentialIdentity.d.ts +47 -1
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/index.d.ts +1 -0
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/middleware.d.ts +12 -0
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/credentials.d.ts +1 -0
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/feature-ids.d.ts +54 -0
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/AwsCredentialIdentity.d.ts +21 -0
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/index.d.ts +1 -0
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/middleware.d.ts +7 -0
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/package.json +4 -4
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/abort-controller/dist-cjs/index.js +8 -6
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/abort-controller/package.json +6 -6
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-cjs/index.js +41 -39
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +2 -1
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js +3 -1
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +2 -2
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +8 -0
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +3 -0
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +6 -1
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/readable.mock.d.ts +1 -0
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/set-connection-timeout.d.ts +2 -0
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/set-socket-keep-alive.d.ts +2 -0
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +2 -0
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/stream-collector/collector.d.ts +1 -0
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/stream-collector/index.d.ts +4 -0
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/stream-collector/readable.mock.d.ts +1 -0
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts +8 -0
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-manager.d.ts +3 -0
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts +6 -1
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/index.d.ts +4 -0
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/ts3.4/write-request-body.d.ts +1 -1
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/dist-types/write-request-body.d.ts +1 -1
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/node-http-handler/package.json +10 -10
- package/node_modules/@amzn/codewhisperer-streaming/package.json +42 -42
- package/node_modules/@smithy/protocol-http/dist-cjs/extensions/httpExtensionConfiguration.js +1 -0
- package/node_modules/@smithy/protocol-http/dist-cjs/extensions/index.js +1 -0
- package/node_modules/@smithy/protocol-http/dist-cjs/httpRequest.js +1 -0
- package/node_modules/@smithy/protocol-http/dist-cjs/httpResponse.js +1 -0
- package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-cjs/index.js +8 -30
- package/node_modules/@smithy/protocol-http/dist-cjs/isValidHostname.js +1 -0
- package/node_modules/@smithy/protocol-http/dist-cjs/types.js +1 -0
- package/node_modules/@smithy/protocol-http/dist-es/httpHandler.js +1 -0
- package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-es/httpRequest.js +8 -13
- package/node_modules/@smithy/protocol-http/dist-es/types.js +1 -0
- package/node_modules/@smithy/protocol-http/dist-types/httpRequest.d.ts +23 -0
- package/node_modules/@smithy/protocol-http/dist-types/ts3.4/httpRequest.d.ts +23 -0
- package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/package.json +6 -6
- package/out/client/sigv4/codewhisperer.d.ts +2 -2
- package/out/client/sigv4/codewhisperer.js +4 -3
- package/out/client/sigv4/codewhisperer.js.map +1 -1
- package/out/client/streamingClient/codewhispererStreamingClient.d.ts +3 -3
- package/out/client/streamingClient/codewhispererStreamingClient.js +4 -3
- package/out/client/streamingClient/codewhispererStreamingClient.js.map +1 -1
- package/out/client/token/codewhisperer.d.ts +2 -2
- package/out/client/token/codewhisperer.js +4 -3
- package/out/client/token/codewhisperer.js.map +1 -1
- package/out/index.d.ts +1 -0
- package/out/index.js +4 -1
- package/out/index.js.map +1 -1
- package/out/language-server/agenticChat/agenticChatController.d.ts +35 -4
- package/out/language-server/agenticChat/agenticChatController.js +1341 -91
- package/out/language-server/agenticChat/agenticChatController.js.map +1 -1
- package/out/language-server/agenticChat/agenticChatEventParser.d.ts +52 -0
- package/out/language-server/agenticChat/agenticChatEventParser.js +189 -0
- package/out/language-server/agenticChat/agenticChatEventParser.js.map +1 -0
- package/out/language-server/agenticChat/agenticChatResultStream.d.ts +83 -0
- package/out/language-server/agenticChat/agenticChatResultStream.js +176 -0
- package/out/language-server/agenticChat/agenticChatResultStream.js.map +1 -0
- package/out/language-server/agenticChat/constants.d.ts +4 -0
- package/out/language-server/agenticChat/constants.js +8 -0
- package/out/language-server/agenticChat/constants.js.map +1 -0
- package/out/language-server/agenticChat/context/addtionalContextProvider.d.ts +14 -0
- package/out/language-server/agenticChat/context/addtionalContextProvider.js +191 -0
- package/out/language-server/agenticChat/context/addtionalContextProvider.js.map +1 -0
- package/out/language-server/agenticChat/context/agenticChatTriggerContext.d.ts +54 -0
- package/out/language-server/agenticChat/context/agenticChatTriggerContext.js +246 -0
- package/out/language-server/agenticChat/context/agenticChatTriggerContext.js.map +1 -0
- package/out/language-server/agenticChat/context/contextCommandsProvider.d.ts +20 -0
- package/out/language-server/agenticChat/context/contextCommandsProvider.js +206 -0
- package/out/language-server/agenticChat/context/contextCommandsProvider.js.map +1 -0
- package/out/language-server/agenticChat/context/contextUtils.d.ts +27 -0
- package/out/language-server/agenticChat/context/contextUtils.js +44 -0
- package/out/language-server/agenticChat/context/contextUtils.js.map +1 -0
- package/out/language-server/agenticChat/errors.d.ts +10 -0
- package/out/language-server/agenticChat/errors.js +42 -0
- package/out/language-server/agenticChat/errors.js.map +1 -0
- package/out/language-server/agenticChat/qAgenticChatServer.js +42 -15
- package/out/language-server/agenticChat/qAgenticChatServer.js.map +1 -1
- package/out/language-server/agenticChat/tabBarController.d.ts +55 -0
- package/out/language-server/agenticChat/tabBarController.js +216 -0
- package/out/language-server/agenticChat/tabBarController.js.map +1 -0
- package/out/language-server/agenticChat/textFormatting.d.ts +4 -0
- package/out/language-server/agenticChat/textFormatting.js +28 -0
- package/out/language-server/agenticChat/textFormatting.js.map +1 -0
- package/out/language-server/agenticChat/tools/chatDb/chatDb.d.ts +89 -0
- package/out/language-server/agenticChat/tools/chatDb/chatDb.js +561 -0
- package/out/language-server/agenticChat/tools/chatDb/chatDb.js.map +1 -0
- package/out/language-server/agenticChat/tools/chatDb/util.d.ts +74 -0
- package/out/language-server/agenticChat/tools/chatDb/util.js +255 -0
- package/out/language-server/agenticChat/tools/chatDb/util.js.map +1 -0
- package/out/language-server/agenticChat/tools/codeSearch.d.ts +43 -0
- package/out/language-server/agenticChat/tools/codeSearch.js +168 -0
- package/out/language-server/agenticChat/tools/codeSearch.js.map +1 -0
- package/out/language-server/agenticChat/tools/executeBash.d.ts +70 -0
- package/out/language-server/agenticChat/tools/executeBash.js +476 -0
- package/out/language-server/agenticChat/tools/executeBash.js.map +1 -0
- package/out/language-server/agenticChat/tools/fileSearch.d.ts +45 -0
- package/out/language-server/agenticChat/tools/fileSearch.js +115 -0
- package/out/language-server/agenticChat/tools/fileSearch.js.map +1 -0
- package/out/language-server/agenticChat/tools/fsRead.d.ts +13 -9
- package/out/language-server/agenticChat/tools/fsRead.js +68 -22
- package/out/language-server/agenticChat/tools/fsRead.js.map +1 -1
- package/out/language-server/agenticChat/tools/fsWrite.d.ts +21 -12
- package/out/language-server/agenticChat/tools/fsWrite.js +127 -44
- package/out/language-server/agenticChat/tools/fsWrite.js.map +1 -1
- package/out/language-server/agenticChat/tools/listDirectory.d.ts +36 -0
- package/out/language-server/agenticChat/tools/listDirectory.js +110 -0
- package/out/language-server/agenticChat/tools/listDirectory.js.map +1 -0
- package/out/language-server/agenticChat/tools/lspApplyWorkspaceEdit.d.ts +100 -0
- package/out/language-server/agenticChat/tools/lspApplyWorkspaceEdit.js +140 -0
- package/out/language-server/agenticChat/tools/lspApplyWorkspaceEdit.js.map +1 -0
- package/out/language-server/agenticChat/tools/lspGetDocuments.d.ts +24 -0
- package/out/language-server/agenticChat/tools/lspGetDocuments.js +45 -0
- package/out/language-server/agenticChat/tools/lspGetDocuments.js.map +1 -0
- package/out/language-server/agenticChat/tools/lspReadDocumentContents.d.ts +37 -0
- package/out/language-server/agenticChat/tools/lspReadDocumentContents.js +116 -0
- package/out/language-server/agenticChat/tools/lspReadDocumentContents.js.map +1 -0
- package/out/language-server/agenticChat/tools/mcp/mcpManager.d.ts +21 -0
- package/out/language-server/agenticChat/tools/mcp/mcpManager.js +106 -0
- package/out/language-server/agenticChat/tools/mcp/mcpManager.js.map +1 -0
- package/out/language-server/agenticChat/tools/mcp/mcpTool.d.ts +21 -0
- package/out/language-server/agenticChat/tools/mcp/mcpTool.js +54 -0
- package/out/language-server/agenticChat/tools/mcp/mcpTool.js.map +1 -0
- package/out/language-server/agenticChat/tools/mcp/mcpTypes.d.ts +28 -0
- package/out/language-server/agenticChat/tools/mcp/mcpTypes.js +7 -0
- package/out/language-server/agenticChat/tools/mcp/mcpTypes.js.map +1 -0
- package/out/language-server/agenticChat/tools/mcp/mcpUtils.d.ts +7 -0
- package/out/language-server/agenticChat/tools/mcp/mcpUtils.js +78 -0
- package/out/language-server/agenticChat/tools/mcp/mcpUtils.js.map +1 -0
- package/out/language-server/agenticChat/tools/toolServer.d.ts +3 -0
- package/out/language-server/agenticChat/tools/toolServer.js +62 -6
- package/out/language-server/agenticChat/tools/toolServer.js.map +1 -1
- package/out/language-server/agenticChat/tools/toolShared.d.ts +48 -5
- package/out/language-server/agenticChat/tools/toolShared.js +109 -2
- package/out/language-server/agenticChat/tools/toolShared.js.map +1 -1
- package/out/language-server/chat/chatController.d.ts +7 -4
- package/out/language-server/chat/chatController.js +13 -18
- package/out/language-server/chat/chatController.js.map +1 -1
- package/out/language-server/chat/chatEventParser.d.ts +3 -1
- package/out/language-server/chat/chatEventParser.js.map +1 -1
- package/out/language-server/chat/chatSessionManagementService.d.ts +2 -2
- package/out/language-server/chat/chatSessionManagementService.js +4 -4
- package/out/language-server/chat/chatSessionManagementService.js.map +1 -1
- package/out/language-server/chat/chatSessionService.d.ts +36 -3
- package/out/language-server/chat/chatSessionService.js +88 -5
- package/out/language-server/chat/chatSessionService.js.map +1 -1
- package/out/language-server/chat/constants.d.ts +3 -0
- package/out/language-server/chat/constants.js +17 -1
- package/out/language-server/chat/constants.js.map +1 -1
- package/out/language-server/chat/contexts/documentContext.d.ts +2 -1
- package/out/language-server/chat/contexts/documentContext.js +2 -0
- package/out/language-server/chat/contexts/documentContext.js.map +1 -1
- package/out/language-server/chat/contexts/triggerContext.d.ts +7 -3
- package/out/language-server/chat/contexts/triggerContext.js +39 -2
- package/out/language-server/chat/contexts/triggerContext.js.map +1 -1
- package/out/language-server/chat/qChatServer.d.ts +4 -1
- package/out/language-server/chat/qChatServer.js +17 -17
- package/out/language-server/chat/qChatServer.js.map +1 -1
- package/out/language-server/chat/quickActions.d.ts +2 -0
- package/out/language-server/chat/quickActions.js +2 -0
- package/out/language-server/chat/quickActions.js.map +1 -1
- package/out/language-server/chat/telemetry/chatTelemetryController.d.ts +5 -3
- package/out/language-server/chat/telemetry/chatTelemetryController.js +50 -4
- package/out/language-server/chat/telemetry/chatTelemetryController.js.map +1 -1
- package/out/language-server/chat/tools/relevantTextDocuments.d.ts +3 -0
- package/out/language-server/chat/tools/relevantTextDocuments.js +42 -0
- package/out/language-server/chat/tools/relevantTextDocuments.js.map +1 -0
- package/out/language-server/chat/utils.js +18 -3
- package/out/language-server/chat/utils.js.map +1 -1
- package/out/language-server/configuration/qConfigurationServer.d.ts +2 -3
- package/out/language-server/configuration/qConfigurationServer.js +27 -20
- package/out/language-server/configuration/qConfigurationServer.js.map +1 -1
- package/out/language-server/inline-completion/auto-trigger/coefficients.json +4 -1
- package/out/language-server/inline-completion/codeWhispererServer.d.ts +2 -3
- package/out/language-server/inline-completion/codeWhispererServer.js +29 -30
- package/out/language-server/inline-completion/codeWhispererServer.js.map +1 -1
- package/out/language-server/localProjectContext/localProjectContextServer.d.ts +2 -0
- package/out/language-server/localProjectContext/localProjectContextServer.js +132 -0
- package/out/language-server/localProjectContext/localProjectContextServer.js.map +1 -0
- package/out/language-server/netTransform/artifactManager.js +12 -4
- package/out/language-server/netTransform/artifactManager.js.map +1 -1
- package/out/language-server/netTransform/metrics.d.ts +2 -0
- package/out/language-server/netTransform/metrics.js +26 -1
- package/out/language-server/netTransform/metrics.js.map +1 -1
- package/out/language-server/netTransform/models.d.ts +22 -0
- package/out/language-server/netTransform/models.js +12 -1
- package/out/language-server/netTransform/models.js.map +1 -1
- package/out/language-server/netTransform/netTransformServer.d.ts +2 -4
- package/out/language-server/netTransform/netTransformServer.js +21 -16
- package/out/language-server/netTransform/netTransformServer.js.map +1 -1
- package/out/language-server/netTransform/tests/mockData.js +1 -0
- package/out/language-server/netTransform/tests/mockData.js.map +1 -1
- package/out/language-server/netTransform/transformHandler.d.ts +13 -5
- package/out/language-server/netTransform/transformHandler.js +45 -12
- package/out/language-server/netTransform/transformHandler.js.map +1 -1
- package/out/language-server/netTransform/validation.d.ts +11 -0
- package/out/language-server/netTransform/validation.js +33 -0
- package/out/language-server/netTransform/validation.js.map +1 -1
- package/out/language-server/securityScan/codeWhispererSecurityScanServer.js +10 -11
- package/out/language-server/securityScan/codeWhispererSecurityScanServer.js.map +1 -1
- package/out/language-server/securityScan/types.d.ts +2 -1
- package/out/shared/amazonQServer.d.ts +5 -0
- package/out/shared/amazonQServer.js +53 -0
- package/out/shared/amazonQServer.js.map +1 -0
- package/out/shared/amazonQServiceManager/AmazonQIAMServiceManager.d.ts +19 -0
- package/out/shared/amazonQServiceManager/AmazonQIAMServiceManager.js +61 -0
- package/out/shared/amazonQServiceManager/AmazonQIAMServiceManager.js.map +1 -0
- package/out/shared/amazonQServiceManager/AmazonQTokenServiceManager.d.ts +14 -28
- package/out/shared/amazonQServiceManager/AmazonQTokenServiceManager.js +78 -99
- package/out/shared/amazonQServiceManager/AmazonQTokenServiceManager.js.map +1 -1
- package/out/shared/amazonQServiceManager/BaseAmazonQServiceManager.d.ts +72 -5
- package/out/shared/amazonQServiceManager/BaseAmazonQServiceManager.js +116 -0
- package/out/shared/amazonQServiceManager/BaseAmazonQServiceManager.js.map +1 -1
- package/out/shared/amazonQServiceManager/configurationUtils.d.ts +13 -1
- package/out/shared/amazonQServiceManager/configurationUtils.js +41 -22
- package/out/shared/amazonQServiceManager/configurationUtils.js.map +1 -1
- package/out/shared/amazonQServiceManager/errors.d.ts +9 -0
- package/out/shared/amazonQServiceManager/errors.js +22 -1
- package/out/shared/amazonQServiceManager/errors.js.map +1 -1
- package/out/shared/amazonQServiceManager/qDeveloperProfiles.d.ts +2 -1
- package/out/shared/amazonQServiceManager/qDeveloperProfiles.js +26 -3
- package/out/shared/amazonQServiceManager/qDeveloperProfiles.js.map +1 -1
- package/out/shared/amazonQServiceManager/testUtils.d.ts +48 -0
- package/out/shared/amazonQServiceManager/testUtils.js +112 -0
- package/out/shared/amazonQServiceManager/testUtils.js.map +1 -0
- package/out/shared/codeWhispererService.d.ts +3 -3
- package/out/shared/codeWhispererService.js +4 -4
- package/out/shared/codeWhispererService.js.map +1 -1
- package/out/shared/constants.d.ts +10 -0
- package/out/shared/constants.js +12 -1
- package/out/shared/constants.js.map +1 -1
- package/out/shared/initializeUtils.d.ts +3 -0
- package/out/shared/initializeUtils.js +32 -0
- package/out/shared/initializeUtils.js.map +1 -0
- package/out/shared/localProjectContextController.d.ts +56 -0
- package/out/shared/localProjectContextController.js +371 -0
- package/out/shared/localProjectContextController.js.map +1 -0
- package/out/shared/models/constants.d.ts +5 -0
- package/out/shared/models/constants.js +6 -1
- package/out/shared/models/constants.js.map +1 -1
- package/out/shared/models/model.d.ts +2 -1
- package/out/shared/proxy-server.d.ts +4 -2
- package/out/shared/proxy-server.js +11 -10
- package/out/shared/proxy-server.js.map +1 -1
- package/out/shared/streamingClientService.d.ts +23 -7
- package/out/shared/streamingClientService.js +56 -9
- package/out/shared/streamingClientService.js.map +1 -1
- package/out/shared/supplementalContextUtil/crossFileContextUtil.d.ts +4 -1
- package/out/shared/supplementalContextUtil/crossFileContextUtil.js +73 -17
- package/out/shared/supplementalContextUtil/crossFileContextUtil.js.map +1 -1
- package/out/shared/supplementalContextUtil/supplementalContextUtil.d.ts +8 -0
- package/out/shared/supplementalContextUtil/supplementalContextUtil.js +63 -2
- package/out/shared/supplementalContextUtil/supplementalContextUtil.js.map +1 -1
- package/out/shared/telemetry/telemetryService.d.ts +16 -2
- package/out/shared/telemetry/telemetryService.js +26 -3
- package/out/shared/telemetry/telemetryService.js.map +1 -1
- package/out/shared/telemetry/types.d.ts +37 -2
- package/out/shared/telemetry/types.js +2 -0
- package/out/shared/telemetry/types.js.map +1 -1
- package/out/shared/telemetryUtils.d.ts +1 -0
- package/out/shared/telemetryUtils.js +5 -3
- package/out/shared/telemetryUtils.js.map +1 -1
- package/out/shared/testUtils.d.ts +2 -1
- package/out/shared/testUtils.js +10 -1
- package/out/shared/testUtils.js.map +1 -1
- package/out/shared/utils.d.ts +30 -0
- package/out/shared/utils.js +184 -0
- package/out/shared/utils.js.map +1 -1
- package/package.json +21 -7
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/protocol-http/dist-types/httpRequest.d.ts +0 -53
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/protocol-http/dist-types/ts3.4/httpRequest.d.ts +0 -53
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/README.md +0 -105
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getHomeDir.js +0 -26
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFilepath.js +0 -12
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFromFile.js +0 -12
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js +0 -206
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/slurpFile.js +0 -13
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigData.js +0 -18
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigFilepath.js +0 -4
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/getCredentialsFilepath.js +0 -4
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/getHomeDir.js +0 -22
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/getProfileName.js +0 -3
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFilepath.js +0 -8
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFromFile.js +0 -8
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/getSsoSessionData.js +0 -5
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/index.js +0 -8
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/loadSharedConfigFiles.js +0 -39
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/loadSsoSessionData.js +0 -9
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/mergeConfigFiles.js +0 -14
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/parseIni.js +0 -52
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/parseKnownFiles.js +0 -6
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/slurpFile.js +0 -9
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/getConfigData.d.ts +0 -8
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/getConfigFilepath.d.ts +0 -2
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/getCredentialsFilepath.d.ts +0 -2
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/getHomeDir.d.ts +0 -6
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/getProfileName.d.ts +0 -5
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/getSSOTokenFilepath.d.ts +0 -4
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/getSSOTokenFromFile.d.ts +0 -44
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/getSsoSessionData.d.ts +0 -6
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/index.d.ts +0 -8
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/loadSharedConfigFiles.d.ts +0 -26
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/loadSsoSessionData.d.ts +0 -10
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/mergeConfigFiles.d.ts +0 -7
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/parseIni.d.ts +0 -2
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/parseKnownFiles.d.ts +0 -15
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/slurpFile.d.ts +0 -5
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/getConfigData.d.ts +0 -8
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/getConfigFilepath.d.ts +0 -2
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/getCredentialsFilepath.d.ts +0 -2
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/getHomeDir.d.ts +0 -6
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/getProfileName.d.ts +0 -5
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/getSSOTokenFilepath.d.ts +0 -4
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/getSSOTokenFromFile.d.ts +0 -44
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/getSsoSessionData.d.ts +0 -6
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/index.d.ts +0 -8
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/loadSharedConfigFiles.d.ts +0 -26
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/loadSsoSessionData.d.ts +0 -10
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/mergeConfigFiles.d.ts +0 -7
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/parseIni.d.ts +0 -2
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/parseKnownFiles.d.ts +0 -15
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/slurpFile.d.ts +0 -5
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/types.d.ts +0 -13
- package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/types.d.ts +0 -13
- package/out/shared/amazonQServiceManager/factories.d.ts +0 -15
- package/out/shared/amazonQServiceManager/factories.js +0 -47
- package/out/shared/amazonQServiceManager/factories.js.map +0 -1
- /package/node_modules/@amzn/{codewhisperer-streaming/node_modules/@smithy/protocol-http/dist-es/httpHandler.js → amazon-q-developer-streaming-client/dist-es/extensionConfiguration.js} +0 -0
- /package/node_modules/@amzn/{codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader → amazon-q-developer-streaming-client/node_modules/@aws-sdk/types}/LICENSE +0 -0
- /package/node_modules/@amzn/{codewhisperer-streaming/node_modules/@smithy/protocol-http/dist-es/types.js → amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/abort.js} +0 -0
- /package/node_modules/@amzn/{codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/types.js → amazon-q-developer-streaming-client/node_modules/@aws-sdk/types/dist-es/blob/blob-types.js} +0 -0
- /package/node_modules/@amzn/{codewhisperer-streaming/node_modules/@smithy/protocol-http/dist-cjs/Field.js → amazon-q-developer-streaming-client/node_modules/@smithy/abort-controller/dist-cjs/AbortController.js} +0 -0
- /package/node_modules/@amzn/{codewhisperer-streaming/node_modules/@smithy/protocol-http/dist-cjs/Fields.js → amazon-q-developer-streaming-client/node_modules/@smithy/abort-controller/dist-cjs/AbortSignal.js} +0 -0
- /package/node_modules/@amzn/{codewhisperer-streaming/node_modules/@smithy/protocol-http/dist-cjs/httpHandler.js → amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-cjs/constants.js} +0 -0
- /package/node_modules/@amzn/{codewhisperer-streaming/node_modules/@smithy/protocol-http/dist-cjs/httpRequest.js → amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-cjs/get-transformed-headers.js} +0 -0
- /package/node_modules/@amzn/{codewhisperer-streaming/node_modules/@smithy/protocol-http/dist-cjs/httpResponse.js → amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-cjs/node-http-handler.js} +0 -0
- /package/node_modules/@amzn/{codewhisperer-streaming/node_modules/@smithy/protocol-http/dist-cjs/isValidHostname.js → amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-cjs/node-http2-connection-manager.js} +0 -0
- /package/node_modules/@amzn/{codewhisperer-streaming/node_modules/@smithy/protocol-http/dist-cjs/types.js → amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-cjs/node-http2-connection-pool.js} +0 -0
- /package/node_modules/@amzn/{codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getConfigData.js → amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-cjs/node-http2-handler.js} +0 -0
- /package/node_modules/@amzn/{codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getConfigFilepath.js → amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-cjs/readable.mock.js} +0 -0
- /package/node_modules/@amzn/{codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getCredentialsFilepath.js → amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-cjs/server.mock.js} +0 -0
- /package/node_modules/@amzn/{codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getProfileName.js → amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-cjs/set-connection-timeout.js} +0 -0
- /package/node_modules/@amzn/{codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSsoSessionData.js → amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-cjs/set-socket-keep-alive.js} +0 -0
- /package/node_modules/@amzn/{codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/loadSharedConfigFiles.js → amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-cjs/set-socket-timeout.js} +0 -0
- /package/node_modules/@amzn/{codewhisperer-streaming/node_modules/@smithy/protocol-http/dist-cjs/extensions/httpExtensionConfiguration.js → amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-cjs/stream-collector/collector.js} +0 -0
- /package/node_modules/@amzn/{codewhisperer-streaming/node_modules/@smithy/protocol-http/dist-cjs/extensions → amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-cjs/stream-collector}/index.js +0 -0
- /package/node_modules/@amzn/{codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/loadSsoSessionData.js → amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-cjs/timing.js} +0 -0
- /package/node_modules/@amzn/{codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/mergeConfigFiles.js → amazon-q-developer-streaming-client/node_modules/@smithy/node-http-handler/dist-cjs/write-request-body.js} +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/LICENSE +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/README.md +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/parseIni.js → @smithy/protocol-http/dist-cjs/Field.js} +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/parseKnownFiles.js → @smithy/protocol-http/dist-cjs/Fields.js} +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/types.js → @smithy/protocol-http/dist-cjs/httpHandler.js} +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-es/Field.js +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-es/Fields.js +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-es/extensions/httpExtensionConfiguration.js +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-es/extensions/index.js +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-es/httpResponse.js +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-es/index.js +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-es/isValidHostname.js +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-types/Field.d.ts +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-types/Fields.d.ts +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-types/extensions/httpExtensionConfiguration.d.ts +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-types/extensions/index.d.ts +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-types/httpHandler.d.ts +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-types/httpResponse.d.ts +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-types/index.d.ts +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-types/isValidHostname.d.ts +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-types/ts3.4/Field.d.ts +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-types/ts3.4/Fields.d.ts +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-types/ts3.4/extensions/httpExtensionConfiguration.d.ts +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-types/ts3.4/extensions/index.d.ts +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-types/ts3.4/httpHandler.d.ts +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-types/ts3.4/httpResponse.d.ts +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-types/ts3.4/index.d.ts +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-types/ts3.4/isValidHostname.d.ts +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-types/ts3.4/types.d.ts +0 -0
- /package/node_modules/{@amzn/codewhisperer-streaming/node_modules/@smithy → @smithy}/protocol-http/dist-types/types.d.ts +0 -0
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.AgenticChatController = void 0;
|
|
8
|
+
const path = require("path");
|
|
8
9
|
const codewhisperer_streaming_1 = require("@amzn/codewhisperer-streaming");
|
|
9
10
|
const protocol_1 = require("@aws/language-server-runtimes/protocol");
|
|
11
|
+
const protocol_2 = require("@aws/language-server-runtimes/protocol");
|
|
10
12
|
const server_interface_1 = require("@aws/language-server-runtimes/server-interface");
|
|
11
13
|
const uuid_1 = require("uuid");
|
|
12
14
|
const types_1 = require("../../shared/telemetry/types");
|
|
@@ -16,10 +18,31 @@ const chatTelemetryController_1 = require("../chat/telemetry/chatTelemetryContro
|
|
|
16
18
|
const quickActions_1 = require("../chat/quickActions");
|
|
17
19
|
const metric_1 = require("../../shared/telemetry/metric");
|
|
18
20
|
const utils_2 = require("../../shared/utils");
|
|
19
|
-
const triggerContext_1 = require("../chat/contexts/triggerContext");
|
|
20
21
|
const constants_1 = require("../chat/constants");
|
|
21
22
|
const errors_1 = require("../../shared/amazonQServiceManager/errors");
|
|
22
23
|
const AmazonQTokenServiceManager_1 = require("../../shared/amazonQServiceManager/AmazonQTokenServiceManager");
|
|
24
|
+
const tabBarController_1 = require("./tabBarController");
|
|
25
|
+
const chatDb_1 = require("./tools/chatDb/chatDb");
|
|
26
|
+
const agenticChatEventParser_1 = require("./agenticChatEventParser");
|
|
27
|
+
const agenticChatResultStream_1 = require("./agenticChatResultStream");
|
|
28
|
+
const textFormatting_1 = require("./textFormatting");
|
|
29
|
+
const agenticChatTriggerContext_1 = require("./context/agenticChatTriggerContext");
|
|
30
|
+
const addtionalContextProvider_1 = require("./context/addtionalContextProvider");
|
|
31
|
+
const contextUtils_1 = require("./context/contextUtils");
|
|
32
|
+
const contextCommandsProvider_1 = require("./context/contextCommandsProvider");
|
|
33
|
+
const localProjectContextController_1 = require("../../shared/localProjectContextController");
|
|
34
|
+
const lsp_core_1 = require("@aws/lsp-core");
|
|
35
|
+
const fsRead_1 = require("./tools/fsRead");
|
|
36
|
+
const listDirectory_1 = require("./tools/listDirectory");
|
|
37
|
+
const fsWrite_1 = require("./tools/fsWrite");
|
|
38
|
+
const executeBash_1 = require("./tools/executeBash");
|
|
39
|
+
const toolShared_1 = require("./tools/toolShared");
|
|
40
|
+
const fileSearch_1 = require("./tools/fileSearch");
|
|
41
|
+
const lsp_core_2 = require("@aws/lsp-core");
|
|
42
|
+
const diff_1 = require("diff");
|
|
43
|
+
const constants_2 = require("./constants");
|
|
44
|
+
const vscode_uri_1 = require("vscode-uri");
|
|
45
|
+
const errors_2 = require("./errors");
|
|
23
46
|
class AgenticChatController {
|
|
24
47
|
#features;
|
|
25
48
|
#chatSessionManagementService;
|
|
@@ -27,20 +50,202 @@ class AgenticChatController {
|
|
|
27
50
|
#triggerContext;
|
|
28
51
|
#customizationArn;
|
|
29
52
|
#telemetryService;
|
|
30
|
-
#
|
|
31
|
-
|
|
53
|
+
#serviceManager;
|
|
54
|
+
#tabBarController;
|
|
55
|
+
#chatHistoryDb;
|
|
56
|
+
#additionalContextProvider;
|
|
57
|
+
#contextCommandsProvider;
|
|
58
|
+
#stoppedToolUses = new Set();
|
|
59
|
+
/**
|
|
60
|
+
* Determines the appropriate message ID for a tool use based on tool type and name
|
|
61
|
+
* @param toolType The type of tool being used
|
|
62
|
+
* @param toolUse The tool use object
|
|
63
|
+
* @returns The message ID to use
|
|
64
|
+
*/
|
|
65
|
+
#getMessageIdForToolUse(toolType, toolUse) {
|
|
66
|
+
const toolUseId = toolUse.toolUseId;
|
|
67
|
+
// Return plain toolUseId for executeBash, add "_permission" suffix for all other tools
|
|
68
|
+
return toolUse.name === 'executeBash' || toolType === 'executeBash' ? toolUseId : `${toolUseId}_permission`;
|
|
69
|
+
}
|
|
70
|
+
constructor(chatSessionManagementService, features, telemetryService, serviceManager) {
|
|
32
71
|
this.#features = features;
|
|
33
72
|
this.#chatSessionManagementService = chatSessionManagementService;
|
|
34
|
-
this.#triggerContext = new
|
|
73
|
+
this.#triggerContext = new agenticChatTriggerContext_1.AgenticChatTriggerContext(features);
|
|
35
74
|
this.#telemetryController = new chatTelemetryController_1.ChatTelemetryController(features, telemetryService);
|
|
36
75
|
this.#telemetryService = telemetryService;
|
|
37
|
-
this.#
|
|
76
|
+
this.#serviceManager = serviceManager;
|
|
77
|
+
this.#chatHistoryDb = new chatDb_1.ChatDatabase(features);
|
|
78
|
+
this.#tabBarController = new tabBarController_1.TabBarController(features, this.#chatHistoryDb);
|
|
79
|
+
this.#additionalContextProvider = new addtionalContextProvider_1.AdditionalContextProvider(features.workspace, features.lsp);
|
|
80
|
+
this.#contextCommandsProvider = new contextCommandsProvider_1.ContextCommandsProvider(this.#features.logging, this.#features.chat, this.#features.workspace, this.#features.lsp);
|
|
81
|
+
}
|
|
82
|
+
async onButtonClick(params) {
|
|
83
|
+
this.#log(`onButtonClick event with params: ${JSON.stringify(params)}`);
|
|
84
|
+
const session = this.#chatSessionManagementService.getSession(params.tabId);
|
|
85
|
+
if (params.buttonId === 'run-shell-command' ||
|
|
86
|
+
params.buttonId === 'reject-shell-command' ||
|
|
87
|
+
params.buttonId === 'allow-tools') {
|
|
88
|
+
if (!session.data) {
|
|
89
|
+
return { success: false, failureReason: `could not find chat session for tab: ${params.tabId} ` };
|
|
90
|
+
}
|
|
91
|
+
// For 'allow-tools', remove suffix as permission card needs to be seperate from file list card
|
|
92
|
+
const messageId = params.buttonId === 'allow-tools' && params.messageId.endsWith('_permission')
|
|
93
|
+
? params.messageId.replace('_permission', '')
|
|
94
|
+
: params.messageId;
|
|
95
|
+
const handler = session.data.getDeferredToolExecution(messageId);
|
|
96
|
+
if (!handler?.reject || !handler.resolve) {
|
|
97
|
+
return {
|
|
98
|
+
success: false,
|
|
99
|
+
failureReason: `could not find deferred tool execution for message: ${messageId} `,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
params.buttonId === 'reject-shell-command'
|
|
103
|
+
? (() => {
|
|
104
|
+
handler.reject(new toolShared_1.ToolApprovalException('Command was rejected.', true));
|
|
105
|
+
this.#stoppedToolUses.add(messageId);
|
|
106
|
+
})()
|
|
107
|
+
: handler.resolve();
|
|
108
|
+
return {
|
|
109
|
+
success: true,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
else if (params.buttonId === 'undo-changes') {
|
|
113
|
+
const toolUseId = params.messageId;
|
|
114
|
+
try {
|
|
115
|
+
await this.#undoFileChange(toolUseId, session.data);
|
|
116
|
+
this.#updateUndoButtonAfterClick(params.tabId, toolUseId, session.data);
|
|
117
|
+
this.#telemetryController.emitInteractWithAgenticChat('RejectDiff', params.tabId);
|
|
118
|
+
}
|
|
119
|
+
catch (err) {
|
|
120
|
+
return { success: false, failureReason: err.message };
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
success: true,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
else if (params.buttonId === 'undo-all-changes') {
|
|
127
|
+
const toolUseId = params.messageId.replace('_undoall', '');
|
|
128
|
+
await this.#undoAllFileChanges(params.tabId, toolUseId, session.data);
|
|
129
|
+
return {
|
|
130
|
+
success: true,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
else if (params.buttonId === 'stop-shell-command') {
|
|
134
|
+
this.#stoppedToolUses.add(params.messageId);
|
|
135
|
+
await this.#renderStoppedShellCommand(params.tabId, params.messageId);
|
|
136
|
+
return { success: true };
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
return {
|
|
140
|
+
success: false,
|
|
141
|
+
failureReason: 'not implemented',
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
async #undoFileChange(toolUseId, session) {
|
|
146
|
+
this.#log(`Reverting file change for tooluseId: ${toolUseId}`);
|
|
147
|
+
const toolUse = session?.toolUseLookup.get(toolUseId);
|
|
148
|
+
const input = toolUse?.input;
|
|
149
|
+
if (toolUse?.fileChange?.before) {
|
|
150
|
+
await this.#features.workspace.fs.writeFile(input.path, toolUse.fileChange.before);
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
await this.#features.workspace.fs.rm(input.path);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
#updateUndoButtonAfterClick(tabId, toolUseId, session) {
|
|
157
|
+
const cachedToolUse = session?.toolUseLookup.get(toolUseId);
|
|
158
|
+
if (!cachedToolUse) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
const fileList = cachedToolUse.chatResult?.header?.fileList;
|
|
162
|
+
const button = cachedToolUse.chatResult?.header?.buttons?.filter(button => button.id !== 'undo-changes');
|
|
163
|
+
const updatedHeader = {
|
|
164
|
+
...cachedToolUse.chatResult?.header,
|
|
165
|
+
buttons: button,
|
|
166
|
+
status: {
|
|
167
|
+
status: 'error',
|
|
168
|
+
icon: 'cancel',
|
|
169
|
+
text: 'Change discarded',
|
|
170
|
+
},
|
|
171
|
+
muted: true,
|
|
172
|
+
};
|
|
173
|
+
if (fileList && fileList.filePaths && fileList.details) {
|
|
174
|
+
const updatedFileList = {
|
|
175
|
+
...fileList,
|
|
176
|
+
muted: true,
|
|
177
|
+
};
|
|
178
|
+
const updatedDetails = { ...fileList.details };
|
|
179
|
+
for (const filePath of fileList.filePaths) {
|
|
180
|
+
if (updatedDetails[filePath]) {
|
|
181
|
+
;
|
|
182
|
+
updatedDetails[filePath] = {
|
|
183
|
+
...updatedDetails[filePath],
|
|
184
|
+
clickable: false,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
updatedFileList.details = updatedDetails;
|
|
189
|
+
updatedHeader.fileList = updatedFileList;
|
|
190
|
+
}
|
|
191
|
+
this.#features.chat.sendChatUpdate({
|
|
192
|
+
tabId,
|
|
193
|
+
data: {
|
|
194
|
+
messages: [
|
|
195
|
+
{
|
|
196
|
+
...cachedToolUse.chatResult,
|
|
197
|
+
header: updatedHeader,
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
},
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
async #undoAllFileChanges(tabId, toolUseId, session) {
|
|
204
|
+
this.#log(`Reverting all file changes starting from ${toolUseId}`);
|
|
205
|
+
const toUndo = session?.toolUseLookup.get(toolUseId)?.relatedToolUses;
|
|
206
|
+
if (!toUndo) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
for (const messageId of [...toUndo].reverse()) {
|
|
210
|
+
await this.onButtonClick({ buttonId: 'undo-changes', messageId, tabId });
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
async onCreatePrompt(params) {
|
|
214
|
+
const newFilePath = (0, contextUtils_1.getNewPromptFilePath)(params.promptName);
|
|
215
|
+
const newFileContent = '';
|
|
216
|
+
try {
|
|
217
|
+
await this.#features.workspace.fs.mkdir((0, contextUtils_1.getUserPromptsDirectory)(), { recursive: true });
|
|
218
|
+
await this.#features.workspace.fs.writeFile(newFilePath, newFileContent, { mode: 0o600 });
|
|
219
|
+
await this.#features.lsp.window.showDocument({ uri: vscode_uri_1.URI.file(newFilePath).toString() });
|
|
220
|
+
}
|
|
221
|
+
catch (e) {
|
|
222
|
+
this.#features.logging.warn(`Error creating prompt file: ${e}`);
|
|
223
|
+
}
|
|
38
224
|
}
|
|
39
225
|
dispose() {
|
|
40
226
|
this.#chatSessionManagementService.dispose();
|
|
41
227
|
this.#telemetryController.dispose();
|
|
228
|
+
this.#chatHistoryDb.close();
|
|
229
|
+
this.#contextCommandsProvider?.dispose();
|
|
230
|
+
}
|
|
231
|
+
async onListConversations(params) {
|
|
232
|
+
return this.#tabBarController.onListConversations(params);
|
|
233
|
+
}
|
|
234
|
+
async onConversationClick(params) {
|
|
235
|
+
return this.#tabBarController.onConversationClick(params);
|
|
236
|
+
}
|
|
237
|
+
async #sendProgressToClient(chunk, partialResultToken) {
|
|
238
|
+
if (!(0, utils_2.isNullish)(partialResultToken)) {
|
|
239
|
+
await this.#features.lsp.sendProgress(protocol_1.chatRequestType, partialResultToken, chunk);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
#getChatResultStream(partialResultToken) {
|
|
243
|
+
return new agenticChatResultStream_1.AgenticChatResultStream(async (result) => {
|
|
244
|
+
return this.#sendProgressToClient(result, partialResultToken);
|
|
245
|
+
});
|
|
42
246
|
}
|
|
43
247
|
async onChatPrompt(params, token) {
|
|
248
|
+
// Phase 1: Initial Setup - This happens only once
|
|
44
249
|
const maybeDefaultResponse = (0, utils_1.getDefaultChatResponse)(params.prompt.prompt);
|
|
45
250
|
if (maybeDefaultResponse) {
|
|
46
251
|
return maybeDefaultResponse;
|
|
@@ -48,92 +253,978 @@ class AgenticChatController {
|
|
|
48
253
|
const sessionResult = this.#chatSessionManagementService.getSession(params.tabId);
|
|
49
254
|
const { data: session, success } = sessionResult;
|
|
50
255
|
if (!success) {
|
|
51
|
-
return new server_interface_1.ResponseError(
|
|
256
|
+
return new server_interface_1.ResponseError(protocol_2.ErrorCodes.InternalError, sessionResult.error);
|
|
52
257
|
}
|
|
258
|
+
session.rejectAllDeferredToolExecutions(new toolShared_1.ToolApprovalException('Command ignored: new prompt', false));
|
|
259
|
+
await this.#invalidateAllShellCommands(params.tabId, session);
|
|
53
260
|
const metric = new metric_1.Metric({
|
|
54
|
-
cwsprChatConversationType: '
|
|
261
|
+
cwsprChatConversationType: 'AgenticChat',
|
|
55
262
|
});
|
|
56
|
-
const triggerContext = await this.#getTriggerContext(params, metric);
|
|
57
|
-
const isNewConversation = !session.conversationId;
|
|
58
|
-
token.onCancellationRequested(() => {
|
|
59
|
-
this.#log('cancellation requested');
|
|
60
|
-
session.abortRequest();
|
|
61
|
-
});
|
|
62
|
-
let response;
|
|
63
|
-
let requestInput;
|
|
64
|
-
const conversationIdentifier = session?.conversationId ?? 'New conversation';
|
|
65
263
|
try {
|
|
66
|
-
this.#
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
264
|
+
const triggerContext = await this.#getTriggerContext(params, metric);
|
|
265
|
+
const isNewConversation = !session.conversationId;
|
|
266
|
+
session.contextListSent = false;
|
|
267
|
+
if (isNewConversation) {
|
|
268
|
+
// agentic chat does not support conversationId in API response,
|
|
269
|
+
// so we set it to random UUID per session, as other chat functionality
|
|
270
|
+
// depends on it
|
|
271
|
+
session.conversationId = (0, uuid_1.v4)();
|
|
272
|
+
}
|
|
273
|
+
token.onCancellationRequested(async () => {
|
|
274
|
+
this.#log('cancellation requested');
|
|
275
|
+
await this.#getChatResultStream(params.partialResultToken).writeResultBlock({
|
|
276
|
+
type: 'directive',
|
|
277
|
+
messageId: 'stopped' + (0, uuid_1.v4)(),
|
|
278
|
+
body: 'You stopped your current work, please provide additional examples or ask another question.',
|
|
279
|
+
});
|
|
280
|
+
this.#telemetryController.emitInteractWithAgenticChat('StopChat', params.tabId);
|
|
281
|
+
session.abortRequest();
|
|
282
|
+
void this.#invalidateAllShellCommands(params.tabId, session);
|
|
283
|
+
session.rejectAllDeferredToolExecutions(new lsp_core_1.CancellationError('user'));
|
|
284
|
+
});
|
|
285
|
+
const chatResultStream = this.#getChatResultStream(params.partialResultToken);
|
|
286
|
+
const additionalContext = await this.#additionalContextProvider.getAdditionalContext(triggerContext, params.prompt.context);
|
|
287
|
+
if (additionalContext.length) {
|
|
288
|
+
triggerContext.documentReference =
|
|
289
|
+
this.#additionalContextProvider.getFileListFromContext(additionalContext);
|
|
290
|
+
}
|
|
291
|
+
// Get the initial request input
|
|
292
|
+
const initialRequestInput = await this.#prepareRequestInput(params, session, triggerContext, additionalContext, chatResultStream);
|
|
293
|
+
// Start the agent loop
|
|
294
|
+
const finalResult = await this.#runAgentLoop(initialRequestInput, session, metric, chatResultStream, params.tabId, session.conversationId, token, triggerContext.documentReference);
|
|
295
|
+
// Phase 5: Result Handling - This happens only once
|
|
296
|
+
return await this.#handleFinalResult(finalResult, session, params, metric, triggerContext, isNewConversation, chatResultStream);
|
|
72
297
|
}
|
|
73
298
|
catch (err) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
299
|
+
// HACK: the chat-client needs to have a partial event with the associated messageId sent before it can accept the final result.
|
|
300
|
+
// Without this, the `thinking` indicator never goes away.
|
|
301
|
+
// Note: buttons being explicitly empty is required for this hack to work.
|
|
302
|
+
const errorMessageId = `error-message-id-${(0, uuid_1.v4)()}`;
|
|
303
|
+
await this.#sendProgressToClient({
|
|
304
|
+
type: 'answer',
|
|
305
|
+
body: '',
|
|
306
|
+
messageId: errorMessageId,
|
|
307
|
+
buttons: [],
|
|
308
|
+
}, params.partialResultToken);
|
|
309
|
+
if (this.isUserAction(err, token)) {
|
|
310
|
+
/**
|
|
311
|
+
* when the session is aborted it generates an error.
|
|
312
|
+
* we need to resolve this error with an answer so the
|
|
313
|
+
* stream stops
|
|
314
|
+
*/
|
|
315
|
+
return {
|
|
316
|
+
type: 'answer',
|
|
317
|
+
body: '',
|
|
318
|
+
messageId: errorMessageId,
|
|
319
|
+
buttons: [],
|
|
320
|
+
};
|
|
95
321
|
}
|
|
96
|
-
this.#
|
|
97
|
-
return new server_interface_1.ResponseError(server_interface_1.LSPErrorCodes.RequestFailed, err instanceof Error ? err.message : 'Unknown request error');
|
|
322
|
+
return this.#handleRequestError(err, errorMessageId, params.tabId, metric);
|
|
98
323
|
}
|
|
99
|
-
|
|
100
|
-
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Prepares the initial request input for the chat prompt
|
|
327
|
+
*/
|
|
328
|
+
async #prepareRequestInput(params, session, triggerContext, additionalContext, chatResultStream) {
|
|
329
|
+
this.#debug('Preparing request input');
|
|
330
|
+
const profileArn = AmazonQTokenServiceManager_1.AmazonQTokenServiceManager.getInstance().getActiveProfileArn();
|
|
331
|
+
const requestInput = await this.#triggerContext.getChatParamsFromTrigger(params, triggerContext, codewhisperer_streaming_1.ChatTriggerType.MANUAL, this.#customizationArn, chatResultStream, profileArn, [], this.#getTools(session), additionalContext);
|
|
332
|
+
return requestInput;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Runs the agent loop, making requests and processing tool uses until completion
|
|
336
|
+
*/
|
|
337
|
+
async #runAgentLoop(initialRequestInput, session, metric, chatResultStream, tabId, conversationIdentifier, token, documentReference) {
|
|
338
|
+
let currentRequestInput = { ...initialRequestInput };
|
|
339
|
+
let finalResult = null;
|
|
340
|
+
let iterationCount = 0;
|
|
341
|
+
metric.recordStart();
|
|
342
|
+
while (iterationCount < constants_2.maxAgentLoopIterations) {
|
|
343
|
+
iterationCount++;
|
|
344
|
+
this.#debug(`Agent loop iteration ${iterationCount} for conversation id:`, conversationIdentifier || '');
|
|
345
|
+
// Check for cancellation
|
|
346
|
+
if (token?.isCancellationRequested) {
|
|
347
|
+
throw new lsp_core_1.CancellationError('user');
|
|
348
|
+
}
|
|
349
|
+
const currentMessage = currentRequestInput.conversationState?.currentMessage;
|
|
350
|
+
const conversationId = conversationIdentifier ?? '';
|
|
351
|
+
if (!currentMessage || !conversationId) {
|
|
352
|
+
this.#debug(`Warning: ${!currentMessage ? 'currentMessage' : ''}${!currentMessage && !conversationId ? ' and ' : ''}${!conversationId ? 'conversationIdentifier' : ''} is empty in agent loop iteration ${iterationCount}.`);
|
|
353
|
+
}
|
|
354
|
+
// Fix the history to maintain invariants
|
|
355
|
+
if (currentMessage) {
|
|
356
|
+
this.#chatHistoryDb.fixHistory(tabId, currentMessage, conversationIdentifier ?? '');
|
|
357
|
+
}
|
|
358
|
+
// Retrieve the history from DB; Do not include chatHistory for requests going to Mynah Backend
|
|
359
|
+
currentRequestInput.conversationState.history = currentRequestInput.conversationState?.currentMessage
|
|
360
|
+
?.userInputMessage?.userIntent
|
|
361
|
+
? []
|
|
362
|
+
: this.#chatHistoryDb.getMessages(tabId);
|
|
363
|
+
// Add loading message before making the request
|
|
364
|
+
const loadingMessageId = `loading-${(0, uuid_1.v4)()}`;
|
|
365
|
+
await chatResultStream.writeResultBlock({ ...constants_1.loadingMessage, messageId: loadingMessageId });
|
|
366
|
+
// Phase 3: Request Execution
|
|
367
|
+
this.#validateRequest(currentRequestInput);
|
|
368
|
+
const response = await session.generateAssistantResponse(currentRequestInput);
|
|
369
|
+
this.#features.logging.info(`generateAssistantResponse ResponseMetadata: ${lsp_core_2.loggingUtils.formatObj(response.$metadata)}`);
|
|
370
|
+
await chatResultStream.removeResultBlock(loadingMessageId);
|
|
371
|
+
// Add the current user message to the history DB
|
|
372
|
+
if (currentMessage && conversationIdentifier) {
|
|
373
|
+
this.#chatHistoryDb.addMessage(tabId, 'cwc', conversationIdentifier, {
|
|
374
|
+
body: currentMessage.userInputMessage?.content ?? '',
|
|
375
|
+
type: 'prompt',
|
|
376
|
+
userIntent: currentMessage.userInputMessage?.userIntent,
|
|
377
|
+
origin: currentMessage.userInputMessage?.origin,
|
|
378
|
+
userInputMessageContext: currentMessage.userInputMessage?.userInputMessageContext,
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
// Phase 4: Response Processing
|
|
382
|
+
const result = await this.#processGenerateAssistantResponseResponse(response, metric.mergeWith({
|
|
101
383
|
cwsprChatResponseCode: response.$metadata.httpStatusCode,
|
|
102
384
|
cwsprChatMessageId: response.$metadata.requestId,
|
|
103
|
-
}),
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
385
|
+
}), chatResultStream, session, documentReference);
|
|
386
|
+
// Add the current assistantResponse message to the history DB
|
|
387
|
+
if (result.data?.chatResult.body !== undefined) {
|
|
388
|
+
this.#chatHistoryDb.addMessage(tabId, 'cwc', conversationIdentifier ?? '', {
|
|
389
|
+
body: result.data?.chatResult.body,
|
|
390
|
+
type: 'answer',
|
|
391
|
+
codeReference: result.data.chatResult.codeReference,
|
|
392
|
+
relatedContent: result.data.chatResult.relatedContent?.content &&
|
|
393
|
+
result.data.chatResult.relatedContent.content.length > 0
|
|
394
|
+
? result.data?.chatResult.relatedContent
|
|
395
|
+
: undefined,
|
|
396
|
+
toolUses: Object.keys(result.data?.toolUses)
|
|
397
|
+
.filter(k => result.data.toolUses[k].stop)
|
|
398
|
+
.map(k => ({
|
|
399
|
+
toolUseId: result.data.toolUses[k].toolUseId,
|
|
400
|
+
name: result.data.toolUses[k].name,
|
|
401
|
+
input: result.data.toolUses[k].input,
|
|
402
|
+
})),
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
this.#features.logging.warn('No ChatResult body in response, skipping adding to history');
|
|
407
|
+
}
|
|
408
|
+
// Check if we have any tool uses that need to be processed
|
|
409
|
+
const pendingToolUses = this.#getPendingToolUses(result.data?.toolUses || {});
|
|
410
|
+
if (pendingToolUses.length === 0) {
|
|
411
|
+
// No more tool uses, we're done
|
|
412
|
+
finalResult = result;
|
|
413
|
+
break;
|
|
414
|
+
}
|
|
415
|
+
let content = '';
|
|
416
|
+
let toolResults;
|
|
417
|
+
if (result.success) {
|
|
418
|
+
// Process tool uses and update the request input for the next iteration
|
|
419
|
+
toolResults = await this.#processToolUses(pendingToolUses, chatResultStream, session, tabId, token);
|
|
420
|
+
if (toolResults.some(toolResult => toolResult.status === codewhisperer_streaming_1.ToolResultStatus.ERROR)) {
|
|
421
|
+
content = 'There was an error processing one or more tool uses. Please try again.';
|
|
422
|
+
}
|
|
423
|
+
metric.setDimension('cwsprChatConversationType', 'AgenticChatWithToolUse');
|
|
424
|
+
}
|
|
425
|
+
else {
|
|
426
|
+
// Send an error card to UI?
|
|
427
|
+
toolResults = pendingToolUses.map(toolUse => ({
|
|
428
|
+
toolUseId: toolUse.toolUseId,
|
|
429
|
+
status: codewhisperer_streaming_1.ToolResultStatus.ERROR,
|
|
430
|
+
content: [{ text: result.error }],
|
|
431
|
+
}));
|
|
432
|
+
if (result.error.startsWith('ToolUse input is invalid JSON:')) {
|
|
433
|
+
content =
|
|
434
|
+
'Your toolUse input is incomplete because it is too large. Break this task down into multiple tool uses with smaller input.';
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
currentRequestInput = this.#updateRequestInputWithToolResults(currentRequestInput, toolResults, content);
|
|
438
|
+
}
|
|
439
|
+
if (iterationCount >= constants_2.maxAgentLoopIterations) {
|
|
440
|
+
throw new errors_2.AgenticChatError('Agent loop reached iteration limit', 'MaxAgentLoopIterations');
|
|
441
|
+
}
|
|
442
|
+
return (finalResult || {
|
|
443
|
+
success: false,
|
|
444
|
+
error: 'Agent loop failed to produce a final result',
|
|
445
|
+
data: { chatResult: {}, toolUses: {} },
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* performs pre-validation of request before sending to backend service.
|
|
450
|
+
* @param request
|
|
451
|
+
*/
|
|
452
|
+
#validateRequest(request) {
|
|
453
|
+
// Note: these logs are very noisy, but contain information redacted on the backend.
|
|
454
|
+
this.#debug(`generateAssistantResponse Request: ${JSON.stringify(request, undefined, 2)}`);
|
|
455
|
+
const message = request.conversationState?.currentMessage?.userInputMessage?.content;
|
|
456
|
+
if (message && message.length > constants_2.generateAssistantResponseInputLimit) {
|
|
457
|
+
throw new errors_2.AgenticChatError(`Message is too long with ${message.length} characters, max is ${constants_2.generateAssistantResponseInputLimit}`, 'PromptCharacterLimit');
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Extracts tool uses that need to be processed
|
|
462
|
+
*/
|
|
463
|
+
#getPendingToolUses(toolUses) {
|
|
464
|
+
return Object.values(toolUses).filter(toolUse => toolUse.stop);
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Creates a promise that does not resolve until the user accepts or rejects the tool usage.
|
|
468
|
+
* @param toolUseId
|
|
469
|
+
* @param toolUseName
|
|
470
|
+
* @param resultStream
|
|
471
|
+
* @param promptBlockId id of approval block. This allows us to overwrite the buttons with 'accepted' or 'rejected' text.
|
|
472
|
+
* @param session
|
|
473
|
+
*/
|
|
474
|
+
async waitForToolApproval(toolUse, resultStream, promptBlockId, session) {
|
|
475
|
+
const deferred = this.#createDeferred();
|
|
476
|
+
session.setDeferredToolExecution(toolUse.toolUseId, deferred.resolve, deferred.reject);
|
|
477
|
+
this.#log(`Prompting for tool approval for tool: ${toolUse.name}`);
|
|
478
|
+
await deferred.promise;
|
|
479
|
+
// Note: we want to overwrite the button block because it already exists in the stream.
|
|
480
|
+
await resultStream.overwriteResultBlock(this.#getUpdateToolConfirmResult(toolUse, true), promptBlockId);
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Processes tool uses by running the tools and collecting results
|
|
484
|
+
*/
|
|
485
|
+
async #processToolUses(toolUses, chatResultStream, session, tabId, token) {
|
|
486
|
+
const results = [];
|
|
487
|
+
for (const toolUse of toolUses) {
|
|
488
|
+
// Store buttonBlockId to use it in `catch` block if needed
|
|
489
|
+
let cachedButtonBlockId;
|
|
490
|
+
if (!toolUse.name || !toolUse.toolUseId)
|
|
491
|
+
continue;
|
|
492
|
+
session.toolUseLookup.set(toolUse.toolUseId, toolUse);
|
|
493
|
+
try {
|
|
494
|
+
// TODO: Can we move this check in the event parser before the stream completes?
|
|
495
|
+
const availableToolNames = this.#getTools(session).map(tool => tool.toolSpecification.name);
|
|
496
|
+
if (!availableToolNames.includes(toolUse.name)) {
|
|
497
|
+
throw new Error(`Tool ${toolUse.name} is not available in the current mode`);
|
|
498
|
+
}
|
|
499
|
+
// fsRead and listDirectory write to an existing card and could show nothing in the current position
|
|
500
|
+
if (!['fsWrite', 'fsRead', 'listDirectory'].includes(toolUse.name)) {
|
|
501
|
+
await this.#showUndoAllIfRequired(chatResultStream, session);
|
|
502
|
+
}
|
|
503
|
+
const { explanation } = toolUse.input;
|
|
504
|
+
if (explanation) {
|
|
505
|
+
await chatResultStream.writeResultBlock({
|
|
506
|
+
type: 'directive',
|
|
507
|
+
messageId: toolUse.toolUseId + '_explanation',
|
|
508
|
+
body: explanation,
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
switch (toolUse.name) {
|
|
512
|
+
case 'fsRead':
|
|
513
|
+
case 'listDirectory':
|
|
514
|
+
case 'fileSearch':
|
|
515
|
+
case 'fsWrite':
|
|
516
|
+
case 'executeBash': {
|
|
517
|
+
const toolMap = {
|
|
518
|
+
fsRead: { Tool: fsRead_1.FsRead },
|
|
519
|
+
listDirectory: { Tool: listDirectory_1.ListDirectory },
|
|
520
|
+
fsWrite: { Tool: fsWrite_1.FsWrite },
|
|
521
|
+
executeBash: { Tool: executeBash_1.ExecuteBash },
|
|
522
|
+
fileSearch: { Tool: fileSearch_1.FileSearch },
|
|
523
|
+
};
|
|
524
|
+
const { Tool } = toolMap[toolUse.name];
|
|
525
|
+
const tool = new Tool(this.#features);
|
|
526
|
+
// Get the approved paths from the session
|
|
527
|
+
const approvedPaths = session.approvedPaths;
|
|
528
|
+
// Pass the approved paths to the tool's requiresAcceptance method
|
|
529
|
+
const { requiresAcceptance, warning } = await tool.requiresAcceptance(toolUse.input, approvedPaths);
|
|
530
|
+
if (requiresAcceptance || toolUse.name === 'executeBash') {
|
|
531
|
+
// for executeBash, we till send the confirmation message without action buttons
|
|
532
|
+
const confirmationResult = this.#processToolConfirmation(toolUse, requiresAcceptance, warning);
|
|
533
|
+
cachedButtonBlockId = await chatResultStream.writeResultBlock(confirmationResult);
|
|
534
|
+
const isExecuteBash = toolUse.name === 'executeBash';
|
|
535
|
+
if (isExecuteBash) {
|
|
536
|
+
this.#telemetryController.emitInteractWithAgenticChat('GeneratedCommand', tabId);
|
|
537
|
+
}
|
|
538
|
+
if (requiresAcceptance) {
|
|
539
|
+
await this.waitForToolApproval(toolUse, chatResultStream, cachedButtonBlockId, session);
|
|
540
|
+
}
|
|
541
|
+
if (isExecuteBash) {
|
|
542
|
+
this.#telemetryController.emitInteractWithAgenticChat('RunCommand', tabId);
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
break;
|
|
546
|
+
}
|
|
547
|
+
case 'codeSearch':
|
|
548
|
+
// no need to write tool message for code search.
|
|
549
|
+
break;
|
|
550
|
+
default:
|
|
551
|
+
this.#features.logging.warn(`Recieved unrecognized tool: ${toolUse.name}`);
|
|
552
|
+
await chatResultStream.writeResultBlock({
|
|
553
|
+
type: 'tool',
|
|
554
|
+
body: `${(0, textFormatting_1.executeToolMessage)(toolUse)}`,
|
|
555
|
+
messageId: toolUse.toolUseId,
|
|
556
|
+
});
|
|
557
|
+
break;
|
|
558
|
+
}
|
|
559
|
+
if (toolUse.name === 'fsWrite') {
|
|
560
|
+
const input = toolUse.input;
|
|
561
|
+
const document = await this.#triggerContext.getTextDocument(input.path);
|
|
562
|
+
session.toolUseLookup.set(toolUse.toolUseId, {
|
|
563
|
+
...toolUse,
|
|
564
|
+
fileChange: { before: document?.getText() },
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
// After approval, add the path to the approved paths in the session
|
|
568
|
+
const inputPath = toolUse.input?.path || toolUse.input?.cwd;
|
|
569
|
+
if (inputPath) {
|
|
570
|
+
session.addApprovedPath(inputPath);
|
|
571
|
+
}
|
|
572
|
+
const ws = this.#getWritableStream(chatResultStream, toolUse);
|
|
573
|
+
const result = await this.#features.agent.runTool(toolUse.name, toolUse.input, token, ws);
|
|
574
|
+
let toolResultContent;
|
|
575
|
+
if (typeof result === 'string') {
|
|
576
|
+
toolResultContent = { text: result };
|
|
577
|
+
}
|
|
578
|
+
else if (Array.isArray(result)) {
|
|
579
|
+
toolResultContent = { json: { items: result } };
|
|
580
|
+
}
|
|
581
|
+
else if (typeof result === 'object') {
|
|
582
|
+
toolResultContent = { json: result };
|
|
583
|
+
}
|
|
584
|
+
else
|
|
585
|
+
toolResultContent = { text: JSON.stringify(result) };
|
|
586
|
+
this.#validateToolResult(toolUse, toolResultContent);
|
|
587
|
+
results.push({
|
|
588
|
+
toolUseId: toolUse.toolUseId,
|
|
589
|
+
status: 'success',
|
|
590
|
+
content: [toolResultContent],
|
|
591
|
+
});
|
|
592
|
+
switch (toolUse.name) {
|
|
593
|
+
case 'fsRead':
|
|
594
|
+
case 'listDirectory':
|
|
595
|
+
case 'fileSearch':
|
|
596
|
+
const initialListDirResult = this.#processReadOrListOrSearch(toolUse, chatResultStream);
|
|
597
|
+
if (initialListDirResult) {
|
|
598
|
+
await chatResultStream.writeResultBlock(initialListDirResult);
|
|
599
|
+
}
|
|
600
|
+
break;
|
|
601
|
+
// no need to write tool result for listDir,fsRead,fileSearch into chat stream
|
|
602
|
+
case 'executeBash':
|
|
603
|
+
// no need to write tool result for listDir and fsRead into chat stream
|
|
604
|
+
// executeBash will stream the output instead of waiting until the end
|
|
605
|
+
break;
|
|
606
|
+
case 'codeSearch':
|
|
607
|
+
// no need to write tool result for code search.
|
|
608
|
+
break;
|
|
609
|
+
case 'fsWrite':
|
|
610
|
+
const input = toolUse.input;
|
|
611
|
+
const doc = await this.#triggerContext.getTextDocument(input.path);
|
|
612
|
+
const chatResult = await this.#getFsWriteChatResult(toolUse, doc, session);
|
|
613
|
+
const cachedToolUse = session.toolUseLookup.get(toolUse.toolUseId);
|
|
614
|
+
if (cachedToolUse) {
|
|
615
|
+
session.toolUseLookup.set(toolUse.toolUseId, {
|
|
616
|
+
...cachedToolUse,
|
|
617
|
+
chatResult,
|
|
618
|
+
fileChange: { ...cachedToolUse.fileChange, after: doc?.getText() },
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
this.#telemetryController.emitInteractWithAgenticChat('GeneratedDiff', tabId);
|
|
622
|
+
await chatResultStream.writeResultBlock(chatResult);
|
|
623
|
+
break;
|
|
624
|
+
default:
|
|
625
|
+
this.#features.logging.warn(`Processing unrecognized tool: ${toolUse.name}`);
|
|
626
|
+
await chatResultStream.writeResultBlock({
|
|
627
|
+
type: 'tool',
|
|
628
|
+
body: (0, textFormatting_1.toolResultMessage)(toolUse, result),
|
|
629
|
+
messageId: toolUse.toolUseId,
|
|
630
|
+
});
|
|
631
|
+
break;
|
|
632
|
+
}
|
|
633
|
+
this.#updateUndoAllState(toolUse, session);
|
|
634
|
+
if (toolUse.name) {
|
|
635
|
+
this.#telemetryController.emitToolUseSuggested(toolUse, session.conversationId ?? '', this.#features.runtime.serverInfo.version ?? '');
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
catch (err) {
|
|
639
|
+
if (this.isUserAction(err, token)) {
|
|
640
|
+
if (toolUse.name === 'executeBash') {
|
|
641
|
+
if (err instanceof toolShared_1.ToolApprovalException) {
|
|
642
|
+
if (cachedButtonBlockId) {
|
|
643
|
+
await chatResultStream.overwriteResultBlock(this.#getUpdateToolConfirmResult(toolUse, false), cachedButtonBlockId);
|
|
644
|
+
if (err.shouldShowMessage) {
|
|
645
|
+
await chatResultStream.writeResultBlock({
|
|
646
|
+
type: 'answer',
|
|
647
|
+
messageId: `reject-message-${toolUse.toolUseId}`,
|
|
648
|
+
body: err.message || 'Command was rejected.',
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
else {
|
|
653
|
+
this.#features.logging.warn('Failed to update tool block: no blockId is available.');
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
throw err;
|
|
657
|
+
}
|
|
658
|
+
if (err instanceof lsp_core_1.CancellationError) {
|
|
659
|
+
results.push({
|
|
660
|
+
toolUseId: toolUse.toolUseId,
|
|
661
|
+
status: codewhisperer_streaming_1.ToolResultStatus.ERROR,
|
|
662
|
+
content: [{ text: 'Command stopped by user' }],
|
|
663
|
+
});
|
|
664
|
+
continue;
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
const errMsg = err instanceof Error ? err.message : 'unknown error';
|
|
668
|
+
this.#log(`Error running tool ${toolUse.name}:`, errMsg);
|
|
669
|
+
results.push({
|
|
670
|
+
toolUseId: toolUse.toolUseId,
|
|
671
|
+
status: 'error',
|
|
672
|
+
content: [{ json: { error: err instanceof Error ? err.message : 'Unknown error' } }],
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
return results;
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* Updates the currentUndoAllId state in the session
|
|
680
|
+
*/
|
|
681
|
+
#updateUndoAllState(toolUse, session) {
|
|
682
|
+
if (toolUse.name === 'fsRead' || toolUse.name === 'listDirectory') {
|
|
683
|
+
return;
|
|
684
|
+
}
|
|
685
|
+
if (toolUse.name === 'fsWrite') {
|
|
686
|
+
if (session.currentUndoAllId === undefined) {
|
|
687
|
+
session.currentUndoAllId = toolUse.toolUseId;
|
|
688
|
+
}
|
|
689
|
+
if (session.currentUndoAllId) {
|
|
690
|
+
const prev = session.toolUseLookup.get(session.currentUndoAllId);
|
|
691
|
+
if (prev && toolUse.toolUseId) {
|
|
692
|
+
const relatedToolUses = prev.relatedToolUses || new Set();
|
|
693
|
+
relatedToolUses.add(toolUse.toolUseId);
|
|
694
|
+
session.toolUseLookup.set(session.currentUndoAllId, {
|
|
695
|
+
...prev,
|
|
696
|
+
relatedToolUses,
|
|
114
697
|
});
|
|
115
|
-
this.#telemetryController.emitStartConversationMetric(params.tabId, metric.metric);
|
|
116
698
|
}
|
|
117
699
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
700
|
+
}
|
|
701
|
+
else {
|
|
702
|
+
session.currentUndoAllId = undefined;
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
/**
|
|
706
|
+
* Shows an "Undo all changes" button if there are multiple related file changes
|
|
707
|
+
* that can be undone together.
|
|
708
|
+
*/
|
|
709
|
+
async #showUndoAllIfRequired(chatResultStream, session) {
|
|
710
|
+
if (session.currentUndoAllId === undefined) {
|
|
711
|
+
return;
|
|
712
|
+
}
|
|
713
|
+
const toUndo = session.toolUseLookup.get(session.currentUndoAllId)?.relatedToolUses;
|
|
714
|
+
if (!toUndo || toUndo.size <= 1) {
|
|
715
|
+
return;
|
|
716
|
+
}
|
|
717
|
+
await chatResultStream.writeResultBlock({
|
|
718
|
+
type: 'answer',
|
|
719
|
+
messageId: `${session.currentUndoAllId}_undoall`,
|
|
720
|
+
buttons: [
|
|
721
|
+
{
|
|
722
|
+
id: 'undo-all-changes',
|
|
723
|
+
text: 'Undo all changes',
|
|
724
|
+
icon: 'undo',
|
|
725
|
+
status: 'clear',
|
|
726
|
+
keepCardAfterClick: false,
|
|
127
727
|
},
|
|
728
|
+
],
|
|
729
|
+
});
|
|
730
|
+
session.currentUndoAllId = undefined;
|
|
731
|
+
}
|
|
732
|
+
/**
|
|
733
|
+
* Determines if error is thrown as a result of a user action (Ex. rejecting tool, stop button)
|
|
734
|
+
* @param err
|
|
735
|
+
* @returns
|
|
736
|
+
*/
|
|
737
|
+
isUserAction(err, token) {
|
|
738
|
+
return (lsp_core_1.CancellationError.isUserCancelled(err) ||
|
|
739
|
+
err instanceof toolShared_1.ToolApprovalException ||
|
|
740
|
+
(token?.isCancellationRequested ?? false));
|
|
741
|
+
}
|
|
742
|
+
#validateToolResult(toolUse, result) {
|
|
743
|
+
let maxToolResponseSize;
|
|
744
|
+
switch (toolUse.name) {
|
|
745
|
+
case 'fsRead':
|
|
746
|
+
case 'executeBash':
|
|
747
|
+
// fsRead and executeBash already have truncation logic
|
|
748
|
+
return;
|
|
749
|
+
case 'listDirectory':
|
|
750
|
+
maxToolResponseSize = 30_000;
|
|
751
|
+
break;
|
|
752
|
+
default:
|
|
753
|
+
maxToolResponseSize = 100_000;
|
|
754
|
+
break;
|
|
755
|
+
}
|
|
756
|
+
if ((result.text && result.text.length > maxToolResponseSize) ||
|
|
757
|
+
(result.json && JSON.stringify(result.json).length > maxToolResponseSize)) {
|
|
758
|
+
throw Error(`${toolUse.name} output exceeds maximum character limit of ${maxToolResponseSize}`);
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
#getWritableStream(chatResultStream, toolUse) {
|
|
762
|
+
if (toolUse.name !== 'executeBash') {
|
|
763
|
+
return;
|
|
764
|
+
}
|
|
765
|
+
const toolMsgId = toolUse.toolUseId;
|
|
766
|
+
const chatMsgId = chatResultStream.getResult().messageId;
|
|
767
|
+
let headerEmitted = false;
|
|
768
|
+
const initialHeader = {
|
|
769
|
+
body: 'shell',
|
|
770
|
+
buttons: [{ id: 'stop-shell-command', text: 'Stop', icon: 'stop' }],
|
|
771
|
+
};
|
|
772
|
+
const completedHeader = {
|
|
773
|
+
body: 'shell',
|
|
774
|
+
status: { status: 'success', icon: 'ok', text: 'Completed' },
|
|
775
|
+
buttons: [],
|
|
776
|
+
};
|
|
777
|
+
return new WritableStream({
|
|
778
|
+
write: async (chunk) => {
|
|
779
|
+
if (this.#stoppedToolUses.has(toolMsgId))
|
|
780
|
+
return;
|
|
781
|
+
await chatResultStream.writeResultBlock({
|
|
782
|
+
type: 'tool',
|
|
783
|
+
messageId: toolMsgId,
|
|
784
|
+
body: chunk,
|
|
785
|
+
header: headerEmitted ? undefined : initialHeader,
|
|
786
|
+
});
|
|
787
|
+
headerEmitted = true;
|
|
788
|
+
},
|
|
789
|
+
close: async () => {
|
|
790
|
+
if (this.#stoppedToolUses.has(toolMsgId))
|
|
791
|
+
return;
|
|
792
|
+
await chatResultStream.writeResultBlock({
|
|
793
|
+
type: 'tool',
|
|
794
|
+
messageId: toolMsgId,
|
|
795
|
+
body: '```',
|
|
796
|
+
header: completedHeader,
|
|
797
|
+
});
|
|
798
|
+
await chatResultStream.writeResultBlock({
|
|
799
|
+
type: 'answer',
|
|
800
|
+
messageId: chatMsgId,
|
|
801
|
+
body: '',
|
|
802
|
+
header: undefined,
|
|
803
|
+
});
|
|
804
|
+
this.#stoppedToolUses.add(toolMsgId);
|
|
805
|
+
},
|
|
806
|
+
});
|
|
807
|
+
}
|
|
808
|
+
/**
|
|
809
|
+
* Creates an updated ChatResult for tool confirmation based on tool type
|
|
810
|
+
* @param toolUse The tool use object
|
|
811
|
+
* @param isAccept Whether the tool was accepted or rejected
|
|
812
|
+
* @param toolType Optional tool type for specialized handling
|
|
813
|
+
* @returns ChatResult with appropriate confirmation UI
|
|
814
|
+
*/
|
|
815
|
+
#getUpdateToolConfirmResult(toolUse, isAccept, toolType) {
|
|
816
|
+
const toolName = toolType || toolUse.name;
|
|
817
|
+
// Handle bash commands with special formatting
|
|
818
|
+
if (toolName === 'executeBash') {
|
|
819
|
+
return {
|
|
820
|
+
messageId: toolUse.toolUseId,
|
|
821
|
+
type: 'tool',
|
|
822
|
+
body: '```shell\n' + toolUse.input.command + '\n',
|
|
823
|
+
header: {
|
|
824
|
+
body: 'shell',
|
|
825
|
+
...(isAccept
|
|
826
|
+
? {}
|
|
827
|
+
: {
|
|
828
|
+
status: {
|
|
829
|
+
status: 'error',
|
|
830
|
+
icon: 'cancel',
|
|
831
|
+
text: 'Rejected',
|
|
832
|
+
},
|
|
833
|
+
}),
|
|
834
|
+
buttons: isAccept ? [{ id: 'stop-shell-command', text: 'Stop', icon: 'stop' }] : [],
|
|
835
|
+
},
|
|
836
|
+
};
|
|
837
|
+
}
|
|
838
|
+
// For file operations and other tools, create appropriate confirmation UI
|
|
839
|
+
let header;
|
|
840
|
+
let body;
|
|
841
|
+
switch (toolName) {
|
|
842
|
+
case 'fsWrite':
|
|
843
|
+
const writeFilePath = toolUse.input.path;
|
|
844
|
+
header = {
|
|
845
|
+
body: 'File Write',
|
|
846
|
+
status: {
|
|
847
|
+
status: isAccept ? 'success' : 'error',
|
|
848
|
+
icon: isAccept ? 'ok' : 'cancel',
|
|
849
|
+
text: isAccept ? 'Allowed' : 'Rejected',
|
|
850
|
+
},
|
|
851
|
+
};
|
|
852
|
+
body = isAccept
|
|
853
|
+
? `File modification allowed: \`${writeFilePath}\``
|
|
854
|
+
: `File modification rejected: \`${writeFilePath}\``;
|
|
855
|
+
break;
|
|
856
|
+
case 'fsRead':
|
|
857
|
+
case 'listDirectory':
|
|
858
|
+
// Common handling for read operations
|
|
859
|
+
const path = toolUse.input.path;
|
|
860
|
+
const isDirectory = toolName === 'listDirectory';
|
|
861
|
+
header = {
|
|
862
|
+
body: isDirectory ? 'Directory Listing' : 'File Read',
|
|
863
|
+
status: {
|
|
864
|
+
status: isAccept ? 'success' : 'error',
|
|
865
|
+
icon: isAccept ? 'ok' : 'cancel',
|
|
866
|
+
text: isAccept ? 'Allowed' : 'Rejected',
|
|
867
|
+
},
|
|
868
|
+
};
|
|
869
|
+
body = isAccept
|
|
870
|
+
? `${isDirectory ? 'Directory listing' : 'File read'} allowed: \`${path}\``
|
|
871
|
+
: `${isDirectory ? 'Directory listing' : 'File read'} rejected: \`${path}\``;
|
|
872
|
+
break;
|
|
873
|
+
case 'fileSearch':
|
|
874
|
+
const searchPath = toolUse.input.path;
|
|
875
|
+
header = {
|
|
876
|
+
body: 'File Search',
|
|
877
|
+
status: {
|
|
878
|
+
status: isAccept ? 'success' : 'error',
|
|
879
|
+
icon: isAccept ? 'ok' : 'cancel',
|
|
880
|
+
text: isAccept ? 'Allowed' : 'Rejected',
|
|
881
|
+
},
|
|
882
|
+
};
|
|
883
|
+
body = isAccept ? `File search allowed: \`${searchPath}\`` : `File search rejected: \`${searchPath}\``;
|
|
884
|
+
break;
|
|
885
|
+
default:
|
|
886
|
+
// Generic handler for other tool types
|
|
887
|
+
header = {
|
|
888
|
+
body: toolUse.name || 'Tool',
|
|
889
|
+
status: {
|
|
890
|
+
status: isAccept ? 'success' : 'error',
|
|
891
|
+
icon: isAccept ? 'ok' : 'cancel',
|
|
892
|
+
text: isAccept ? 'Allowed' : 'Rejected',
|
|
893
|
+
},
|
|
894
|
+
};
|
|
895
|
+
body = isAccept ? `Tool execution allowed: ${toolUse.name}` : `Tool execution rejected: ${toolUse.name}`;
|
|
896
|
+
break;
|
|
897
|
+
}
|
|
898
|
+
return {
|
|
899
|
+
messageId: this.#getMessageIdForToolUse(toolType, toolUse),
|
|
900
|
+
type: 'tool',
|
|
901
|
+
body,
|
|
902
|
+
header,
|
|
903
|
+
};
|
|
904
|
+
}
|
|
905
|
+
async #renderStoppedShellCommand(tabId, messageId) {
|
|
906
|
+
const session = this.#chatSessionManagementService.getSession(tabId).data;
|
|
907
|
+
const toolUse = session?.toolUseLookup.get(messageId);
|
|
908
|
+
const command = toolUse.input.command;
|
|
909
|
+
await this.#features.chat.sendChatUpdate({
|
|
910
|
+
tabId,
|
|
911
|
+
state: { inProgress: false },
|
|
912
|
+
data: {
|
|
913
|
+
messages: [
|
|
914
|
+
{
|
|
915
|
+
messageId,
|
|
916
|
+
type: 'tool',
|
|
917
|
+
body: `\`\`\`shell\n${command}\n\`\`\``,
|
|
918
|
+
header: {
|
|
919
|
+
body: 'shell',
|
|
920
|
+
status: {
|
|
921
|
+
status: 'error',
|
|
922
|
+
icon: 'stop',
|
|
923
|
+
text: 'Stopped',
|
|
924
|
+
},
|
|
925
|
+
buttons: [],
|
|
926
|
+
},
|
|
927
|
+
},
|
|
928
|
+
],
|
|
929
|
+
},
|
|
930
|
+
});
|
|
931
|
+
}
|
|
932
|
+
#processToolConfirmation(toolUse, requiresAcceptance, warning, toolType) {
|
|
933
|
+
let buttons = [];
|
|
934
|
+
let header;
|
|
935
|
+
let body;
|
|
936
|
+
switch (toolType || toolUse.name) {
|
|
937
|
+
case 'executeBash':
|
|
938
|
+
buttons = requiresAcceptance
|
|
939
|
+
? [
|
|
940
|
+
{
|
|
941
|
+
id: 'run-shell-command',
|
|
942
|
+
text: 'Run',
|
|
943
|
+
icon: 'play',
|
|
944
|
+
},
|
|
945
|
+
{
|
|
946
|
+
id: 'reject-shell-command',
|
|
947
|
+
status: 'dimmed-clear',
|
|
948
|
+
text: 'Reject',
|
|
949
|
+
icon: 'cancel',
|
|
950
|
+
},
|
|
951
|
+
]
|
|
952
|
+
: [];
|
|
953
|
+
header = {
|
|
954
|
+
status: requiresAcceptance
|
|
955
|
+
? {
|
|
956
|
+
icon: 'warning',
|
|
957
|
+
status: 'warning',
|
|
958
|
+
position: 'left',
|
|
959
|
+
// TODO: Add `description` if necessary to show a tooltip
|
|
960
|
+
}
|
|
961
|
+
: {},
|
|
962
|
+
body: 'shell',
|
|
963
|
+
buttons,
|
|
964
|
+
};
|
|
965
|
+
const commandString = toolUse.input.command;
|
|
966
|
+
body = '```shell\n' + commandString;
|
|
967
|
+
break;
|
|
968
|
+
case 'fsWrite':
|
|
969
|
+
buttons = [
|
|
970
|
+
{
|
|
971
|
+
id: 'allow-tools', // Reusing the same ID for simplicity, could be changed to 'allow-write-tools'
|
|
972
|
+
text: 'Allow',
|
|
973
|
+
icon: 'ok',
|
|
974
|
+
status: 'clear',
|
|
975
|
+
},
|
|
976
|
+
];
|
|
977
|
+
header = {
|
|
978
|
+
icon: 'warning',
|
|
979
|
+
iconForegroundStatus: 'warning',
|
|
980
|
+
body: '#### Allow file modification outside of your workspace',
|
|
981
|
+
buttons,
|
|
982
|
+
};
|
|
983
|
+
const writeFilePath = toolUse.input.path;
|
|
984
|
+
body = `I need permission to modify files in your workspace.\n\`${writeFilePath}\``;
|
|
985
|
+
break;
|
|
986
|
+
case 'fsRead':
|
|
987
|
+
case 'listDirectory':
|
|
988
|
+
default:
|
|
989
|
+
buttons = [
|
|
990
|
+
{
|
|
991
|
+
id: 'allow-tools',
|
|
992
|
+
text: 'Allow',
|
|
993
|
+
icon: 'ok',
|
|
994
|
+
status: 'clear',
|
|
995
|
+
},
|
|
996
|
+
];
|
|
997
|
+
header = {
|
|
998
|
+
icon: 'warning',
|
|
999
|
+
iconForegroundStatus: 'warning',
|
|
1000
|
+
body: '#### Allow read-only tools outside your workspace',
|
|
1001
|
+
buttons,
|
|
1002
|
+
};
|
|
1003
|
+
// ⚠️ Warning: This accesses files outside the workspace
|
|
1004
|
+
const readFilePath = toolUse.input.path;
|
|
1005
|
+
body = `I need permission to read files and list directories outside the workspace.\n\`${readFilePath}\``;
|
|
1006
|
+
break;
|
|
1007
|
+
}
|
|
1008
|
+
return {
|
|
1009
|
+
type: 'tool',
|
|
1010
|
+
messageId: this.#getMessageIdForToolUse(toolType, toolUse),
|
|
1011
|
+
header,
|
|
1012
|
+
body: warning ? warning + (toolType === 'executeBash' ? '' : '\n\n') + body : body,
|
|
1013
|
+
};
|
|
1014
|
+
}
|
|
1015
|
+
async #getFsWriteChatResult(toolUse, doc, session) {
|
|
1016
|
+
const input = toolUse.input;
|
|
1017
|
+
const oldContent = session.toolUseLookup.get(toolUse.toolUseId)?.fileChange?.before ?? '';
|
|
1018
|
+
// Get just the filename instead of the full path
|
|
1019
|
+
const fileName = path.basename(input.path);
|
|
1020
|
+
const diffChanges = (0, diff_1.diffLines)(oldContent, doc?.getText() ?? '');
|
|
1021
|
+
const changes = diffChanges.reduce((acc, { count = 0, added, removed }) => {
|
|
1022
|
+
if (added) {
|
|
1023
|
+
acc.added += count;
|
|
1024
|
+
}
|
|
1025
|
+
else if (removed) {
|
|
1026
|
+
acc.deleted += count;
|
|
1027
|
+
}
|
|
1028
|
+
return acc;
|
|
1029
|
+
}, { added: 0, deleted: 0 });
|
|
1030
|
+
return {
|
|
1031
|
+
type: 'tool',
|
|
1032
|
+
messageId: toolUse.toolUseId,
|
|
1033
|
+
header: {
|
|
1034
|
+
fileList: {
|
|
1035
|
+
filePaths: [fileName],
|
|
1036
|
+
details: {
|
|
1037
|
+
[fileName]: {
|
|
1038
|
+
changes,
|
|
1039
|
+
description: input.path,
|
|
1040
|
+
},
|
|
1041
|
+
},
|
|
1042
|
+
},
|
|
1043
|
+
buttons: [{ id: 'undo-changes', text: 'Undo', icon: 'undo' }],
|
|
1044
|
+
},
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
#processReadOrListOrSearch(toolUse, chatResultStream) {
|
|
1048
|
+
let messageIdToUpdate = toolUse.toolUseId;
|
|
1049
|
+
const currentId = chatResultStream.getMessageIdToUpdateForTool(toolUse.name);
|
|
1050
|
+
if (currentId) {
|
|
1051
|
+
messageIdToUpdate = currentId;
|
|
1052
|
+
}
|
|
1053
|
+
else {
|
|
1054
|
+
chatResultStream.setMessageIdToUpdateForTool(toolUse.name, messageIdToUpdate);
|
|
1055
|
+
}
|
|
1056
|
+
const currentPath = toolUse.input?.path;
|
|
1057
|
+
if (!currentPath)
|
|
1058
|
+
return;
|
|
1059
|
+
const existingPaths = chatResultStream.getMessageOperation(messageIdToUpdate)?.filePaths || [];
|
|
1060
|
+
// Check if path already exists in the list
|
|
1061
|
+
const isPathAlreadyProcessed = existingPaths.some(path => path.relativeFilePath === currentPath);
|
|
1062
|
+
if (!isPathAlreadyProcessed) {
|
|
1063
|
+
const currentFileDetail = {
|
|
1064
|
+
relativeFilePath: currentPath,
|
|
1065
|
+
lineRanges: [{ first: -1, second: -1 }],
|
|
1066
|
+
};
|
|
1067
|
+
chatResultStream.addMessageOperation(messageIdToUpdate, toolUse.name, [
|
|
1068
|
+
...existingPaths,
|
|
1069
|
+
currentFileDetail,
|
|
1070
|
+
]);
|
|
1071
|
+
}
|
|
1072
|
+
let title;
|
|
1073
|
+
const itemCount = chatResultStream.getMessageOperation(messageIdToUpdate)?.filePaths.length;
|
|
1074
|
+
const filePathsPushed = chatResultStream.getMessageOperation(messageIdToUpdate)?.filePaths ?? [];
|
|
1075
|
+
if (!itemCount) {
|
|
1076
|
+
title = 'Gathering context';
|
|
1077
|
+
}
|
|
1078
|
+
else {
|
|
1079
|
+
title =
|
|
1080
|
+
toolUse.name === 'fsRead'
|
|
1081
|
+
? `${itemCount} file${itemCount > 1 ? 's' : ''} read`
|
|
1082
|
+
: toolUse.name === 'fileSearch'
|
|
1083
|
+
? `${itemCount} ${itemCount === 1 ? 'directory' : 'directories'} searched`
|
|
1084
|
+
: `${itemCount} ${itemCount === 1 ? 'directory' : 'directories'} listed`;
|
|
1085
|
+
}
|
|
1086
|
+
const details = {};
|
|
1087
|
+
for (const item of filePathsPushed) {
|
|
1088
|
+
details[item.relativeFilePath] = {
|
|
1089
|
+
lineRanges: item.lineRanges,
|
|
1090
|
+
description: item.relativeFilePath,
|
|
1091
|
+
};
|
|
1092
|
+
}
|
|
1093
|
+
const fileList = {
|
|
1094
|
+
rootFolderTitle: title,
|
|
1095
|
+
filePaths: filePathsPushed.map(item => item.relativeFilePath),
|
|
1096
|
+
details,
|
|
1097
|
+
};
|
|
1098
|
+
return {
|
|
1099
|
+
type: 'tool',
|
|
1100
|
+
fileList,
|
|
1101
|
+
messageId: messageIdToUpdate,
|
|
1102
|
+
body: '',
|
|
1103
|
+
};
|
|
1104
|
+
}
|
|
1105
|
+
/**
|
|
1106
|
+
* Updates the request input with tool results for the next iteration
|
|
1107
|
+
*/
|
|
1108
|
+
#updateRequestInputWithToolResults(requestInput, toolResults, content) {
|
|
1109
|
+
// Create a deep copy of the request input
|
|
1110
|
+
const updatedRequestInput = JSON.parse(JSON.stringify(requestInput));
|
|
1111
|
+
// Add tool results to the request
|
|
1112
|
+
updatedRequestInput.conversationState.currentMessage.userInputMessage.userInputMessageContext.toolResults =
|
|
1113
|
+
[];
|
|
1114
|
+
updatedRequestInput.conversationState.currentMessage.userInputMessage.content = content;
|
|
1115
|
+
for (const toolResult of toolResults) {
|
|
1116
|
+
this.#debug(`ToolResult: ${JSON.stringify(toolResult)}`);
|
|
1117
|
+
updatedRequestInput.conversationState.currentMessage.userInputMessage.userInputMessageContext.toolResults.push({
|
|
1118
|
+
...toolResult,
|
|
128
1119
|
});
|
|
129
|
-
return result.success
|
|
130
|
-
? result.data.chatResult
|
|
131
|
-
: new server_interface_1.ResponseError(server_interface_1.LSPErrorCodes.RequestFailed, result.error);
|
|
132
1120
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
1121
|
+
return updatedRequestInput;
|
|
1122
|
+
}
|
|
1123
|
+
/**
|
|
1124
|
+
* Handles the final result after the agent loop completes
|
|
1125
|
+
*/
|
|
1126
|
+
async #handleFinalResult(result, session, params, metric, triggerContext, isNewConversation, chatResultStream) {
|
|
1127
|
+
if (!result.success) {
|
|
1128
|
+
throw new errors_2.AgenticChatError(result.error, 'FailedResult');
|
|
1129
|
+
}
|
|
1130
|
+
const conversationId = session.conversationId;
|
|
1131
|
+
this.#debug('Final session conversation id:', conversationId || '');
|
|
1132
|
+
if (conversationId) {
|
|
1133
|
+
this.#telemetryController.setConversationId(params.tabId, conversationId);
|
|
1134
|
+
if (isNewConversation) {
|
|
1135
|
+
this.#telemetryController.updateTriggerInfo(params.tabId, {
|
|
1136
|
+
startTrigger: {
|
|
1137
|
+
hasUserSnippet: metric.metric.cwsprChatHasCodeSnippet ?? false,
|
|
1138
|
+
triggerType: triggerContext.triggerType,
|
|
1139
|
+
},
|
|
1140
|
+
});
|
|
1141
|
+
this.#telemetryController.emitStartConversationMetric(params.tabId, metric.metric);
|
|
1142
|
+
}
|
|
136
1143
|
}
|
|
1144
|
+
metric.setDimension('codewhispererCustomizationArn', this.#customizationArn);
|
|
1145
|
+
metric.setDimension('languageServerVersion', this.#features.runtime.serverInfo.version);
|
|
1146
|
+
const profileArn = AmazonQTokenServiceManager_1.AmazonQTokenServiceManager.getInstance().getActiveProfileArn();
|
|
1147
|
+
if (profileArn) {
|
|
1148
|
+
this.#telemetryService.updateProfileArn(profileArn);
|
|
1149
|
+
}
|
|
1150
|
+
if (triggerContext.contextInfo) {
|
|
1151
|
+
metric.mergeWith({
|
|
1152
|
+
cwsprChatHasContextList: triggerContext.documentReference?.filePaths?.length ? true : false,
|
|
1153
|
+
cwsprChatFolderContextCount: triggerContext.contextInfo.contextCount.folderContextCount,
|
|
1154
|
+
cwsprChatFileContextCount: triggerContext.contextInfo.contextCount.fileContextCount,
|
|
1155
|
+
cwsprChatRuleContextCount: triggerContext.contextInfo.contextCount.ruleContextCount,
|
|
1156
|
+
cwsprChatPromptContextCount: triggerContext.contextInfo.contextCount.promptContextCount,
|
|
1157
|
+
cwsprChatFileContextLength: triggerContext.contextInfo.contextLength.fileContextLength,
|
|
1158
|
+
cwsprChatRuleContextLength: triggerContext.contextInfo.contextLength.ruleContextLength,
|
|
1159
|
+
cwsprChatPromptContextLength: triggerContext.contextInfo.contextLength.promptContextLength,
|
|
1160
|
+
cwsprChatCodeContextCount: triggerContext.contextInfo.contextCount.codeContextCount,
|
|
1161
|
+
cwsprChatCodeContextLength: triggerContext.contextInfo.contextLength.codeContextLength,
|
|
1162
|
+
cwsprChatFocusFileContextLength: triggerContext.text?.length,
|
|
1163
|
+
});
|
|
1164
|
+
}
|
|
1165
|
+
await this.#telemetryController.emitAddMessageMetric(params.tabId, metric.metric);
|
|
1166
|
+
this.#telemetryController.updateTriggerInfo(params.tabId, {
|
|
1167
|
+
lastMessageTrigger: {
|
|
1168
|
+
...triggerContext,
|
|
1169
|
+
messageId: result.data?.chatResult.messageId,
|
|
1170
|
+
followUpActions: new Set(result.data?.chatResult.followUp?.options
|
|
1171
|
+
?.map(option => option.prompt ?? '')
|
|
1172
|
+
.filter(prompt => prompt.length > 0)),
|
|
1173
|
+
},
|
|
1174
|
+
});
|
|
1175
|
+
return chatResultStream.getResult();
|
|
1176
|
+
}
|
|
1177
|
+
/**
|
|
1178
|
+
* Handles errors that occur during the request
|
|
1179
|
+
*/
|
|
1180
|
+
#handleRequestError(err, errorMessageId, tabId, metric) {
|
|
1181
|
+
let errorMessage;
|
|
1182
|
+
let requestID;
|
|
1183
|
+
if ((0, utils_2.isAwsError)(err) || ((0, utils_2.isObject)(err) && typeof (0, utils_2.getHttpStatusCode)(err) === 'number')) {
|
|
1184
|
+
if (err instanceof codewhisperer_streaming_1.CodeWhispererStreamingServiceException) {
|
|
1185
|
+
errorMessage = err.message;
|
|
1186
|
+
requestID = err.$metadata.requestId;
|
|
1187
|
+
}
|
|
1188
|
+
else if (err?.cause?.message) {
|
|
1189
|
+
errorMessage = err?.cause?.message;
|
|
1190
|
+
requestID = err.cause?.$metadata.requestId;
|
|
1191
|
+
}
|
|
1192
|
+
else if (err instanceof Error || err?.message) {
|
|
1193
|
+
errorMessage = err.message;
|
|
1194
|
+
}
|
|
1195
|
+
metric.setDimension('cwsprChatResponseCode', (0, utils_2.getHttpStatusCode)(err) ?? 0);
|
|
1196
|
+
metric.setDimension('languageServerVersion', this.#features.runtime.serverInfo.version);
|
|
1197
|
+
this.#telemetryController.emitMessageResponseError(tabId, metric.metric, requestID, errorMessage);
|
|
1198
|
+
}
|
|
1199
|
+
let authFollowType = undefined;
|
|
1200
|
+
// first check if there is an AmazonQ related auth follow up
|
|
1201
|
+
if (err.cause instanceof errors_1.AmazonQError) {
|
|
1202
|
+
authFollowType = (0, utils_1.getAuthFollowUpType)(err.cause);
|
|
1203
|
+
}
|
|
1204
|
+
// if not check full error for auth follow up
|
|
1205
|
+
if (!authFollowType) {
|
|
1206
|
+
authFollowType = (0, utils_1.getAuthFollowUpType)(err);
|
|
1207
|
+
}
|
|
1208
|
+
if (authFollowType) {
|
|
1209
|
+
this.#log(`Q auth error: ${(0, utils_2.getErrorMessage)(err)}`);
|
|
1210
|
+
return (0, utils_1.createAuthFollowUpResult)(authFollowType);
|
|
1211
|
+
}
|
|
1212
|
+
if (errors_2.customerFacingErrorCodes.includes(err.code)) {
|
|
1213
|
+
this.#features.logging.error(`${lsp_core_2.loggingUtils.formatErr(err)}`);
|
|
1214
|
+
return new server_interface_1.ResponseError(server_interface_1.LSPErrorCodes.RequestFailed, err.message, {
|
|
1215
|
+
type: 'answer',
|
|
1216
|
+
body: err.message,
|
|
1217
|
+
messageId: errorMessageId,
|
|
1218
|
+
buttons: [],
|
|
1219
|
+
});
|
|
1220
|
+
}
|
|
1221
|
+
this.#features.logging.error(`Unknown Error: ${lsp_core_2.loggingUtils.formatErr(err)}`);
|
|
1222
|
+
return new server_interface_1.ResponseError(server_interface_1.LSPErrorCodes.RequestFailed, err.message, {
|
|
1223
|
+
type: 'answer',
|
|
1224
|
+
body: requestID ? constants_2.genericErrorMsg + `\n\nRequest ID: ${requestID}` : constants_2.genericErrorMsg,
|
|
1225
|
+
messageId: errorMessageId,
|
|
1226
|
+
buttons: [],
|
|
1227
|
+
});
|
|
137
1228
|
}
|
|
138
1229
|
async onInlineChatPrompt(params, token) {
|
|
139
1230
|
// TODO: This metric needs to be removed later, just added for now to be able to create a ChatEventParser object
|
|
@@ -144,12 +1235,11 @@ class AgenticChatController {
|
|
|
144
1235
|
let response;
|
|
145
1236
|
let requestInput;
|
|
146
1237
|
try {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
if (!this.#amazonQServiceManager) {
|
|
1238
|
+
requestInput = await this.#triggerContext.getChatParamsFromTrigger(params, triggerContext, codewhisperer_streaming_1.ChatTriggerType.INLINE_CHAT, this.#customizationArn);
|
|
1239
|
+
if (!this.#serviceManager) {
|
|
150
1240
|
throw new Error('amazonQServiceManager is not initialized');
|
|
151
1241
|
}
|
|
152
|
-
const client = this.#
|
|
1242
|
+
const client = this.#serviceManager.getStreamingClient();
|
|
153
1243
|
response = await client.sendMessage(requestInput);
|
|
154
1244
|
this.#log('Response for inline chat', JSON.stringify(response.$metadata), JSON.stringify(response));
|
|
155
1245
|
}
|
|
@@ -158,7 +1248,7 @@ class AgenticChatController {
|
|
|
158
1248
|
this.#log(`Q Inline Chat SSO Connection error: ${(0, utils_2.getErrorMessage)(err)}`);
|
|
159
1249
|
return new server_interface_1.ResponseError(server_interface_1.LSPErrorCodes.RequestFailed, err.message);
|
|
160
1250
|
}
|
|
161
|
-
this.#log(`Q api request error ${err instanceof Error ? err
|
|
1251
|
+
this.#log(`Q api request error ${err instanceof Error ? JSON.stringify(err) : 'unknown'}`);
|
|
162
1252
|
return new server_interface_1.ResponseError(server_interface_1.LSPErrorCodes.RequestFailed, err instanceof Error ? err.message : 'Unknown request error');
|
|
163
1253
|
}
|
|
164
1254
|
try {
|
|
@@ -175,6 +1265,7 @@ class AgenticChatController {
|
|
|
175
1265
|
return new server_interface_1.ResponseError(server_interface_1.LSPErrorCodes.RequestFailed, err instanceof Error ? err.message : 'Unknown error occurred during inline chat response stream');
|
|
176
1266
|
}
|
|
177
1267
|
}
|
|
1268
|
+
async onInlineChatResult(handler) { }
|
|
178
1269
|
async onCodeInsertToCursorPosition(params) {
|
|
179
1270
|
// Implementation based on https://github.com/aws/aws-toolkit-vscode/blob/1814cc84228d4bf20270574c5980b91b227f31cf/packages/core/src/amazonq/commons/controllers/contentController.ts#L38
|
|
180
1271
|
if (!params.textDocument || !params.cursorPosition || !params.code) {
|
|
@@ -230,8 +1321,8 @@ class AgenticChatController {
|
|
|
230
1321
|
const workspaceEdit = {
|
|
231
1322
|
edit: {
|
|
232
1323
|
documentChanges: [
|
|
233
|
-
|
|
234
|
-
|
|
1324
|
+
protocol_2.TextDocumentEdit.create({ uri: params.textDocument.uri, version: 0 }, [
|
|
1325
|
+
protocol_2.TextEdit.insert(cursorPosition, textWithIndent),
|
|
235
1326
|
]),
|
|
236
1327
|
],
|
|
237
1328
|
},
|
|
@@ -250,10 +1341,44 @@ class AgenticChatController {
|
|
|
250
1341
|
const { success } = this.#chatSessionManagementService.deleteSession(params.tabId);
|
|
251
1342
|
return success;
|
|
252
1343
|
}
|
|
1344
|
+
async onFileClicked(params) {
|
|
1345
|
+
const session = this.#chatSessionManagementService.getSession(params.tabId);
|
|
1346
|
+
const toolUseId = params.messageId;
|
|
1347
|
+
const toolUse = toolUseId ? session.data?.toolUseLookup.get(toolUseId) : undefined;
|
|
1348
|
+
if (toolUse?.name === 'fsWrite') {
|
|
1349
|
+
const input = toolUse.input;
|
|
1350
|
+
this.#features.lsp.workspace.openFileDiff({
|
|
1351
|
+
originalFileUri: input.path,
|
|
1352
|
+
originalFileContent: toolUse.fileChange?.before,
|
|
1353
|
+
isDeleted: false,
|
|
1354
|
+
fileContent: toolUse.fileChange?.after,
|
|
1355
|
+
});
|
|
1356
|
+
}
|
|
1357
|
+
else if (toolUse?.name === 'fsRead') {
|
|
1358
|
+
await this.#features.lsp.window.showDocument({ uri: vscode_uri_1.URI.file(params.filePath).toString() });
|
|
1359
|
+
}
|
|
1360
|
+
else {
|
|
1361
|
+
const absolutePath = params.fullPath ?? (await this.#resolveAbsolutePath(params.filePath));
|
|
1362
|
+
if (absolutePath) {
|
|
1363
|
+
await this.#features.lsp.window.showDocument({ uri: vscode_uri_1.URI.file(absolutePath).toString() });
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
253
1367
|
onFollowUpClicked() { }
|
|
254
1368
|
onInfoLinkClick() { }
|
|
255
1369
|
onLinkClick() { }
|
|
256
|
-
onReady() {
|
|
1370
|
+
async onReady() {
|
|
1371
|
+
await this.#tabBarController.loadChats();
|
|
1372
|
+
try {
|
|
1373
|
+
const localProjectContextController = await localProjectContextController_1.LocalProjectContextController.getInstance();
|
|
1374
|
+
const contextItems = await localProjectContextController.getContextCommandItems();
|
|
1375
|
+
await this.#contextCommandsProvider.processContextCommandUpdate(contextItems);
|
|
1376
|
+
void this.#contextCommandsProvider.maybeUpdateCodeSymbols();
|
|
1377
|
+
}
|
|
1378
|
+
catch (error) {
|
|
1379
|
+
this.#log('Error initializing context commands: ' + error);
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
257
1382
|
onSendFeedback({ tabId, feedbackPayload }) {
|
|
258
1383
|
this.#features.telemetry.emitMetric({
|
|
259
1384
|
name: 'amazonq_sendFeedback',
|
|
@@ -294,6 +1419,7 @@ class AgenticChatController {
|
|
|
294
1419
|
});
|
|
295
1420
|
this.#telemetryController.activeTabId = undefined;
|
|
296
1421
|
}
|
|
1422
|
+
this.#chatHistoryDb.updateTabOpenState(params.tabId, false);
|
|
297
1423
|
this.#chatSessionManagementService.deleteSession(params.tabId);
|
|
298
1424
|
this.#telemetryController.removeConversation(params.tabId);
|
|
299
1425
|
}
|
|
@@ -308,6 +1434,7 @@ class AgenticChatController {
|
|
|
308
1434
|
},
|
|
309
1435
|
});
|
|
310
1436
|
this.#telemetryController.removeConversation(params.tabId);
|
|
1437
|
+
this.#chatHistoryDb.clearTab(params.tabId);
|
|
311
1438
|
sessionResult.data?.clear();
|
|
312
1439
|
return {};
|
|
313
1440
|
}
|
|
@@ -326,10 +1453,33 @@ class AgenticChatController {
|
|
|
326
1453
|
return {};
|
|
327
1454
|
}
|
|
328
1455
|
}
|
|
1456
|
+
async onTabBarAction(params) {
|
|
1457
|
+
return this.#tabBarController.onTabBarAction(params);
|
|
1458
|
+
}
|
|
329
1459
|
async #getInlineChatTriggerContext(params) {
|
|
330
1460
|
let triggerContext = await this.#triggerContext.getNewTriggerContext(params);
|
|
331
1461
|
return triggerContext;
|
|
332
1462
|
}
|
|
1463
|
+
async #resolveAbsolutePath(relativePath) {
|
|
1464
|
+
try {
|
|
1465
|
+
const workspaceFolders = lsp_core_1.workspaceUtils.getWorkspaceFolderPaths(this.#features.lsp);
|
|
1466
|
+
for (const workspaceRoot of workspaceFolders) {
|
|
1467
|
+
const candidatePath = path.join(workspaceRoot, relativePath);
|
|
1468
|
+
if (await this.#features.workspace.fs.exists(candidatePath)) {
|
|
1469
|
+
return candidatePath;
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
// handle prompt file outside of workspace
|
|
1473
|
+
if (relativePath.endsWith(contextUtils_1.promptFileExtension)) {
|
|
1474
|
+
return path.join((0, contextUtils_1.getUserPromptsDirectory)(), relativePath);
|
|
1475
|
+
}
|
|
1476
|
+
this.#features.logging.error(`File not found: ${relativePath}`);
|
|
1477
|
+
}
|
|
1478
|
+
catch (e) {
|
|
1479
|
+
this.#features.logging.error(`Error resolving absolute path: ${e.message}`);
|
|
1480
|
+
}
|
|
1481
|
+
return undefined;
|
|
1482
|
+
}
|
|
333
1483
|
async #getTriggerContext(params, metric) {
|
|
334
1484
|
const lastMessageTrigger = this.#telemetryController.getLastMessageTrigger(params.tabId);
|
|
335
1485
|
let triggerContext;
|
|
@@ -356,19 +1506,64 @@ class AgenticChatController {
|
|
|
356
1506
|
});
|
|
357
1507
|
return triggerContext;
|
|
358
1508
|
}
|
|
359
|
-
async #
|
|
1509
|
+
async #invalidateAllShellCommands(tabId, session) {
|
|
1510
|
+
for (const [toolUseId, toolUse] of session.toolUseLookup.entries()) {
|
|
1511
|
+
if (toolUse.name !== 'executeBash' || this.#stoppedToolUses.has(toolUseId))
|
|
1512
|
+
continue;
|
|
1513
|
+
const params = toolUse.input;
|
|
1514
|
+
const command = params.command;
|
|
1515
|
+
await this.#features.chat.sendChatUpdate({
|
|
1516
|
+
tabId,
|
|
1517
|
+
state: { inProgress: false },
|
|
1518
|
+
data: {
|
|
1519
|
+
messages: [
|
|
1520
|
+
{
|
|
1521
|
+
messageId: toolUseId,
|
|
1522
|
+
type: 'tool',
|
|
1523
|
+
body: `\`\`\`shell\n${command}\n\`\`\``,
|
|
1524
|
+
header: {
|
|
1525
|
+
body: 'shell',
|
|
1526
|
+
status: { status: 'info', icon: 'info', text: 'Ignored' },
|
|
1527
|
+
buttons: [],
|
|
1528
|
+
},
|
|
1529
|
+
},
|
|
1530
|
+
],
|
|
1531
|
+
},
|
|
1532
|
+
});
|
|
1533
|
+
this.#stoppedToolUses.add(toolUseId);
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
async #processGenerateAssistantResponseResponse(response, metric, chatResultStream, session, contextList) {
|
|
360
1537
|
const requestId = response.$metadata.requestId;
|
|
361
|
-
const chatEventParser = new
|
|
362
|
-
|
|
1538
|
+
const chatEventParser = new agenticChatEventParser_1.AgenticChatEventParser(requestId, metric, this.#features.logging);
|
|
1539
|
+
const streamWriter = chatResultStream.getResultStreamWriter();
|
|
1540
|
+
// Display context transparency list once at the beginning of response
|
|
1541
|
+
// Use a flag to track if contextList has been sent already to avoid ux flickering
|
|
1542
|
+
if (contextList && !session.contextListSent) {
|
|
1543
|
+
await streamWriter.write({ body: '', contextList });
|
|
1544
|
+
session.contextListSent = true;
|
|
1545
|
+
}
|
|
1546
|
+
const toolUseStartTimes = {};
|
|
1547
|
+
const toolUseLoadingTimeouts = {};
|
|
1548
|
+
for await (const chatEvent of response.generateAssistantResponseResponse) {
|
|
1549
|
+
if (chatEvent.assistantResponseEvent) {
|
|
1550
|
+
await this.#showUndoAllIfRequired(chatResultStream, session);
|
|
1551
|
+
}
|
|
363
1552
|
const result = chatEventParser.processPartialEvent(chatEvent);
|
|
364
1553
|
// terminate early when there is an error
|
|
365
1554
|
if (!result.success) {
|
|
1555
|
+
await streamWriter.close();
|
|
366
1556
|
return result;
|
|
367
1557
|
}
|
|
368
|
-
|
|
369
|
-
|
|
1558
|
+
// make sure to save code reference events
|
|
1559
|
+
if (chatEvent.assistantResponseEvent || chatEvent.codeReferenceEvent) {
|
|
1560
|
+
await streamWriter.write(result.data.chatResult);
|
|
1561
|
+
}
|
|
1562
|
+
if (chatEvent.toolUseEvent) {
|
|
1563
|
+
await this.#showLoadingIfRequired(chatEvent.toolUseEvent, streamWriter, toolUseStartTimes, toolUseLoadingTimeouts);
|
|
370
1564
|
}
|
|
371
1565
|
}
|
|
1566
|
+
await streamWriter.close();
|
|
372
1567
|
metric.mergeWith({
|
|
373
1568
|
cwsprChatFullResponseLatency: metric.getTimeElapsed(),
|
|
374
1569
|
cwsprChatFollowUpCount: chatEventParser.totalEvents.followupPromptEvent,
|
|
@@ -378,6 +1573,34 @@ class AgenticChatController {
|
|
|
378
1573
|
});
|
|
379
1574
|
return chatEventParser.getResult();
|
|
380
1575
|
}
|
|
1576
|
+
/**
|
|
1577
|
+
* This is needed to handle the case where a toolUseEvent takes a long time to resolve the stream and looks like
|
|
1578
|
+
* nothing is happening.
|
|
1579
|
+
*/
|
|
1580
|
+
async #showLoadingIfRequired(toolUseEvent, streamWriter, toolUseStartTimes, toolUseLoadingTimeouts) {
|
|
1581
|
+
const toolUseId = toolUseEvent.toolUseId;
|
|
1582
|
+
if (!toolUseEvent.stop && toolUseId) {
|
|
1583
|
+
if (!toolUseStartTimes[toolUseId]) {
|
|
1584
|
+
toolUseStartTimes[toolUseId] = Date.now();
|
|
1585
|
+
this.#debug(`ToolUseEvent ${toolUseId} started`);
|
|
1586
|
+
toolUseLoadingTimeouts[toolUseId] = setTimeout(async () => {
|
|
1587
|
+
this.#debug(`ToolUseEvent ${toolUseId} is taking longer than ${constants_2.loadingThresholdMs}ms, showing loading indicator`);
|
|
1588
|
+
await streamWriter.write({ ...constants_1.loadingMessage, messageId: `loading-${toolUseId}` });
|
|
1589
|
+
}, constants_2.loadingThresholdMs);
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
else if (toolUseEvent.stop && toolUseId) {
|
|
1593
|
+
if (toolUseStartTimes[toolUseId]) {
|
|
1594
|
+
const duration = Date.now() - toolUseStartTimes[toolUseId];
|
|
1595
|
+
this.#debug(`ToolUseEvent ${toolUseId} finished streaming after ${duration}ms`);
|
|
1596
|
+
if (toolUseLoadingTimeouts[toolUseId]) {
|
|
1597
|
+
clearTimeout(toolUseLoadingTimeouts[toolUseId]);
|
|
1598
|
+
delete toolUseLoadingTimeouts[toolUseId];
|
|
1599
|
+
}
|
|
1600
|
+
delete toolUseStartTimes[toolUseId];
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
381
1604
|
async #processSendMessageResponseForInlineChat(response, metric, partialResultToken) {
|
|
382
1605
|
const requestId = response.$metadata.requestId;
|
|
383
1606
|
const chatEventParser = new chatEventParser_1.ChatEventParser(requestId, metric);
|
|
@@ -387,15 +1610,22 @@ class AgenticChatController {
|
|
|
387
1610
|
if (!result.success) {
|
|
388
1611
|
return result;
|
|
389
1612
|
}
|
|
390
|
-
|
|
391
|
-
await this.#features.lsp.sendProgress(protocol_1.chatRequestType, partialResultToken, result.data.chatResult);
|
|
392
|
-
}
|
|
1613
|
+
await this.#sendProgressToClient(result.data.chatResult, partialResultToken);
|
|
393
1614
|
}
|
|
394
1615
|
return chatEventParser.getResult();
|
|
395
1616
|
}
|
|
1617
|
+
onPromptInputOptionChange(params) {
|
|
1618
|
+
const sessionResult = this.#chatSessionManagementService.getSession(params.tabId);
|
|
1619
|
+
const { data: session, success } = sessionResult;
|
|
1620
|
+
if (!success) {
|
|
1621
|
+
this.#log('onPromptInputOptionChange: on valid session found');
|
|
1622
|
+
return;
|
|
1623
|
+
}
|
|
1624
|
+
session.pairProgrammingMode = !session.pairProgrammingMode;
|
|
1625
|
+
}
|
|
396
1626
|
updateConfiguration = (newConfig) => {
|
|
397
1627
|
this.#customizationArn = newConfig.customizationArn;
|
|
398
|
-
this.#log(`Chat configuration updated to
|
|
1628
|
+
this.#log(`Chat configuration updated customizationArn to ${this.#customizationArn}`);
|
|
399
1629
|
/*
|
|
400
1630
|
The flag enableTelemetryEventsToDestination is set to true temporarily. It's value will be determined through destination
|
|
401
1631
|
configuration post all events migration to STE. It'll be replaced by qConfig['enableTelemetryEventsToDestination'] === true
|
|
@@ -406,9 +1636,29 @@ class AgenticChatController {
|
|
|
406
1636
|
this.#telemetryService.updateOptOutPreference(updatedOptOutPreference);
|
|
407
1637
|
this.#log(`Chat configuration telemetry preference to ${updatedOptOutPreference}`);
|
|
408
1638
|
};
|
|
1639
|
+
#getTools(session) {
|
|
1640
|
+
const tools = this.#features.agent.getTools({ format: 'bedrock' });
|
|
1641
|
+
// it's disabled so filter out the write tools
|
|
1642
|
+
if (!session.pairProgrammingMode) {
|
|
1643
|
+
return tools.filter(tool => !['fsWrite', 'executeBash'].includes(tool.toolSpecification?.name || ''));
|
|
1644
|
+
}
|
|
1645
|
+
return tools;
|
|
1646
|
+
}
|
|
1647
|
+
#createDeferred() {
|
|
1648
|
+
let resolve;
|
|
1649
|
+
let reject;
|
|
1650
|
+
const promise = new Promise((res, rej) => {
|
|
1651
|
+
resolve = res;
|
|
1652
|
+
reject = (e) => rej(e);
|
|
1653
|
+
});
|
|
1654
|
+
return { promise, resolve, reject };
|
|
1655
|
+
}
|
|
409
1656
|
#log(...messages) {
|
|
410
1657
|
this.#features.logging.log(messages.join(' '));
|
|
411
1658
|
}
|
|
1659
|
+
#debug(...messages) {
|
|
1660
|
+
this.#features.logging.debug(messages.join(' '));
|
|
1661
|
+
}
|
|
412
1662
|
}
|
|
413
1663
|
exports.AgenticChatController = AgenticChatController;
|
|
414
1664
|
//# sourceMappingURL=agenticChatController.js.map
|