diff --git a/.gitignore b/.gitignore index 596af538b2e..3541dbf9cae 100644 --- a/.gitignore +++ b/.gitignore @@ -31,7 +31,6 @@ src.gen/* **/src/shared/telemetry/clienttelemetry.d.ts **/src/codewhisperer/client/codewhispererclient.d.ts **/src/codewhisperer/client/codewhispereruserclient.d.ts -**/src/amazonqFeatureDev/client/featuredevproxyclient.d.ts **/src/auth/sso/oidcclientpkce.d.ts # Generated by tests diff --git a/buildspec/linuxTests.yml b/buildspec/linuxTests.yml index 900b720e61a..241b5bb193a 100644 --- a/buildspec/linuxTests.yml +++ b/buildspec/linuxTests.yml @@ -48,7 +48,7 @@ phases: - VCS_COMMIT_ID="${CODEBUILD_RESOLVED_SOURCE_VERSION}" - CI_BUILD_URL=$(echo $CODEBUILD_BUILD_URL | sed 's/#/%23/g') # Encode `#` in the URL because otherwise the url is clipped in the Codecov.io site - CI_BUILD_ID="${CODEBUILD_BUILD_ID}" - - test -n "${CODECOV_TOKEN}" && [ "$TARGET_BRANCH" = "master" ] && ./codecov --token=${CODECOV_TOKEN} --branch=${CODEBUILD_RESOLVED_SOURCE_VERSION} --repository=${CODEBUILD_SOURCE_REPO_URL} --file=./coverage/amazonq/lcov.info --file=./coverage/toolkit/lcov.info + - test -n "${CODECOV_TOKEN}" && [ "$TARGET_BRANCH" = "master" ] && ./codecov --token=${CODECOV_TOKEN} --branch=${CODEBUILD_RESOLVED_SOURCE_VERSION} --repository=${CODEBUILD_SOURCE_REPO_URL} --file=./coverage/amazonq/lcov.info --file=./coverage/toolkit/lcov.info || true reports: unit-test: diff --git a/docs/lsp.md b/docs/lsp.md index ba1c82ad9a5..884c7cce378 100644 --- a/docs/lsp.md +++ b/docs/lsp.md @@ -26,6 +26,8 @@ sequenceDiagram ## Language Server Debugging +If you want to connect a local version of language-servers to aws-toolkit-vscode, follow these steps: + 1. Clone https://github.com/aws/language-servers.git and set it up in the same workspace as this project by cmd+shift+p and "add folder to workspace" and selecting the language-servers folder that you just cloned. Your VS code folder structure should look like below. ``` @@ -55,6 +57,47 @@ sequenceDiagram 5. Use the `Launch LSP with Debugging` configuration and set breakpoints in VSCode or the language server, Once you run "Launch LSP with Debugging" a new window should start, wait for the plugin to show up there. Then go to the run menu again and run "Attach to Language Server (amazonq)" after this you should be able to add breakpoints in the LSP code. 6. (Optional): Enable `"amazonq.trace.server": "on"` or `"amazonq.trace.server": "verbose"` in your VSCode settings to view detailed log messages sent to/from the language server. These log messages will show up in the "Amazon Q Language Server" output channel +### Breakpoints Work-Around + +If the breakpoints in your language-servers project remain greyed out and do not trigger when you run `Launch LSP with Debugging`, your debugger may be attaching to the language server before it has launched. You can follow the work-around below to avoid this problem. If anyone fixes this issue, please remove this section. + +1. Set your breakpoints and click `Launch LSP with Debugging` +2. Once the debugging session has started, click `Launch LSP with Debugging` again, then `Cancel` on any pop-ups that appear +3. On the debug panel, click `Attach to Language Server (amazonq)` next to the red stop button +4. Click `Launch LSP with Debugging` again, then `Cancel` on any pop-ups that appear + +## Language Server Runtimes Debugging + +If you want to connect a local version of language-server-runtimes to aws-toolkit-vscode, follow these steps: + +1. Clone https://github.com/aws/language-server-runtimes.git and set it up in the same workspace as this project by cmd+shift+p and "add folder to workspace" and selecting the language-server-runtimes folder that you just cloned. Your VS code folder structure should look like below. + + ``` + /aws-toolkit-vscode + /toolkit + /core + /amazonq + /language-server-runtimes + ``` + +2. Inside of the language-server-runtimes project run: + ``` + npm install + npm run compile + cd runtimes + npm run prepub + cd out + npm link + cd ../../types + npm link + ``` + If you get an error running `npm run prepub`, you can instead run `npm run prepub:copyFiles` to skip cleaning and testing. +3. Inside of aws-toolkit-vscode run: + ``` + npm install + npm link @aws/language-server-runtimes @aws/language-server-runtimes-types + ``` + ## Amazon Q Inline Activation - In order to get inline completion working you must open a supported file type defined in CodewhispererInlineCompletionLanguages in `packages/amazonq/src/app/inline/completion.ts` diff --git a/package-lock.json b/package-lock.json index e9418440268..83ec79fd41f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,14 +16,16 @@ ], "dependencies": { "@types/node": "^22.7.5", + "jaro-winkler": "^0.2.8", "vscode-nls": "^5.2.0", "vscode-nls-dev": "^4.0.4" }, "devDependencies": { - "@aws-toolkits/telemetry": "^1.0.324", + "@aws-toolkits/telemetry": "^1.0.329", "@playwright/browser-chromium": "^1.43.1", "@stylistic/eslint-plugin": "^2.11.0", "@types/he": "^1.2.3", + "@types/jaro-winkler": "^0.2.4", "@types/vscode": "^1.68.0", "@types/vscode-webview": "^1.57.1", "@types/webpack-env": "^1.18.5", @@ -68,2804 +70,5938 @@ "resolved": "src.gen/@amzn/codewhisperer-streaming", "link": true }, - "node_modules/@aws-crypto/crc32": { - "version": "5.2.0", - "license": "Apache-2.0", - "dependencies": { - "@aws-crypto/util": "^5.2.0", - "@aws-sdk/types": "^3.222.0", - "tslib": "^2.6.2" + "node_modules/@amzn/sagemaker-client": { + "version": "1.0.0", + "resolved": "file:src.gen/@amzn/sagemaker-client/1.0.0.tgz", + "integrity": "sha512-rNMUzeACaCiIqR8aQo3G99xR+Qy6zhbGi9+6XRG5proUKetO3584dclmSnIUvDvzLWosFcl4GyP8tFqiahc6Jg==", + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/client-sts": "3.363.0", + "@aws-sdk/credential-provider-node": "3.363.0", + "@aws-sdk/middleware-host-header": "3.363.0", + "@aws-sdk/middleware-logger": "3.363.0", + "@aws-sdk/middleware-recursion-detection": "3.363.0", + "@aws-sdk/middleware-signing": "3.363.0", + "@aws-sdk/middleware-user-agent": "3.363.0", + "@aws-sdk/types": "3.357.0", + "@aws-sdk/util-user-agent-browser": "3.363.0", + "@aws-sdk/util-user-agent-node": "3.363.0", + "@smithy/config-resolver": "^1.0.1", + "@smithy/fetch-http-handler": "^1.0.1", + "@smithy/hash-node": "^1.0.1", + "@smithy/invalid-dependency": "^1.0.1", + "@smithy/middleware-content-length": "^1.0.1", + "@smithy/middleware-retry": "^1.0.3", + "@smithy/middleware-serde": "^1.0.1", + "@smithy/middleware-stack": "^1.0.1", + "@smithy/node-config-provider": "^1.0.1", + "@smithy/node-http-handler": "^1.0.2", + "@smithy/protocol-http": "^1.1.0", + "@smithy/smithy-client": "^1.0.3", + "@smithy/types": "^1.1.0", + "@smithy/url-parser": "^1.0.1", + "@smithy/util-base64": "^1.0.1", + "@smithy/util-body-length-browser": "^1.0.1", + "@smithy/util-body-length-node": "^1.0.1", + "@smithy/util-defaults-mode-browser": "^1.0.1", + "@smithy/util-defaults-mode-node": "^1.0.1", + "@smithy/util-retry": "^1.0.3", + "@smithy/util-utf8": "^1.0.1", + "@smithy/util-waiter": "^1.0.1", + "tslib": "^2.5.0", + "uuid": "^8.3.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, - "node_modules/@aws-crypto/crc32c": { - "version": "5.2.0", - "license": "Apache-2.0", + "node_modules/@amzn/sagemaker-client/node_modules/@aws-crypto/sha256-browser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-browser/-/sha256-browser-3.0.0.tgz", + "integrity": "sha512-8VLmW2B+gjFbU5uMeqtQM6Nj0/F1bro80xQXCW6CQBWgosFWXTx77aeOF5CAIAmbOK64SdMBJdNr6J41yP5mvQ==", "dependencies": { - "@aws-crypto/util": "^5.2.0", + "@aws-crypto/ie11-detection": "^3.0.0", + "@aws-crypto/sha256-js": "^3.0.0", + "@aws-crypto/supports-web-crypto": "^3.0.0", + "@aws-crypto/util": "^3.0.0", "@aws-sdk/types": "^3.222.0", - "tslib": "^2.6.2" + "@aws-sdk/util-locate-window": "^3.0.0", + "@aws-sdk/util-utf8-browser": "^3.0.0", + "tslib": "^1.11.1" } }, - "node_modules/@aws-crypto/sha1-browser": { - "version": "5.2.0", - "license": "Apache-2.0", + "node_modules/@amzn/sagemaker-client/node_modules/@aws-crypto/sha256-browser/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@amzn/sagemaker-client/node_modules/@aws-crypto/sha256-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-js/-/sha256-js-3.0.0.tgz", + "integrity": "sha512-PnNN7os0+yd1XvXAy23CFOmTbMaDxgxXtTKHybrJ39Y8kGzBATgBFibWJKH6BhytLI/Zyszs87xCOBNyBig6vQ==", "dependencies": { - "@aws-crypto/supports-web-crypto": "^5.2.0", - "@aws-crypto/util": "^5.2.0", + "@aws-crypto/util": "^3.0.0", "@aws-sdk/types": "^3.222.0", - "@aws-sdk/util-locate-window": "^3.0.0", - "@smithy/util-utf8": "^2.0.0", - "tslib": "^2.6.2" + "tslib": "^1.11.1" } }, - "node_modules/@aws-crypto/sha256-browser": { - "version": "5.2.0", - "license": "Apache-2.0", + "node_modules/@amzn/sagemaker-client/node_modules/@aws-crypto/sha256-js/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@amzn/sagemaker-client/node_modules/@aws-crypto/supports-web-crypto": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/supports-web-crypto/-/supports-web-crypto-3.0.0.tgz", + "integrity": "sha512-06hBdMwUAb2WFTuGG73LSC0wfPu93xWwo5vL2et9eymgmu3Id5vFAHBbajVWiGhPO37qcsdCap/FqXvJGJWPIg==", "dependencies": { - "@aws-crypto/sha256-js": "^5.2.0", - "@aws-crypto/supports-web-crypto": "^5.2.0", - "@aws-crypto/util": "^5.2.0", - "@aws-sdk/types": "^3.222.0", - "@aws-sdk/util-locate-window": "^3.0.0", - "@smithy/util-utf8": "^2.0.0", - "tslib": "^2.6.2" + "tslib": "^1.11.1" } }, - "node_modules/@aws-crypto/sha256-js": { - "version": "5.2.0", - "license": "Apache-2.0", + "node_modules/@amzn/sagemaker-client/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@amzn/sagemaker-client/node_modules/@aws-crypto/util": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-3.0.0.tgz", + "integrity": "sha512-2OJlpeJpCR48CC8r+uKVChzs9Iungj9wkZrl8Z041DWEWvyIHILYKCPNzJghKsivj+S3mLo6BVc7mBNzdxA46w==", "dependencies": { - "@aws-crypto/util": "^5.2.0", "@aws-sdk/types": "^3.222.0", - "tslib": "^2.6.2" + "@aws-sdk/util-utf8-browser": "^3.0.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@aws-crypto/util/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@amzn/sagemaker-client/node_modules/@aws-sdk/client-sso": { + "version": "3.363.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.363.0.tgz", + "integrity": "sha512-PZ+HfKSgS4hlMnJzG+Ev8/mgHd/b/ETlJWPSWjC/f2NwVoBQkBnqHjdyEx7QjF6nksJozcVh5Q+kkYLKc/QwBQ==", + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/middleware-host-header": "3.363.0", + "@aws-sdk/middleware-logger": "3.363.0", + "@aws-sdk/middleware-recursion-detection": "3.363.0", + "@aws-sdk/middleware-user-agent": "3.363.0", + "@aws-sdk/types": "3.357.0", + "@aws-sdk/util-endpoints": "3.357.0", + "@aws-sdk/util-user-agent-browser": "3.363.0", + "@aws-sdk/util-user-agent-node": "3.363.0", + "@smithy/config-resolver": "^1.0.1", + "@smithy/fetch-http-handler": "^1.0.1", + "@smithy/hash-node": "^1.0.1", + "@smithy/invalid-dependency": "^1.0.1", + "@smithy/middleware-content-length": "^1.0.1", + "@smithy/middleware-endpoint": "^1.0.1", + "@smithy/middleware-retry": "^1.0.2", + "@smithy/middleware-serde": "^1.0.1", + "@smithy/middleware-stack": "^1.0.1", + "@smithy/node-config-provider": "^1.0.1", + "@smithy/node-http-handler": "^1.0.2", + "@smithy/protocol-http": "^1.0.1", + "@smithy/smithy-client": "^1.0.3", + "@smithy/types": "^1.0.0", + "@smithy/url-parser": "^1.0.1", + "@smithy/util-base64": "^1.0.1", + "@smithy/util-body-length-browser": "^1.0.1", + "@smithy/util-body-length-node": "^1.0.1", + "@smithy/util-defaults-mode-browser": "^1.0.1", + "@smithy/util-defaults-mode-node": "^1.0.1", + "@smithy/util-retry": "^1.0.2", + "@smithy/util-utf8": "^1.0.1", + "tslib": "^2.5.0" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, - "node_modules/@aws-crypto/supports-web-crypto": { - "version": "5.2.0", - "license": "Apache-2.0", + "node_modules/@amzn/sagemaker-client/node_modules/@aws-sdk/client-sso-oidc": { + "version": "3.363.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.363.0.tgz", + "integrity": "sha512-V3Ebiq/zNtDS/O92HUWGBa7MY59RYSsqWd+E0XrXv6VYTA00RlMTbNcseivNgp2UghOgB9a20Nkz6EqAeIN+RQ==", + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/middleware-host-header": "3.363.0", + "@aws-sdk/middleware-logger": "3.363.0", + "@aws-sdk/middleware-recursion-detection": "3.363.0", + "@aws-sdk/middleware-user-agent": "3.363.0", + "@aws-sdk/types": "3.357.0", + "@aws-sdk/util-endpoints": "3.357.0", + "@aws-sdk/util-user-agent-browser": "3.363.0", + "@aws-sdk/util-user-agent-node": "3.363.0", + "@smithy/config-resolver": "^1.0.1", + "@smithy/fetch-http-handler": "^1.0.1", + "@smithy/hash-node": "^1.0.1", + "@smithy/invalid-dependency": "^1.0.1", + "@smithy/middleware-content-length": "^1.0.1", + "@smithy/middleware-endpoint": "^1.0.1", + "@smithy/middleware-retry": "^1.0.2", + "@smithy/middleware-serde": "^1.0.1", + "@smithy/middleware-stack": "^1.0.1", + "@smithy/node-config-provider": "^1.0.1", + "@smithy/node-http-handler": "^1.0.2", + "@smithy/protocol-http": "^1.0.1", + "@smithy/smithy-client": "^1.0.3", + "@smithy/types": "^1.0.0", + "@smithy/url-parser": "^1.0.1", + "@smithy/util-base64": "^1.0.1", + "@smithy/util-body-length-browser": "^1.0.1", + "@smithy/util-body-length-node": "^1.0.1", + "@smithy/util-defaults-mode-browser": "^1.0.1", + "@smithy/util-defaults-mode-node": "^1.0.1", + "@smithy/util-retry": "^1.0.2", + "@smithy/util-utf8": "^1.0.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@aws-sdk/client-sts": { + "version": "3.363.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.363.0.tgz", + "integrity": "sha512-0jj14WvBPJQ8xr72cL0mhlmQ90tF0O0wqXwSbtog6PsC8+KDE6Yf+WsxsumyI8E5O8u3eYijBL+KdqG07F/y/w==", + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/credential-provider-node": "3.363.0", + "@aws-sdk/middleware-host-header": "3.363.0", + "@aws-sdk/middleware-logger": "3.363.0", + "@aws-sdk/middleware-recursion-detection": "3.363.0", + "@aws-sdk/middleware-sdk-sts": "3.363.0", + "@aws-sdk/middleware-signing": "3.363.0", + "@aws-sdk/middleware-user-agent": "3.363.0", + "@aws-sdk/types": "3.357.0", + "@aws-sdk/util-endpoints": "3.357.0", + "@aws-sdk/util-user-agent-browser": "3.363.0", + "@aws-sdk/util-user-agent-node": "3.363.0", + "@smithy/config-resolver": "^1.0.1", + "@smithy/fetch-http-handler": "^1.0.1", + "@smithy/hash-node": "^1.0.1", + "@smithy/invalid-dependency": "^1.0.1", + "@smithy/middleware-content-length": "^1.0.1", + "@smithy/middleware-endpoint": "^1.0.1", + "@smithy/middleware-retry": "^1.0.1", + "@smithy/middleware-serde": "^1.0.1", + "@smithy/middleware-stack": "^1.0.1", + "@smithy/node-config-provider": "^1.0.1", + "@smithy/node-http-handler": "^1.0.1", + "@smithy/protocol-http": "^1.1.0", + "@smithy/smithy-client": "^1.0.2", + "@smithy/types": "^1.1.0", + "@smithy/url-parser": "^1.0.1", + "@smithy/util-base64": "^1.0.1", + "@smithy/util-body-length-browser": "^1.0.1", + "@smithy/util-body-length-node": "^1.0.1", + "@smithy/util-defaults-mode-browser": "^1.0.1", + "@smithy/util-defaults-mode-node": "^1.0.1", + "@smithy/util-retry": "^1.0.1", + "@smithy/util-utf8": "^1.0.1", + "fast-xml-parser": "4.2.5", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@aws-sdk/credential-provider-env": { + "version": "3.363.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.363.0.tgz", + "integrity": "sha512-VAQ3zITT2Q0acht0HezouYnMFKZ2vIOa20X4zQA3WI0HfaP4D6ga6KaenbDcb/4VFiqfqiRHfdyXHP0ThcDRMA==", "dependencies": { - "tslib": "^2.6.2" + "@aws-sdk/types": "3.357.0", + "@smithy/property-provider": "^1.0.1", + "@smithy/types": "^1.1.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" } }, - "node_modules/@aws-crypto/util": { - "version": "5.2.0", - "license": "Apache-2.0", + "node_modules/@amzn/sagemaker-client/node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.363.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.363.0.tgz", + "integrity": "sha512-ZYN+INoqyX5FVC3rqUxB6O8nOWkr0gHRRBm1suoOlmuFJ/WSlW/uUGthRBY5x1AQQnBF8cpdlxZzGHd41lFVNw==", "dependencies": { - "@aws-sdk/types": "^3.222.0", - "@smithy/util-utf8": "^2.0.0", - "tslib": "^2.6.2" + "@aws-sdk/credential-provider-env": "3.363.0", + "@aws-sdk/credential-provider-process": "3.363.0", + "@aws-sdk/credential-provider-sso": "3.363.0", + "@aws-sdk/credential-provider-web-identity": "3.363.0", + "@aws-sdk/types": "3.357.0", + "@smithy/credential-provider-imds": "^1.0.1", + "@smithy/property-provider": "^1.0.1", + "@smithy/shared-ini-file-loader": "^1.0.1", + "@smithy/types": "^1.1.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-api-gateway": { - "version": "3.693.0", - "license": "Apache-2.0", + "node_modules/@amzn/sagemaker-client/node_modules/@aws-sdk/credential-provider-node": { + "version": "3.363.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.363.0.tgz", + "integrity": "sha512-C1qXFIN2yMxD6pGgug0vR1UhScOki6VqdzuBHzXZAGu7MOjvgHNdscEcb3CpWnITHaPL2ztkiw75T1sZ7oIgQg==", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.363.0", + "@aws-sdk/credential-provider-ini": "3.363.0", + "@aws-sdk/credential-provider-process": "3.363.0", + "@aws-sdk/credential-provider-sso": "3.363.0", + "@aws-sdk/credential-provider-web-identity": "3.363.0", + "@aws-sdk/types": "3.357.0", + "@smithy/credential-provider-imds": "^1.0.1", + "@smithy/property-provider": "^1.0.1", + "@smithy/shared-ini-file-loader": "^1.0.1", + "@smithy/types": "^1.1.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@aws-sdk/credential-provider-process": { + "version": "3.363.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.363.0.tgz", + "integrity": "sha512-fOKAINU7Rtj2T8pP13GdCt+u0Ml3gYynp8ki+1jMZIQ+Ju/MdDOqZpKMFKicMn3Z1ttUOgqr+grUdus6z8ceBQ==", "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.693.0", - "@aws-sdk/client-sts": "3.693.0", - "@aws-sdk/core": "3.693.0", - "@aws-sdk/credential-provider-node": "3.693.0", - "@aws-sdk/middleware-host-header": "3.693.0", - "@aws-sdk/middleware-logger": "3.693.0", - "@aws-sdk/middleware-recursion-detection": "3.693.0", - "@aws-sdk/middleware-sdk-api-gateway": "3.693.0", - "@aws-sdk/middleware-user-agent": "3.693.0", - "@aws-sdk/region-config-resolver": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@aws-sdk/util-endpoints": "3.693.0", - "@aws-sdk/util-user-agent-browser": "3.693.0", - "@aws-sdk/util-user-agent-node": "3.693.0", - "@smithy/config-resolver": "^3.0.11", - "@smithy/core": "^2.5.2", - "@smithy/fetch-http-handler": "^4.1.0", - "@smithy/hash-node": "^3.0.9", - "@smithy/invalid-dependency": "^3.0.9", - "@smithy/middleware-content-length": "^3.0.11", - "@smithy/middleware-endpoint": "^3.2.2", - "@smithy/middleware-retry": "^3.0.26", - "@smithy/middleware-serde": "^3.0.9", - "@smithy/middleware-stack": "^3.0.9", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/node-http-handler": "^3.3.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/url-parser": "^3.0.9", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.26", - "@smithy/util-defaults-mode-node": "^3.0.26", - "@smithy/util-endpoints": "^2.1.5", - "@smithy/util-middleware": "^3.0.9", - "@smithy/util-retry": "^3.0.9", - "@smithy/util-stream": "^3.3.0", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" + "@aws-sdk/types": "3.357.0", + "@smithy/property-provider": "^1.0.1", + "@smithy/shared-ini-file-loader": "^1.0.1", + "@smithy/types": "^1.1.0", + "tslib": "^2.5.0" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/client-sso": { - "version": "3.693.0", - "license": "Apache-2.0", + "node_modules/@amzn/sagemaker-client/node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.363.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.363.0.tgz", + "integrity": "sha512-5RUZ5oM0lwZSo3EehT0dXggOjgtxFogpT3cZvoLGtIwrPBvm8jOQPXQUlaqCj10ThF1sYltEyukz/ovtDwYGew==", "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.693.0", - "@aws-sdk/middleware-host-header": "3.693.0", - "@aws-sdk/middleware-logger": "3.693.0", - "@aws-sdk/middleware-recursion-detection": "3.693.0", - "@aws-sdk/middleware-user-agent": "3.693.0", - "@aws-sdk/region-config-resolver": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@aws-sdk/util-endpoints": "3.693.0", - "@aws-sdk/util-user-agent-browser": "3.693.0", - "@aws-sdk/util-user-agent-node": "3.693.0", - "@smithy/config-resolver": "^3.0.11", - "@smithy/core": "^2.5.2", - "@smithy/fetch-http-handler": "^4.1.0", - "@smithy/hash-node": "^3.0.9", - "@smithy/invalid-dependency": "^3.0.9", - "@smithy/middleware-content-length": "^3.0.11", - "@smithy/middleware-endpoint": "^3.2.2", - "@smithy/middleware-retry": "^3.0.26", - "@smithy/middleware-serde": "^3.0.9", - "@smithy/middleware-stack": "^3.0.9", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/node-http-handler": "^3.3.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/url-parser": "^3.0.9", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.26", - "@smithy/util-defaults-mode-node": "^3.0.26", - "@smithy/util-endpoints": "^2.1.5", - "@smithy/util-middleware": "^3.0.9", - "@smithy/util-retry": "^3.0.9", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" + "@aws-sdk/client-sso": "3.363.0", + "@aws-sdk/token-providers": "3.363.0", + "@aws-sdk/types": "3.357.0", + "@smithy/property-provider": "^1.0.1", + "@smithy/shared-ini-file-loader": "^1.0.1", + "@smithy/types": "^1.1.0", + "tslib": "^2.5.0" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/client-sso-oidc": { - "version": "3.693.0", - "license": "Apache-2.0", + "node_modules/@amzn/sagemaker-client/node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.363.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.363.0.tgz", + "integrity": "sha512-Z6w7fjgy79pAax580wdixbStQw10xfyZ+hOYLcPudoYFKjoNx0NQBejg5SwBzCF/HQL23Ksm9kDfbXDX9fkPhA==", "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.693.0", - "@aws-sdk/credential-provider-node": "3.693.0", - "@aws-sdk/middleware-host-header": "3.693.0", - "@aws-sdk/middleware-logger": "3.693.0", - "@aws-sdk/middleware-recursion-detection": "3.693.0", - "@aws-sdk/middleware-user-agent": "3.693.0", - "@aws-sdk/region-config-resolver": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@aws-sdk/util-endpoints": "3.693.0", - "@aws-sdk/util-user-agent-browser": "3.693.0", - "@aws-sdk/util-user-agent-node": "3.693.0", - "@smithy/config-resolver": "^3.0.11", - "@smithy/core": "^2.5.2", - "@smithy/fetch-http-handler": "^4.1.0", - "@smithy/hash-node": "^3.0.9", - "@smithy/invalid-dependency": "^3.0.9", - "@smithy/middleware-content-length": "^3.0.11", - "@smithy/middleware-endpoint": "^3.2.2", - "@smithy/middleware-retry": "^3.0.26", - "@smithy/middleware-serde": "^3.0.9", - "@smithy/middleware-stack": "^3.0.9", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/node-http-handler": "^3.3.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/url-parser": "^3.0.9", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.26", - "@smithy/util-defaults-mode-node": "^3.0.26", - "@smithy/util-endpoints": "^2.1.5", - "@smithy/util-middleware": "^3.0.9", - "@smithy/util-retry": "^3.0.9", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" + "@aws-sdk/types": "3.357.0", + "@smithy/property-provider": "^1.0.1", + "@smithy/types": "^1.1.0", + "tslib": "^2.5.0" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@aws-sdk/middleware-host-header": { + "version": "3.363.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.363.0.tgz", + "integrity": "sha512-FobpclDCf5Y1ueyJDmb9MqguAdPssNMlnqWQpujhYVABq69KHu73fSCWSauFPUrw7YOpV8kG1uagDF0POSxHzA==", + "dependencies": { + "@aws-sdk/types": "3.357.0", + "@smithy/protocol-http": "^1.1.0", + "@smithy/types": "^1.1.0", + "tslib": "^2.5.0" }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.693.0" + "engines": { + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/client-sts": { - "version": "3.693.0", - "license": "Apache-2.0", + "node_modules/@amzn/sagemaker-client/node_modules/@aws-sdk/middleware-logger": { + "version": "3.363.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.363.0.tgz", + "integrity": "sha512-SSGgthScYnFGTOw8EzbkvquqweFmvn7uJihkpFekbtBNGC/jGOGO+8ziHjTQ8t/iI/YKubEwv+LMi0f77HKSEg==", "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.693.0", - "@aws-sdk/core": "3.693.0", - "@aws-sdk/credential-provider-node": "3.693.0", - "@aws-sdk/middleware-host-header": "3.693.0", - "@aws-sdk/middleware-logger": "3.693.0", - "@aws-sdk/middleware-recursion-detection": "3.693.0", - "@aws-sdk/middleware-user-agent": "3.693.0", - "@aws-sdk/region-config-resolver": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@aws-sdk/util-endpoints": "3.693.0", - "@aws-sdk/util-user-agent-browser": "3.693.0", - "@aws-sdk/util-user-agent-node": "3.693.0", - "@smithy/config-resolver": "^3.0.11", - "@smithy/core": "^2.5.2", - "@smithy/fetch-http-handler": "^4.1.0", - "@smithy/hash-node": "^3.0.9", - "@smithy/invalid-dependency": "^3.0.9", - "@smithy/middleware-content-length": "^3.0.11", - "@smithy/middleware-endpoint": "^3.2.2", - "@smithy/middleware-retry": "^3.0.26", - "@smithy/middleware-serde": "^3.0.9", - "@smithy/middleware-stack": "^3.0.9", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/node-http-handler": "^3.3.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/url-parser": "^3.0.9", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.26", - "@smithy/util-defaults-mode-node": "^3.0.26", - "@smithy/util-endpoints": "^2.1.5", - "@smithy/util-middleware": "^3.0.9", - "@smithy/util-retry": "^3.0.9", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" + "@aws-sdk/types": "3.357.0", + "@smithy/types": "^1.1.0", + "tslib": "^2.5.0" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/core": { - "version": "3.693.0", - "license": "Apache-2.0", + "node_modules/@amzn/sagemaker-client/node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.363.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.363.0.tgz", + "integrity": "sha512-MWD/57QgI/N7fG8rtzDTUdSqNpYohQfgj9XCFAoVeI/bU4usrkOrew43L4smJG4XrDxlNT8lSJlDtd64tuiUZA==", "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/core": "^2.5.2", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/property-provider": "^3.1.9", - "@smithy/protocol-http": "^4.1.6", - "@smithy/signature-v4": "^4.2.2", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/util-middleware": "^3.0.9", - "fast-xml-parser": "4.4.1", - "tslib": "^2.6.2" + "@aws-sdk/types": "3.357.0", + "@smithy/protocol-http": "^1.1.0", + "@smithy/types": "^1.1.0", + "tslib": "^2.5.0" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/credential-provider-http": { - "version": "3.693.0", - "license": "Apache-2.0", + "node_modules/@amzn/sagemaker-client/node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.363.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.363.0.tgz", + "integrity": "sha512-ri8YaQvXP6odteVTMfxPqFR26Q0h9ejtqhUDv47P34FaKXedEM4nC6ix6o+5FEYj6l8syGyktftZ5O70NoEhug==", "dependencies": { - "@aws-sdk/core": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/fetch-http-handler": "^4.1.0", - "@smithy/node-http-handler": "^3.3.0", - "@smithy/property-provider": "^3.1.9", - "@smithy/protocol-http": "^4.1.6", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/util-stream": "^3.3.0", - "tslib": "^2.6.2" + "@aws-sdk/types": "3.357.0", + "@aws-sdk/util-endpoints": "3.357.0", + "@smithy/protocol-http": "^1.1.0", + "@smithy/types": "^1.1.0", + "tslib": "^2.5.0" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.693.0", - "license": "Apache-2.0", + "node_modules/@amzn/sagemaker-client/node_modules/@aws-sdk/token-providers": { + "version": "3.363.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.363.0.tgz", + "integrity": "sha512-6+0aJ1zugNgsMmhTtW2LBWxOVSaXCUk2q3xyTchSXkNzallYaRiZMRkieW+pKNntnu0g5H1T0zyfCO0tbXwxEA==", "dependencies": { - "@aws-sdk/core": "3.693.0", - "@aws-sdk/credential-provider-env": "3.693.0", - "@aws-sdk/credential-provider-http": "3.693.0", - "@aws-sdk/credential-provider-process": "3.693.0", - "@aws-sdk/credential-provider-sso": "3.693.0", - "@aws-sdk/credential-provider-web-identity": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/credential-provider-imds": "^3.2.6", - "@smithy/property-provider": "^3.1.9", - "@smithy/shared-ini-file-loader": "^3.1.10", - "@smithy/types": "^3.7.0", - "tslib": "^2.6.2" + "@aws-sdk/client-sso-oidc": "3.363.0", + "@aws-sdk/types": "3.357.0", + "@smithy/property-provider": "^1.0.1", + "@smithy/shared-ini-file-loader": "^1.0.1", + "@smithy/types": "^1.1.0", + "tslib": "^2.5.0" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.693.0" + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/credential-provider-node": { - "version": "3.693.0", - "license": "Apache-2.0", + "node_modules/@amzn/sagemaker-client/node_modules/@aws-sdk/types": { + "version": "3.357.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.357.0.tgz", + "integrity": "sha512-/riCRaXg3p71BeWnShrai0y0QTdXcouPSM0Cn1olZbzTf7s71aLEewrc96qFrL70XhY4XvnxMpqQh+r43XIL3g==", "dependencies": { - "@aws-sdk/credential-provider-env": "3.693.0", - "@aws-sdk/credential-provider-http": "3.693.0", - "@aws-sdk/credential-provider-ini": "3.693.0", - "@aws-sdk/credential-provider-process": "3.693.0", - "@aws-sdk/credential-provider-sso": "3.693.0", - "@aws-sdk/credential-provider-web-identity": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/credential-provider-imds": "^3.2.6", - "@smithy/property-provider": "^3.1.9", - "@smithy/shared-ini-file-loader": "^3.1.10", - "@smithy/types": "^3.7.0", - "tslib": "^2.6.2" + "tslib": "^2.5.0" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.693.0", - "license": "Apache-2.0", + "node_modules/@amzn/sagemaker-client/node_modules/@aws-sdk/util-endpoints": { + "version": "3.357.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.357.0.tgz", + "integrity": "sha512-XHKyS5JClT9su9hDif715jpZiWHQF9gKZXER8tW0gOizU3R9cyWc9EsJ2BRhFNhi7nt/JF/CLUEc5qDx3ETbUw==", "dependencies": { - "@aws-sdk/client-sso": "3.693.0", - "@aws-sdk/core": "3.693.0", - "@aws-sdk/token-providers": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/property-provider": "^3.1.9", - "@smithy/shared-ini-file-loader": "^3.1.10", - "@smithy/types": "^3.7.0", - "tslib": "^2.6.2" + "@aws-sdk/types": "3.357.0", + "tslib": "^2.5.0" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.693.0", - "license": "Apache-2.0", + "node_modules/@amzn/sagemaker-client/node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.363.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.363.0.tgz", + "integrity": "sha512-fk9ymBUIYbxiGm99Cn+kAAXmvMCWTf/cHAcB79oCXV4ELXdPa9lN5xQhZRFNxLUeXG4OAMEuCAUUuZEj8Fnc1Q==", "dependencies": { - "@aws-sdk/core": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/property-provider": "^3.1.9", - "@smithy/types": "^3.7.0", - "tslib": "^2.6.2" + "@aws-sdk/types": "3.357.0", + "@smithy/types": "^1.1.0", + "bowser": "^2.11.0", + "tslib": "^2.5.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.363.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.363.0.tgz", + "integrity": "sha512-Fli/dvgGA9hdnQUrYb1//wNSFlK2jAfdJcfNXA6SeBYzSeH5pVGYF4kXF0FCdnMA3Fef+Zn1zAP/hw9v8VJHWQ==", + "dependencies": { + "@aws-sdk/types": "3.357.0", + "@smithy/node-config-provider": "^1.0.1", + "@smithy/types": "^1.1.0", + "tslib": "^2.5.0" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" }, "peerDependencies": { - "@aws-sdk/client-sts": "^3.693.0" + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } } }, - "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/middleware-host-header": { - "version": "3.693.0", - "license": "Apache-2.0", + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/abort-controller": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-1.1.0.tgz", + "integrity": "sha512-5imgGUlZL4dW4YWdMYAKLmal9ny/tlenM81QZY7xYyb76z9Z/QOg7oM5Ak9HQl8QfFTlGVWwcMXl+54jroRgEQ==", "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/types": "^3.7.0", - "tslib": "^2.6.2" + "@smithy/types": "^1.2.0", + "tslib": "^2.5.0" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/middleware-logger": { - "version": "3.693.0", - "license": "Apache-2.0", + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/config-resolver": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-1.1.0.tgz", + "integrity": "sha512-7WD9eZHp46BxAjNGHJLmxhhyeiNWkBdVStd7SUJPUZqQGeIO/REtIrcIfKUfdiHTQ9jyu2SYoqvzqqaFc6987w==", "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/types": "^3.7.0", - "tslib": "^2.6.2" + "@smithy/types": "^1.2.0", + "@smithy/util-config-provider": "^1.1.0", + "@smithy/util-middleware": "^1.1.0", + "tslib": "^2.5.0" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.693.0", - "license": "Apache-2.0", + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/credential-provider-imds": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-1.1.0.tgz", + "integrity": "sha512-kUMOdEu3RP6ozH0Ga8OeMP8gSkBsK1UqZZKyPLFnpZHrtZuHSSt7M7gsHYB/bYQBZAo3o7qrGmRty3BubYtYxQ==", "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/types": "^3.7.0", - "tslib": "^2.6.2" + "@smithy/node-config-provider": "^1.1.0", + "@smithy/property-provider": "^1.2.0", + "@smithy/types": "^1.2.0", + "@smithy/url-parser": "^1.1.0", + "tslib": "^2.5.0" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.693.0", - "license": "Apache-2.0", + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/fetch-http-handler": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-1.1.0.tgz", + "integrity": "sha512-N22C9R44u5WGlcY+Wuv8EXmCAq62wWwriRAuoczMEwAIjPbvHSthyPSLqI4S7kAST1j6niWg8kwpeJ3ReAv3xg==", "dependencies": { - "@aws-sdk/core": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@aws-sdk/util-endpoints": "3.693.0", - "@smithy/core": "^2.5.2", - "@smithy/protocol-http": "^4.1.6", - "@smithy/types": "^3.7.0", - "tslib": "^2.6.2" + "@smithy/protocol-http": "^1.2.0", + "@smithy/querystring-builder": "^1.1.0", + "@smithy/types": "^1.2.0", + "@smithy/util-base64": "^1.1.0", + "tslib": "^2.5.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/hash-node": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-1.1.0.tgz", + "integrity": "sha512-yiNKDGMzrQjnpnbLfkYKo+HwIxmBAsv0AI++QIJwvhfkLpUTBylelkv6oo78/YqZZS6h+bGfl0gILJsKE2wAKQ==", + "dependencies": { + "@smithy/types": "^1.2.0", + "@smithy/util-buffer-from": "^1.1.0", + "@smithy/util-utf8": "^1.1.0", + "tslib": "^2.5.0" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/region-config-resolver": { - "version": "3.693.0", - "license": "Apache-2.0", + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/invalid-dependency": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-1.1.0.tgz", + "integrity": "sha512-h2rXn68ClTwzPXYzEUNkz+0B/A0Hz8YdFNTiEwlxkwzkETGKMxmsrQGFXwYm3jd736R5vkXcClXz1ddKrsaBEQ==", "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/types": "^3.7.0", - "@smithy/util-config-provider": "^3.0.0", - "@smithy/util-middleware": "^3.0.9", - "tslib": "^2.6.2" + "@smithy/types": "^1.2.0", + "tslib": "^2.5.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/is-array-buffer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-1.1.0.tgz", + "integrity": "sha512-twpQ/n+3OWZJ7Z+xu43MJErmhB/WO/mMTnqR6PwWQShvSJ/emx5d1N59LQZk6ZpTAeuRWrc+eHhkzTp9NFjNRQ==", + "dependencies": { + "tslib": "^2.5.0" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/token-providers": { - "version": "3.693.0", - "license": "Apache-2.0", + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/middleware-content-length": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-1.1.0.tgz", + "integrity": "sha512-iNxwhZ7Xc5+LjeDElEOi/Nh8fFsc9Dw9+5w7h7/GLFIU0RgAwBJuJtcP1vNTOwzW4B3hG+gRu8sQLqA9OEaTwA==", "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/property-provider": "^3.1.9", - "@smithy/shared-ini-file-loader": "^3.1.10", - "@smithy/types": "^3.7.0", - "tslib": "^2.6.2" + "@smithy/protocol-http": "^1.2.0", + "@smithy/types": "^1.2.0", + "tslib": "^2.5.0" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/middleware-endpoint": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-1.1.0.tgz", + "integrity": "sha512-PvpazNjVpxX2ICrzoFYCpFnjB39DKCpZds8lRpAB3p6HGrx6QHBaNvOzVhJGBf0jcAbfCdc5/W0n9z8VWaSSww==", + "dependencies": { + "@smithy/middleware-serde": "^1.1.0", + "@smithy/types": "^1.2.0", + "@smithy/url-parser": "^1.1.0", + "@smithy/util-middleware": "^1.1.0", + "tslib": "^2.5.0" }, - "peerDependencies": { - "@aws-sdk/client-sso-oidc": "^3.693.0" + "engines": { + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/util-endpoints": { - "version": "3.693.0", - "license": "Apache-2.0", + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/middleware-retry": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-1.1.0.tgz", + "integrity": "sha512-lINKYxIvT+W20YFOtHBKeGm7npuJg0/YCoShttU7fVpsmU+a2rdb9zrJn1MHqWfUL6DhTAWGa0tH2O7l4XrDcw==", "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/types": "^3.7.0", - "@smithy/util-endpoints": "^2.1.5", - "tslib": "^2.6.2" + "@smithy/protocol-http": "^1.2.0", + "@smithy/service-error-classification": "^1.1.0", + "@smithy/types": "^1.2.0", + "@smithy/util-middleware": "^1.1.0", + "@smithy/util-retry": "^1.1.0", + "tslib": "^2.5.0", + "uuid": "^8.3.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.693.0", - "license": "Apache-2.0", + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/middleware-serde": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-1.1.0.tgz", + "integrity": "sha512-RiBMxhxuO9VTjHsjJvhzViyceoLhU6gtrnJGpAXY43wE49IstXIGEQz8MT50/hOq5EumX16FCpup0r5DVyfqNQ==", "dependencies": { - "@aws-sdk/types": "3.692.0", + "@smithy/types": "^1.2.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/middleware-stack": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-1.1.0.tgz", + "integrity": "sha512-XynYiIvXNea2BbLcppvpNK0zu8o2woJqgnmxqYTn4FWagH/Hr2QIk8LOsUz7BIJ4tooFhmx8urHKCdlPbbPDCA==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/node-config-provider": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-1.1.0.tgz", + "integrity": "sha512-2G4TlzUnmTrUY26VKTonQqydwb+gtM/mcl+TqDP8CnWtJKVL8ElPpKgLGScP04bPIRY9x2/10lDdoaRXDqPuCw==", + "dependencies": { + "@smithy/property-provider": "^1.2.0", + "@smithy/shared-ini-file-loader": "^1.1.0", + "@smithy/types": "^1.2.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/node-http-handler": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-1.1.0.tgz", + "integrity": "sha512-d3kRriEgaIiGXLziAM8bjnaLn1fthCJeTLZIwEIpzQqe6yPX0a+yQoLCTyjb2fvdLwkMoG4p7THIIB5cj5lkbg==", + "dependencies": { + "@smithy/abort-controller": "^1.1.0", + "@smithy/protocol-http": "^1.2.0", + "@smithy/querystring-builder": "^1.1.0", + "@smithy/types": "^1.2.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/property-provider": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-1.2.0.tgz", + "integrity": "sha512-qlJd9gT751i4T0t/hJAyNGfESfi08Fek8QiLcysoKPgR05qHhG0OYhlaCJHhpXy4ECW0lHyjvFM1smrCLIXVfw==", + "dependencies": { + "@smithy/types": "^1.2.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/protocol-http": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-1.2.0.tgz", + "integrity": "sha512-GfGfruksi3nXdFok5RhgtOnWe5f6BndzYfmEXISD+5gAGdayFGpjWu5pIqIweTudMtse20bGbc+7MFZXT1Tb8Q==", + "dependencies": { + "@smithy/types": "^1.2.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/querystring-builder": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-1.1.0.tgz", + "integrity": "sha512-gDEi4LxIGLbdfjrjiY45QNbuDmpkwh9DX4xzrR2AzjjXpxwGyfSpbJaYhXARw9p17VH0h9UewnNQXNwaQyYMDA==", + "dependencies": { + "@smithy/types": "^1.2.0", + "@smithy/util-uri-escape": "^1.1.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/querystring-parser": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-1.1.0.tgz", + "integrity": "sha512-Lm/FZu2qW3XX+kZ4WPwr+7aAeHf1Lm84UjNkKyBu16XbmEV7ukfhXni2aIwS2rcVf8Yv5E7wchGGpOFldj9V4Q==", + "dependencies": { + "@smithy/types": "^1.2.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/service-error-classification": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-1.1.0.tgz", + "integrity": "sha512-OCTEeJ1igatd5kFrS2VDlYbainNNpf7Lj1siFOxnRWqYOP9oNvC5HOJBd3t+Z8MbrmehBtuDJ2QqeBsfeiNkww==", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/shared-ini-file-loader": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-1.1.0.tgz", + "integrity": "sha512-S/v33zvCWzFyGZGlsEF0XsZtNNR281UhR7byk3nRfsgw5lGpg51rK/zjMgulM+h6NSuXaFILaYrw1I1v4kMcuA==", + "dependencies": { + "@smithy/types": "^1.2.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/smithy-client": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-1.1.0.tgz", + "integrity": "sha512-j32SGgVhv2G9nBTmel9u3OXux8KG20ssxuFakJrEeDug3kqbl1qrGzVLCe+Eib402UDtA0Sp1a4NZ2SEXDBxag==", + "dependencies": { + "@smithy/middleware-stack": "^1.1.0", + "@smithy/types": "^1.2.0", + "@smithy/util-stream": "^1.1.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/types": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-1.2.0.tgz", + "integrity": "sha512-z1r00TvBqF3dh4aHhya7nz1HhvCg4TRmw51fjMrh5do3h+ngSstt/yKlNbHeb9QxJmFbmN8KEVSWgb1bRvfEoA==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/url-parser": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-1.1.0.tgz", + "integrity": "sha512-tpvi761kzboiLNGEWczuybMPCJh6WHB3cz9gWAG95mSyaKXmmX8ZcMxoV+irZfxDqLwZVJ22XTumu32S7Ow8aQ==", + "dependencies": { + "@smithy/querystring-parser": "^1.1.0", + "@smithy/types": "^1.2.0", + "tslib": "^2.5.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/util-base64": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-1.1.0.tgz", + "integrity": "sha512-FpYmDmVbOXAxqvoVCwqehUN0zXS+lN8V7VS9O7I8MKeVHdSTsZzlwiMEvGoyTNOXWn8luF4CTDYgNHnZViR30g==", + "dependencies": { + "@smithy/util-buffer-from": "^1.1.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/util-body-length-browser": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-1.1.0.tgz", + "integrity": "sha512-cep3ioRxzRZ2Jbp3Kly7gy6iNVefYXiT6ETt8W01RQr3uwi1YMkrbU1p3lMR4KhX/91Nrk6UOgX1RH+oIt48RQ==", + "dependencies": { + "tslib": "^2.5.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/util-body-length-node": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-1.1.0.tgz", + "integrity": "sha512-fRHRjkUuT5em4HZoshySXmB1n3HAU7IS232s+qU4TicexhyGJpXMK/2+c56ePOIa1FOK2tV1Q3J/7Mae35QVSw==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/util-buffer-from": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-1.1.0.tgz", + "integrity": "sha512-9m6NXE0ww+ra5HKHCHig20T+FAwxBAm7DIdwc/767uGWbRcY720ybgPacQNB96JMOI7xVr/CDa3oMzKmW4a+kw==", + "dependencies": { + "@smithy/is-array-buffer": "^1.1.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/util-config-provider": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-1.1.0.tgz", + "integrity": "sha512-rQ47YpNmF6Is4I9GiE3T3+0xQ+r7RKRKbmHYyGSbyep/0cSf9kteKcI0ssJTvveJ1K4QvwrxXj1tEFp/G2UqxQ==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/util-defaults-mode-browser": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-1.1.0.tgz", + "integrity": "sha512-0bWhs1e412bfC5gwPCMe8Zbz0J8UoZ/meEQdo6MYj8Ne+c+QZ+KxVjx0a1dFYOclvM33SslL9dP0odn8kfblkg==", + "dependencies": { + "@smithy/property-provider": "^1.2.0", + "@smithy/types": "^1.2.0", + "bowser": "^2.11.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/util-defaults-mode-node": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-1.1.0.tgz", + "integrity": "sha512-440e25TUH2b+TeK5CwsjYFrI9ShVOgA31CoxCKiv4ncSK4ZM68XW5opYxQmzMbRWARGEMu2XEUeBmOgMU2RLsw==", + "dependencies": { + "@smithy/config-resolver": "^1.1.0", + "@smithy/credential-provider-imds": "^1.1.0", + "@smithy/node-config-provider": "^1.1.0", + "@smithy/property-provider": "^1.2.0", + "@smithy/types": "^1.2.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/util-hex-encoding": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-1.1.0.tgz", + "integrity": "sha512-7UtIE9eH0u41zpB60Jzr0oNCQ3hMJUabMcKRUVjmyHTXiWDE4vjSqN6qlih7rCNeKGbioS7f/y2Jgym4QZcKFg==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/util-middleware": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-1.1.0.tgz", + "integrity": "sha512-6hhckcBqVgjWAqLy2vqlPZ3rfxLDhFWEmM7oLh2POGvsi7j0tHkbN7w4DFhuBExVJAbJ/qqxqZdRY6Fu7/OezQ==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/util-retry": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-1.1.0.tgz", + "integrity": "sha512-ygQW5HBqYXpR3ua09UciS0sL7UGJzGiktrKkOuEJwARoUuzz40yaEGU6xd9Gs7KBmAaFC8gMfnghHtwZ2nyBCQ==", + "dependencies": { + "@smithy/service-error-classification": "^1.1.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/util-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-1.1.0.tgz", + "integrity": "sha512-w3lsdGsntaLQIrwDWJkIFKrFscgZXwU/oxsse09aSTNv5TckPhDeYea3LhsDrU5MGAG3vprhVZAKr33S45coVA==", + "dependencies": { + "@smithy/fetch-http-handler": "^1.1.0", + "@smithy/node-http-handler": "^1.1.0", + "@smithy/types": "^1.2.0", + "@smithy/util-base64": "^1.1.0", + "@smithy/util-buffer-from": "^1.1.0", + "@smithy/util-hex-encoding": "^1.1.0", + "@smithy/util-utf8": "^1.1.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/util-uri-escape": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-1.1.0.tgz", + "integrity": "sha512-/jL/V1xdVRt5XppwiaEU8Etp5WHZj609n0xMTuehmCqdoOFbId1M+aEeDWZsQ+8JbEB/BJ6ynY2SlYmOaKtt8w==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/util-utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-1.1.0.tgz", + "integrity": "sha512-p/MYV+JmqmPyjdgyN2UxAeYDj9cBqCjp0C/NsTWnnjoZUVqoeZ6IrW915L9CAKWVECgv9lVQGc4u/yz26/bI1A==", + "dependencies": { + "@smithy/util-buffer-from": "^1.1.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/@smithy/util-waiter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-waiter/-/util-waiter-1.1.0.tgz", + "integrity": "sha512-S6FNIB3UJT+5Efd/0DeziO5Rs82QAMODHW4v2V3oNRrwaBigY/7Yx3SiLudZuF9WpVsV08Ih3BjIH34nzZiinQ==", + "dependencies": { + "@smithy/abort-controller": "^1.1.0", + "@smithy/types": "^1.2.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/fast-xml-parser": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.2.5.tgz", + "integrity": "sha512-B9/wizE4WngqQftFPmdaMYlXoJlJOYxGQOanC77fq9k8+Z0v5dDSVh+3glErdIROP//s/jgb7ZuxKfB8nVyo0g==", + "funding": [ + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + }, + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, + "node_modules/@amzn/sagemaker-client/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/@aws-crypto/crc32": { + "version": "5.2.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/util": "^5.2.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-crypto/crc32c": { + "version": "5.2.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/util": "^5.2.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-crypto/ie11-detection": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/ie11-detection/-/ie11-detection-3.0.0.tgz", + "integrity": "sha512-341lBBkiY1DfDNKai/wXM3aujNBkXR7tq1URPQDL9wi3AUbI80NR74uF1TXHMm7po1AcnFk8iu2S2IeU/+/A+Q==", + "dependencies": { + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/ie11-detection/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@aws-crypto/sha1-browser": { + "version": "5.2.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/supports-web-crypto": "^5.2.0", + "@aws-crypto/util": "^5.2.0", + "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-locate-window": "^3.0.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-crypto/sha256-browser": { + "version": "5.2.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-js": "^5.2.0", + "@aws-crypto/supports-web-crypto": "^5.2.0", + "@aws-crypto/util": "^5.2.0", + "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-locate-window": "^3.0.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-crypto/sha256-js": { + "version": "5.2.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/util": "^5.2.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-crypto/supports-web-crypto": { + "version": "5.2.0", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-crypto/util": { + "version": "5.2.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "^3.222.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/client-api-gateway": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.693.0", + "@aws-sdk/client-sts": "3.693.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-node": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-sdk-api-gateway": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-stream": "^3.3.0", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/client-sso": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/client-sso-oidc": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-node": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.693.0" + } + }, + "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/client-sts": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.693.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-node": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/core": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/core": "^2.5.2", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/property-provider": "^3.1.9", + "@smithy/protocol-http": "^4.1.6", + "@smithy/signature-v4": "^4.2.2", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/util-middleware": "^3.0.9", + "fast-xml-parser": "4.4.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/credential-provider-http": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/util-stream": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-env": "3.693.0", + "@aws-sdk/credential-provider-http": "3.693.0", + "@aws-sdk/credential-provider-process": "3.693.0", + "@aws-sdk/credential-provider-sso": "3.693.0", + "@aws-sdk/credential-provider-web-identity": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/credential-provider-imds": "^3.2.6", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.693.0" + } + }, + "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/credential-provider-node": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.693.0", + "@aws-sdk/credential-provider-http": "3.693.0", + "@aws-sdk/credential-provider-ini": "3.693.0", + "@aws-sdk/credential-provider-process": "3.693.0", + "@aws-sdk/credential-provider-sso": "3.693.0", + "@aws-sdk/credential-provider-web-identity": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/credential-provider-imds": "^3.2.6", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/client-sso": "3.693.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/token-providers": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.693.0" + } + }, + "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/middleware-host-header": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/middleware-logger": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@smithy/core": "^2.5.2", + "@smithy/protocol-http": "^4.1.6", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/region-config-resolver": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/types": "^3.7.0", + "@smithy/util-config-provider": "^3.0.0", + "@smithy/util-middleware": "^3.0.9", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/token-providers": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sso-oidc": "^3.693.0" + } + }, + "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/util-endpoints": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/types": "^3.7.0", + "@smithy/util-endpoints": "^2.1.5", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/types": "^3.7.0", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } + } + }, + "node_modules/@aws-sdk/client-api-gateway/node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-api-gateway/node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/is-array-buffer": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-api-gateway/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-apprunner": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.693.0", + "@aws-sdk/client-sts": "3.693.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-node": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/client-sso": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/client-sso-oidc": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-node": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.693.0" + } + }, + "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/client-sts": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.693.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-node": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/core": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/core": "^2.5.2", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/property-provider": "^3.1.9", + "@smithy/protocol-http": "^4.1.6", + "@smithy/signature-v4": "^4.2.2", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/util-middleware": "^3.0.9", + "fast-xml-parser": "4.4.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/credential-provider-http": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/util-stream": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-env": "3.693.0", + "@aws-sdk/credential-provider-http": "3.693.0", + "@aws-sdk/credential-provider-process": "3.693.0", + "@aws-sdk/credential-provider-sso": "3.693.0", + "@aws-sdk/credential-provider-web-identity": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/credential-provider-imds": "^3.2.6", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.693.0" + } + }, + "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/credential-provider-node": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.693.0", + "@aws-sdk/credential-provider-http": "3.693.0", + "@aws-sdk/credential-provider-ini": "3.693.0", + "@aws-sdk/credential-provider-process": "3.693.0", + "@aws-sdk/credential-provider-sso": "3.693.0", + "@aws-sdk/credential-provider-web-identity": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/credential-provider-imds": "^3.2.6", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/client-sso": "3.693.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/token-providers": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.693.0" + } + }, + "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/middleware-host-header": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/middleware-logger": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@smithy/core": "^2.5.2", + "@smithy/protocol-http": "^4.1.6", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/region-config-resolver": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/types": "^3.7.0", + "@smithy/util-config-provider": "^3.0.0", + "@smithy/util-middleware": "^3.0.9", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/token-providers": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sso-oidc": "^3.693.0" + } + }, + "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/util-endpoints": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/types": "^3.7.0", + "@smithy/util-endpoints": "^2.1.5", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/types": "^3.7.0", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } + } + }, + "node_modules/@aws-sdk/client-apprunner/node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-apprunner/node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/is-array-buffer": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-apprunner/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.693.0", + "@aws-sdk/client-sts": "3.693.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-node": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", + "@smithy/util-waiter": "^3.1.8", + "@types/uuid": "^9.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/client-sso": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/client-sso-oidc": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-node": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.693.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/client-sts": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.693.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-node": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/core": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/core": "^2.5.2", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/property-provider": "^3.1.9", + "@smithy/protocol-http": "^4.1.6", + "@smithy/signature-v4": "^4.2.2", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/util-middleware": "^3.0.9", + "fast-xml-parser": "4.4.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/credential-provider-http": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/util-stream": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-env": "3.693.0", + "@aws-sdk/credential-provider-http": "3.693.0", + "@aws-sdk/credential-provider-process": "3.693.0", + "@aws-sdk/credential-provider-sso": "3.693.0", + "@aws-sdk/credential-provider-web-identity": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/credential-provider-imds": "^3.2.6", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.693.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/credential-provider-node": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.693.0", + "@aws-sdk/credential-provider-http": "3.693.0", + "@aws-sdk/credential-provider-ini": "3.693.0", + "@aws-sdk/credential-provider-process": "3.693.0", + "@aws-sdk/credential-provider-sso": "3.693.0", + "@aws-sdk/credential-provider-web-identity": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/credential-provider-imds": "^3.2.6", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/client-sso": "3.693.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/token-providers": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.693.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/middleware-host-header": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/middleware-logger": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@smithy/core": "^2.5.2", + "@smithy/protocol-http": "^4.1.6", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/region-config-resolver": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/types": "^3.7.0", + "@smithy/util-config-provider": "^3.0.0", + "@smithy/util-middleware": "^3.0.9", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/token-providers": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sso-oidc": "^3.693.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/util-endpoints": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/types": "^3.7.0", + "@smithy/util-endpoints": "^2.1.5", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/types": "^3.7.0", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/is-array-buffer": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudformation": { + "version": "3.682.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.682.0", + "@aws-sdk/client-sts": "3.682.0", + "@aws-sdk/core": "3.679.0", + "@aws-sdk/credential-provider-node": "3.682.0", + "@aws-sdk/middleware-host-header": "3.679.0", + "@aws-sdk/middleware-logger": "3.679.0", + "@aws-sdk/middleware-recursion-detection": "3.679.0", + "@aws-sdk/middleware-user-agent": "3.682.0", + "@aws-sdk/region-config-resolver": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@aws-sdk/util-endpoints": "3.679.0", + "@aws-sdk/util-user-agent-browser": "3.679.0", + "@aws-sdk/util-user-agent-node": "3.682.0", + "@smithy/config-resolver": "^3.0.9", + "@smithy/core": "^2.4.8", + "@smithy/fetch-http-handler": "^3.2.9", + "@smithy/hash-node": "^3.0.7", + "@smithy/invalid-dependency": "^3.0.7", + "@smithy/middleware-content-length": "^3.0.9", + "@smithy/middleware-endpoint": "^3.1.4", + "@smithy/middleware-retry": "^3.0.23", + "@smithy/middleware-serde": "^3.0.7", + "@smithy/middleware-stack": "^3.0.7", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/node-http-handler": "^3.2.4", + "@smithy/protocol-http": "^4.1.4", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/url-parser": "^3.0.7", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.23", + "@smithy/util-defaults-mode-node": "^3.0.23", + "@smithy/util-endpoints": "^2.1.3", + "@smithy/util-middleware": "^3.0.7", + "@smithy/util-retry": "^3.0.7", + "@smithy/util-utf8": "^3.0.0", + "@smithy/util-waiter": "^3.1.6", + "@types/uuid": "^9.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/client-sso": { + "version": "3.682.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.679.0", + "@aws-sdk/middleware-host-header": "3.679.0", + "@aws-sdk/middleware-logger": "3.679.0", + "@aws-sdk/middleware-recursion-detection": "3.679.0", + "@aws-sdk/middleware-user-agent": "3.682.0", + "@aws-sdk/region-config-resolver": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@aws-sdk/util-endpoints": "3.679.0", + "@aws-sdk/util-user-agent-browser": "3.679.0", + "@aws-sdk/util-user-agent-node": "3.682.0", + "@smithy/config-resolver": "^3.0.9", + "@smithy/core": "^2.4.8", + "@smithy/fetch-http-handler": "^3.2.9", + "@smithy/hash-node": "^3.0.7", + "@smithy/invalid-dependency": "^3.0.7", + "@smithy/middleware-content-length": "^3.0.9", + "@smithy/middleware-endpoint": "^3.1.4", + "@smithy/middleware-retry": "^3.0.23", + "@smithy/middleware-serde": "^3.0.7", + "@smithy/middleware-stack": "^3.0.7", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/node-http-handler": "^3.2.4", + "@smithy/protocol-http": "^4.1.4", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/url-parser": "^3.0.7", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.23", + "@smithy/util-defaults-mode-node": "^3.0.23", + "@smithy/util-endpoints": "^2.1.3", + "@smithy/util-middleware": "^3.0.7", + "@smithy/util-retry": "^3.0.7", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/client-sso-oidc": { + "version": "3.682.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.679.0", + "@aws-sdk/credential-provider-node": "3.682.0", + "@aws-sdk/middleware-host-header": "3.679.0", + "@aws-sdk/middleware-logger": "3.679.0", + "@aws-sdk/middleware-recursion-detection": "3.679.0", + "@aws-sdk/middleware-user-agent": "3.682.0", + "@aws-sdk/region-config-resolver": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@aws-sdk/util-endpoints": "3.679.0", + "@aws-sdk/util-user-agent-browser": "3.679.0", + "@aws-sdk/util-user-agent-node": "3.682.0", + "@smithy/config-resolver": "^3.0.9", + "@smithy/core": "^2.4.8", + "@smithy/fetch-http-handler": "^3.2.9", + "@smithy/hash-node": "^3.0.7", + "@smithy/invalid-dependency": "^3.0.7", + "@smithy/middleware-content-length": "^3.0.9", + "@smithy/middleware-endpoint": "^3.1.4", + "@smithy/middleware-retry": "^3.0.23", + "@smithy/middleware-serde": "^3.0.7", + "@smithy/middleware-stack": "^3.0.7", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/node-http-handler": "^3.2.4", + "@smithy/protocol-http": "^4.1.4", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/url-parser": "^3.0.7", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.23", + "@smithy/util-defaults-mode-node": "^3.0.23", + "@smithy/util-endpoints": "^2.1.3", + "@smithy/util-middleware": "^3.0.7", + "@smithy/util-retry": "^3.0.7", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.682.0" + } + }, + "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/client-sts": { + "version": "3.682.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.682.0", + "@aws-sdk/core": "3.679.0", + "@aws-sdk/credential-provider-node": "3.682.0", + "@aws-sdk/middleware-host-header": "3.679.0", + "@aws-sdk/middleware-logger": "3.679.0", + "@aws-sdk/middleware-recursion-detection": "3.679.0", + "@aws-sdk/middleware-user-agent": "3.682.0", + "@aws-sdk/region-config-resolver": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@aws-sdk/util-endpoints": "3.679.0", + "@aws-sdk/util-user-agent-browser": "3.679.0", + "@aws-sdk/util-user-agent-node": "3.682.0", + "@smithy/config-resolver": "^3.0.9", + "@smithy/core": "^2.4.8", + "@smithy/fetch-http-handler": "^3.2.9", + "@smithy/hash-node": "^3.0.7", + "@smithy/invalid-dependency": "^3.0.7", + "@smithy/middleware-content-length": "^3.0.9", + "@smithy/middleware-endpoint": "^3.1.4", + "@smithy/middleware-retry": "^3.0.23", + "@smithy/middleware-serde": "^3.0.7", + "@smithy/middleware-stack": "^3.0.7", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/node-http-handler": "^3.2.4", + "@smithy/protocol-http": "^4.1.4", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/url-parser": "^3.0.7", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.23", + "@smithy/util-defaults-mode-node": "^3.0.23", + "@smithy/util-endpoints": "^2.1.3", + "@smithy/util-middleware": "^3.0.7", + "@smithy/util-retry": "^3.0.7", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/core": { + "version": "3.679.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.679.0", + "@smithy/core": "^2.4.8", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/property-provider": "^3.1.7", + "@smithy/protocol-http": "^4.1.4", + "@smithy/signature-v4": "^4.2.0", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/util-middleware": "^3.0.7", + "fast-xml-parser": "4.4.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/credential-provider-env": { + "version": "3.679.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@smithy/property-provider": "^3.1.7", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/credential-provider-http": { + "version": "3.679.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@smithy/fetch-http-handler": "^3.2.9", + "@smithy/node-http-handler": "^3.2.4", + "@smithy/property-provider": "^3.1.7", + "@smithy/protocol-http": "^4.1.4", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/util-stream": "^3.1.9", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.682.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.679.0", + "@aws-sdk/credential-provider-env": "3.679.0", + "@aws-sdk/credential-provider-http": "3.679.0", + "@aws-sdk/credential-provider-process": "3.679.0", + "@aws-sdk/credential-provider-sso": "3.682.0", + "@aws-sdk/credential-provider-web-identity": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@smithy/credential-provider-imds": "^3.2.4", + "@smithy/property-provider": "^3.1.7", + "@smithy/shared-ini-file-loader": "^3.1.8", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.682.0" + } + }, + "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/credential-provider-node": { + "version": "3.682.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.679.0", + "@aws-sdk/credential-provider-http": "3.679.0", + "@aws-sdk/credential-provider-ini": "3.682.0", + "@aws-sdk/credential-provider-process": "3.679.0", + "@aws-sdk/credential-provider-sso": "3.682.0", + "@aws-sdk/credential-provider-web-identity": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@smithy/credential-provider-imds": "^3.2.4", + "@smithy/property-provider": "^3.1.7", + "@smithy/shared-ini-file-loader": "^3.1.8", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/credential-provider-process": { + "version": "3.679.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@smithy/property-provider": "^3.1.7", + "@smithy/shared-ini-file-loader": "^3.1.8", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.682.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/client-sso": "3.682.0", + "@aws-sdk/core": "3.679.0", + "@aws-sdk/token-providers": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@smithy/property-provider": "^3.1.7", + "@smithy/shared-ini-file-loader": "^3.1.8", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.679.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@smithy/property-provider": "^3.1.7", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.679.0" + } + }, + "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/middleware-host-header": { + "version": "3.679.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.679.0", + "@smithy/protocol-http": "^4.1.4", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/middleware-logger": { + "version": "3.679.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.679.0", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.679.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.679.0", + "@smithy/protocol-http": "^4.1.4", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.682.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@aws-sdk/util-endpoints": "3.679.0", + "@smithy/core": "^2.4.8", + "@smithy/protocol-http": "^4.1.4", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/region-config-resolver": { + "version": "3.679.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.679.0", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/types": "^3.5.0", + "@smithy/util-config-provider": "^3.0.0", + "@smithy/util-middleware": "^3.0.7", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/token-providers": { + "version": "3.679.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.679.0", + "@smithy/property-provider": "^3.1.7", + "@smithy/shared-ini-file-loader": "^3.1.8", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sso-oidc": "^3.679.0" + } + }, + "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/types": { + "version": "3.679.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints": { + "version": "3.679.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.679.0", + "@smithy/types": "^3.5.0", + "@smithy/util-endpoints": "^2.1.3", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.679.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.679.0", + "@smithy/types": "^3.5.0", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.682.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/middleware-user-agent": "3.682.0", + "@aws-sdk/types": "3.679.0", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } + } + }, + "node_modules/@aws-sdk/client-cloudformation/node_modules/@smithy/fetch-http-handler": { + "version": "3.2.9", + "license": "Apache-2.0", + "dependencies": { + "@smithy/protocol-http": "^4.1.4", + "@smithy/querystring-builder": "^3.0.7", + "@smithy/types": "^3.5.0", + "@smithy/util-base64": "^3.0.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/client-cloudformation/node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudformation/node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/is-array-buffer": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudformation/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudwatch-logs": { + "version": "3.682.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.682.0", + "@aws-sdk/client-sts": "3.682.0", + "@aws-sdk/core": "3.679.0", + "@aws-sdk/credential-provider-node": "3.682.0", + "@aws-sdk/middleware-host-header": "3.679.0", + "@aws-sdk/middleware-logger": "3.679.0", + "@aws-sdk/middleware-recursion-detection": "3.679.0", + "@aws-sdk/middleware-user-agent": "3.682.0", + "@aws-sdk/region-config-resolver": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@aws-sdk/util-endpoints": "3.679.0", + "@aws-sdk/util-user-agent-browser": "3.679.0", + "@aws-sdk/util-user-agent-node": "3.682.0", + "@smithy/config-resolver": "^3.0.9", + "@smithy/core": "^2.4.8", + "@smithy/eventstream-serde-browser": "^3.0.10", + "@smithy/eventstream-serde-config-resolver": "^3.0.7", + "@smithy/eventstream-serde-node": "^3.0.9", + "@smithy/fetch-http-handler": "^3.2.9", + "@smithy/hash-node": "^3.0.7", + "@smithy/invalid-dependency": "^3.0.7", + "@smithy/middleware-content-length": "^3.0.9", + "@smithy/middleware-endpoint": "^3.1.4", + "@smithy/middleware-retry": "^3.0.23", + "@smithy/middleware-serde": "^3.0.7", + "@smithy/middleware-stack": "^3.0.7", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/node-http-handler": "^3.2.4", + "@smithy/protocol-http": "^4.1.4", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/url-parser": "^3.0.7", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.23", + "@smithy/util-defaults-mode-node": "^3.0.23", + "@smithy/util-endpoints": "^2.1.3", + "@smithy/util-middleware": "^3.0.7", + "@smithy/util-retry": "^3.0.7", + "@smithy/util-utf8": "^3.0.0", + "@types/uuid": "^9.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/client-sso": { + "version": "3.682.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.679.0", + "@aws-sdk/middleware-host-header": "3.679.0", + "@aws-sdk/middleware-logger": "3.679.0", + "@aws-sdk/middleware-recursion-detection": "3.679.0", + "@aws-sdk/middleware-user-agent": "3.682.0", + "@aws-sdk/region-config-resolver": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@aws-sdk/util-endpoints": "3.679.0", + "@aws-sdk/util-user-agent-browser": "3.679.0", + "@aws-sdk/util-user-agent-node": "3.682.0", + "@smithy/config-resolver": "^3.0.9", + "@smithy/core": "^2.4.8", + "@smithy/fetch-http-handler": "^3.2.9", + "@smithy/hash-node": "^3.0.7", + "@smithy/invalid-dependency": "^3.0.7", + "@smithy/middleware-content-length": "^3.0.9", + "@smithy/middleware-endpoint": "^3.1.4", + "@smithy/middleware-retry": "^3.0.23", + "@smithy/middleware-serde": "^3.0.7", + "@smithy/middleware-stack": "^3.0.7", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/node-http-handler": "^3.2.4", + "@smithy/protocol-http": "^4.1.4", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/url-parser": "^3.0.7", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.23", + "@smithy/util-defaults-mode-node": "^3.0.23", + "@smithy/util-endpoints": "^2.1.3", + "@smithy/util-middleware": "^3.0.7", + "@smithy/util-retry": "^3.0.7", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/client-sso-oidc": { + "version": "3.682.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.679.0", + "@aws-sdk/credential-provider-node": "3.682.0", + "@aws-sdk/middleware-host-header": "3.679.0", + "@aws-sdk/middleware-logger": "3.679.0", + "@aws-sdk/middleware-recursion-detection": "3.679.0", + "@aws-sdk/middleware-user-agent": "3.682.0", + "@aws-sdk/region-config-resolver": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@aws-sdk/util-endpoints": "3.679.0", + "@aws-sdk/util-user-agent-browser": "3.679.0", + "@aws-sdk/util-user-agent-node": "3.682.0", + "@smithy/config-resolver": "^3.0.9", + "@smithy/core": "^2.4.8", + "@smithy/fetch-http-handler": "^3.2.9", + "@smithy/hash-node": "^3.0.7", + "@smithy/invalid-dependency": "^3.0.7", + "@smithy/middleware-content-length": "^3.0.9", + "@smithy/middleware-endpoint": "^3.1.4", + "@smithy/middleware-retry": "^3.0.23", + "@smithy/middleware-serde": "^3.0.7", + "@smithy/middleware-stack": "^3.0.7", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/node-http-handler": "^3.2.4", + "@smithy/protocol-http": "^4.1.4", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/url-parser": "^3.0.7", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.23", + "@smithy/util-defaults-mode-node": "^3.0.23", + "@smithy/util-endpoints": "^2.1.3", + "@smithy/util-middleware": "^3.0.7", + "@smithy/util-retry": "^3.0.7", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.682.0" + } + }, + "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/client-sts": { + "version": "3.682.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.682.0", + "@aws-sdk/core": "3.679.0", + "@aws-sdk/credential-provider-node": "3.682.0", + "@aws-sdk/middleware-host-header": "3.679.0", + "@aws-sdk/middleware-logger": "3.679.0", + "@aws-sdk/middleware-recursion-detection": "3.679.0", + "@aws-sdk/middleware-user-agent": "3.682.0", + "@aws-sdk/region-config-resolver": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@aws-sdk/util-endpoints": "3.679.0", + "@aws-sdk/util-user-agent-browser": "3.679.0", + "@aws-sdk/util-user-agent-node": "3.682.0", + "@smithy/config-resolver": "^3.0.9", + "@smithy/core": "^2.4.8", + "@smithy/fetch-http-handler": "^3.2.9", + "@smithy/hash-node": "^3.0.7", + "@smithy/invalid-dependency": "^3.0.7", + "@smithy/middleware-content-length": "^3.0.9", + "@smithy/middleware-endpoint": "^3.1.4", + "@smithy/middleware-retry": "^3.0.23", + "@smithy/middleware-serde": "^3.0.7", + "@smithy/middleware-stack": "^3.0.7", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/node-http-handler": "^3.2.4", + "@smithy/protocol-http": "^4.1.4", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/url-parser": "^3.0.7", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.23", + "@smithy/util-defaults-mode-node": "^3.0.23", + "@smithy/util-endpoints": "^2.1.3", + "@smithy/util-middleware": "^3.0.7", + "@smithy/util-retry": "^3.0.7", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/core": { + "version": "3.679.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.679.0", + "@smithy/core": "^2.4.8", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/property-provider": "^3.1.7", + "@smithy/protocol-http": "^4.1.4", + "@smithy/signature-v4": "^4.2.0", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/util-middleware": "^3.0.7", + "fast-xml-parser": "4.4.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/credential-provider-env": { + "version": "3.679.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@smithy/property-provider": "^3.1.7", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/credential-provider-http": { + "version": "3.679.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@smithy/fetch-http-handler": "^3.2.9", + "@smithy/node-http-handler": "^3.2.4", + "@smithy/property-provider": "^3.1.7", + "@smithy/protocol-http": "^4.1.4", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/util-stream": "^3.1.9", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.682.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.679.0", + "@aws-sdk/credential-provider-env": "3.679.0", + "@aws-sdk/credential-provider-http": "3.679.0", + "@aws-sdk/credential-provider-process": "3.679.0", + "@aws-sdk/credential-provider-sso": "3.682.0", + "@aws-sdk/credential-provider-web-identity": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@smithy/credential-provider-imds": "^3.2.4", + "@smithy/property-provider": "^3.1.7", + "@smithy/shared-ini-file-loader": "^3.1.8", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.682.0" + } + }, + "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/credential-provider-node": { + "version": "3.682.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.679.0", + "@aws-sdk/credential-provider-http": "3.679.0", + "@aws-sdk/credential-provider-ini": "3.682.0", + "@aws-sdk/credential-provider-process": "3.679.0", + "@aws-sdk/credential-provider-sso": "3.682.0", + "@aws-sdk/credential-provider-web-identity": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@smithy/credential-provider-imds": "^3.2.4", + "@smithy/property-provider": "^3.1.7", + "@smithy/shared-ini-file-loader": "^3.1.8", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/credential-provider-process": { + "version": "3.679.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@smithy/property-provider": "^3.1.7", + "@smithy/shared-ini-file-loader": "^3.1.8", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.682.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/client-sso": "3.682.0", + "@aws-sdk/core": "3.679.0", + "@aws-sdk/token-providers": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@smithy/property-provider": "^3.1.7", + "@smithy/shared-ini-file-loader": "^3.1.8", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.679.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@smithy/property-provider": "^3.1.7", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.679.0" + } + }, + "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/middleware-host-header": { + "version": "3.679.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.679.0", + "@smithy/protocol-http": "^4.1.4", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/middleware-logger": { + "version": "3.679.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.679.0", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.679.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.679.0", + "@smithy/protocol-http": "^4.1.4", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.682.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@aws-sdk/util-endpoints": "3.679.0", + "@smithy/core": "^2.4.8", + "@smithy/protocol-http": "^4.1.4", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/region-config-resolver": { + "version": "3.679.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.679.0", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/types": "^3.5.0", + "@smithy/util-config-provider": "^3.0.0", + "@smithy/util-middleware": "^3.0.7", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/token-providers": { + "version": "3.679.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.679.0", + "@smithy/property-provider": "^3.1.7", + "@smithy/shared-ini-file-loader": "^3.1.8", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sso-oidc": "^3.679.0" + } + }, + "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/types": { + "version": "3.679.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/util-endpoints": { + "version": "3.679.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.679.0", + "@smithy/types": "^3.5.0", + "@smithy/util-endpoints": "^2.1.3", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.679.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.679.0", + "@smithy/types": "^3.5.0", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.682.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/middleware-user-agent": "3.682.0", + "@aws-sdk/types": "3.679.0", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } + } + }, + "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@smithy/fetch-http-handler": { + "version": "3.2.9", + "license": "Apache-2.0", + "dependencies": { + "@smithy/protocol-http": "^4.1.4", + "@smithy/querystring-builder": "^3.0.7", + "@smithy/types": "^3.5.0", + "@smithy/util-base64": "^3.0.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/is-array-buffer": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/token-providers": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", + "@types/uuid": "^9.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso": { + "version": "3.758.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/middleware-host-header": "3.734.0", + "@aws-sdk/middleware-logger": "3.734.0", + "@aws-sdk/middleware-recursion-detection": "3.734.0", + "@aws-sdk/middleware-user-agent": "3.758.0", + "@aws-sdk/region-config-resolver": "3.734.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-endpoints": "3.743.0", + "@aws-sdk/util-user-agent-browser": "3.734.0", + "@aws-sdk/util-user-agent-node": "3.758.0", + "@smithy/config-resolver": "^4.0.1", + "@smithy/core": "^3.1.5", + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/hash-node": "^4.0.1", + "@smithy/invalid-dependency": "^4.0.1", + "@smithy/middleware-content-length": "^4.0.1", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-retry": "^4.0.7", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/node-http-handler": "^4.0.3", + "@smithy/protocol-http": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.7", + "@smithy/util-defaults-mode-node": "^4.0.7", + "@smithy/util-endpoints": "^3.0.1", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-retry": "^4.0.1", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc": { + "version": "3.758.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/credential-provider-node": "3.758.0", + "@aws-sdk/middleware-host-header": "3.734.0", + "@aws-sdk/middleware-logger": "3.734.0", + "@aws-sdk/middleware-recursion-detection": "3.734.0", + "@aws-sdk/middleware-user-agent": "3.758.0", + "@aws-sdk/region-config-resolver": "3.734.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-endpoints": "3.743.0", + "@aws-sdk/util-user-agent-browser": "3.734.0", + "@aws-sdk/util-user-agent-node": "3.758.0", + "@smithy/config-resolver": "^4.0.1", + "@smithy/core": "^3.1.5", + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/hash-node": "^4.0.1", + "@smithy/invalid-dependency": "^4.0.1", + "@smithy/middleware-content-length": "^4.0.1", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-retry": "^4.0.7", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/node-http-handler": "^4.0.3", + "@smithy/protocol-http": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.7", + "@smithy/util-defaults-mode-node": "^4.0.7", + "@smithy/util-endpoints": "^3.0.1", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-retry": "^4.0.1", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/core": { + "version": "3.758.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/core": "^3.1.5", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/signature-v4": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/util-middleware": "^4.0.1", + "fast-xml-parser": "4.4.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/middleware-host-header": { + "version": "3.734.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/middleware-logger": { + "version": "3.734.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.734.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.758.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/core": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-endpoints": "3.743.0", + "@smithy/core": "^3.1.5", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/region-config-resolver": { + "version": "3.734.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-config-provider": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/types": { + "version": "3.734.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/util-endpoints": { + "version": "3.743.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/types": "^4.1.0", + "@smithy/util-endpoints": "^3.0.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.734.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/types": "^4.1.0", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.758.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/middleware-user-agent": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/config-resolver": { + "version": "4.0.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-config-provider": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/core": { + "version": "3.1.5", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/middleware-serde": "^4.0.2", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-stream": "^4.1.2", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/fetch-http-handler": { + "version": "5.0.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/protocol-http": "^5.0.1", + "@smithy/querystring-builder": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-base64": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/hash-node": { + "version": "4.0.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^4.1.0", + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/invalid-dependency": { + "version": "4.0.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/middleware-content-length": { + "version": "4.0.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/middleware-endpoint": { + "version": "4.0.6", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/core": "^3.1.5", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-middleware": "^4.0.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/middleware-retry": { + "version": "4.0.7", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/node-config-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/service-error-classification": "^4.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-retry": "^4.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/middleware-serde": { + "version": "4.0.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/middleware-stack": { + "version": "4.0.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/node-config-provider": { + "version": "4.0.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/node-http-handler": { + "version": "4.0.3", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/abort-controller": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/querystring-builder": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/property-provider": { + "version": "4.0.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/protocol-http": { + "version": "5.0.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/shared-ini-file-loader": { + "version": "4.0.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/signature-v4": { + "version": "5.0.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/is-array-buffer": "^4.0.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-hex-encoding": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-uri-escape": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/smithy-client": { + "version": "4.1.6", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/core": "^3.1.5", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-stream": "^4.1.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/types": { + "version": "4.1.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/url-parser": { + "version": "4.0.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/querystring-parser": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-base64": { + "version": "4.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-body-length-browser": { + "version": "4.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-body-length-node": { + "version": "4.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-config-provider": { + "version": "4.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-defaults-mode-browser": { + "version": "4.0.7", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/property-provider": "^4.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", "bowser": "^2.11.0", "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-defaults-mode-node": { + "version": "4.0.7", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/config-resolver": "^4.0.1", + "@smithy/credential-provider-imds": "^4.0.1", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-endpoints": { + "version": "3.0.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-middleware": { + "version": "4.0.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-retry": { + "version": "4.0.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/service-error-classification": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-utf8": { + "version": "4.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/util-buffer-from": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/core": { + "version": "3.758.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/core": "^3.1.5", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/signature-v4": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/util-middleware": "^4.0.1", + "fast-xml-parser": "4.4.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-api-gateway/node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/middleware-host-header": { + "version": "3.734.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/middleware-user-agent": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/types": "^3.7.0", + "@aws-sdk/types": "3.734.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/middleware-logger": { + "version": "3.734.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" }, - "peerDependencies": { - "aws-crt": ">=1.0.0" + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.734.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" }, - "peerDependenciesMeta": { - "aws-crt": { - "optional": true - } + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-api-gateway/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.758.0", "license": "Apache-2.0", + "peer": true, "dependencies": { + "@aws-sdk/core": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-endpoints": "3.743.0", + "@smithy/core": "^3.1.5", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-api-gateway/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/region-config-resolver": { + "version": "3.734.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", + "@aws-sdk/types": "3.734.0", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-config-provider": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-api-gateway/node_modules/@smithy/util-utf8": { - "version": "3.0.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/types": { + "version": "3.734.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-apprunner": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/util-endpoints": { + "version": "3.743.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.693.0", - "@aws-sdk/client-sts": "3.693.0", - "@aws-sdk/core": "3.693.0", - "@aws-sdk/credential-provider-node": "3.693.0", - "@aws-sdk/middleware-host-header": "3.693.0", - "@aws-sdk/middleware-logger": "3.693.0", - "@aws-sdk/middleware-recursion-detection": "3.693.0", - "@aws-sdk/middleware-user-agent": "3.693.0", - "@aws-sdk/region-config-resolver": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@aws-sdk/util-endpoints": "3.693.0", - "@aws-sdk/util-user-agent-browser": "3.693.0", - "@aws-sdk/util-user-agent-node": "3.693.0", - "@smithy/config-resolver": "^3.0.11", - "@smithy/core": "^2.5.2", - "@smithy/fetch-http-handler": "^4.1.0", - "@smithy/hash-node": "^3.0.9", - "@smithy/invalid-dependency": "^3.0.9", - "@smithy/middleware-content-length": "^3.0.11", - "@smithy/middleware-endpoint": "^3.2.2", - "@smithy/middleware-retry": "^3.0.26", - "@smithy/middleware-serde": "^3.0.9", - "@smithy/middleware-stack": "^3.0.9", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/node-http-handler": "^3.3.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/url-parser": "^3.0.9", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.26", - "@smithy/util-defaults-mode-node": "^3.0.26", - "@smithy/util-endpoints": "^2.1.5", - "@smithy/util-middleware": "^3.0.9", - "@smithy/util-retry": "^3.0.9", - "@smithy/util-utf8": "^3.0.0", + "@aws-sdk/types": "3.734.0", + "@smithy/types": "^4.1.0", + "@smithy/util-endpoints": "^3.0.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/client-sso": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.734.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.693.0", - "@aws-sdk/middleware-host-header": "3.693.0", - "@aws-sdk/middleware-logger": "3.693.0", - "@aws-sdk/middleware-recursion-detection": "3.693.0", - "@aws-sdk/middleware-user-agent": "3.693.0", - "@aws-sdk/region-config-resolver": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@aws-sdk/util-endpoints": "3.693.0", - "@aws-sdk/util-user-agent-browser": "3.693.0", - "@aws-sdk/util-user-agent-node": "3.693.0", - "@smithy/config-resolver": "^3.0.11", - "@smithy/core": "^2.5.2", - "@smithy/fetch-http-handler": "^4.1.0", - "@smithy/hash-node": "^3.0.9", - "@smithy/invalid-dependency": "^3.0.9", - "@smithy/middleware-content-length": "^3.0.11", - "@smithy/middleware-endpoint": "^3.2.2", - "@smithy/middleware-retry": "^3.0.26", - "@smithy/middleware-serde": "^3.0.9", - "@smithy/middleware-stack": "^3.0.9", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/node-http-handler": "^3.3.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/url-parser": "^3.0.9", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.26", - "@smithy/util-defaults-mode-node": "^3.0.26", - "@smithy/util-endpoints": "^2.1.5", - "@smithy/util-middleware": "^3.0.9", - "@smithy/util-retry": "^3.0.9", - "@smithy/util-utf8": "^3.0.0", + "@aws-sdk/types": "3.734.0", + "@smithy/types": "^4.1.0", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.758.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/middleware-user-agent": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } } }, - "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/client-sso-oidc": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/config-resolver": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.693.0", - "@aws-sdk/credential-provider-node": "3.693.0", - "@aws-sdk/middleware-host-header": "3.693.0", - "@aws-sdk/middleware-logger": "3.693.0", - "@aws-sdk/middleware-recursion-detection": "3.693.0", - "@aws-sdk/middleware-user-agent": "3.693.0", - "@aws-sdk/region-config-resolver": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@aws-sdk/util-endpoints": "3.693.0", - "@aws-sdk/util-user-agent-browser": "3.693.0", - "@aws-sdk/util-user-agent-node": "3.693.0", - "@smithy/config-resolver": "^3.0.11", - "@smithy/core": "^2.5.2", - "@smithy/fetch-http-handler": "^4.1.0", - "@smithy/hash-node": "^3.0.9", - "@smithy/invalid-dependency": "^3.0.9", - "@smithy/middleware-content-length": "^3.0.11", - "@smithy/middleware-endpoint": "^3.2.2", - "@smithy/middleware-retry": "^3.0.26", - "@smithy/middleware-serde": "^3.0.9", - "@smithy/middleware-stack": "^3.0.9", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/node-http-handler": "^3.3.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/url-parser": "^3.0.9", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.26", - "@smithy/util-defaults-mode-node": "^3.0.26", - "@smithy/util-endpoints": "^2.1.5", - "@smithy/util-middleware": "^3.0.9", - "@smithy/util-retry": "^3.0.9", - "@smithy/util-utf8": "^3.0.0", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-config-provider": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/core": { + "version": "3.1.5", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/middleware-serde": "^4.0.2", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-stream": "^4.1.2", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.693.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/client-sts": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/fetch-http-handler": { + "version": "5.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.693.0", - "@aws-sdk/core": "3.693.0", - "@aws-sdk/credential-provider-node": "3.693.0", - "@aws-sdk/middleware-host-header": "3.693.0", - "@aws-sdk/middleware-logger": "3.693.0", - "@aws-sdk/middleware-recursion-detection": "3.693.0", - "@aws-sdk/middleware-user-agent": "3.693.0", - "@aws-sdk/region-config-resolver": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@aws-sdk/util-endpoints": "3.693.0", - "@aws-sdk/util-user-agent-browser": "3.693.0", - "@aws-sdk/util-user-agent-node": "3.693.0", - "@smithy/config-resolver": "^3.0.11", - "@smithy/core": "^2.5.2", - "@smithy/fetch-http-handler": "^4.1.0", - "@smithy/hash-node": "^3.0.9", - "@smithy/invalid-dependency": "^3.0.9", - "@smithy/middleware-content-length": "^3.0.11", - "@smithy/middleware-endpoint": "^3.2.2", - "@smithy/middleware-retry": "^3.0.26", - "@smithy/middleware-serde": "^3.0.9", - "@smithy/middleware-stack": "^3.0.9", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/node-http-handler": "^3.3.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/url-parser": "^3.0.9", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.26", - "@smithy/util-defaults-mode-node": "^3.0.26", - "@smithy/util-endpoints": "^2.1.5", - "@smithy/util-middleware": "^3.0.9", - "@smithy/util-retry": "^3.0.9", - "@smithy/util-utf8": "^3.0.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/querystring-builder": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-base64": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/core": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/hash-node": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/core": "^2.5.2", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/property-provider": "^3.1.9", - "@smithy/protocol-http": "^4.1.6", - "@smithy/signature-v4": "^4.2.2", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/util-middleware": "^3.0.9", - "fast-xml-parser": "4.4.1", + "@smithy/types": "^4.1.0", + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/credential-provider-http": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/invalid-dependency": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/core": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/fetch-http-handler": "^4.1.0", - "@smithy/node-http-handler": "^3.3.0", - "@smithy/property-provider": "^3.1.9", - "@smithy/protocol-http": "^4.1.6", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/util-stream": "^3.3.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/middleware-content-length": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/core": "3.693.0", - "@aws-sdk/credential-provider-env": "3.693.0", - "@aws-sdk/credential-provider-http": "3.693.0", - "@aws-sdk/credential-provider-process": "3.693.0", - "@aws-sdk/credential-provider-sso": "3.693.0", - "@aws-sdk/credential-provider-web-identity": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/credential-provider-imds": "^3.2.6", - "@smithy/property-provider": "^3.1.9", - "@smithy/shared-ini-file-loader": "^3.1.10", - "@smithy/types": "^3.7.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.693.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/credential-provider-node": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/middleware-endpoint": { + "version": "4.0.6", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/credential-provider-env": "3.693.0", - "@aws-sdk/credential-provider-http": "3.693.0", - "@aws-sdk/credential-provider-ini": "3.693.0", - "@aws-sdk/credential-provider-process": "3.693.0", - "@aws-sdk/credential-provider-sso": "3.693.0", - "@aws-sdk/credential-provider-web-identity": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/credential-provider-imds": "^3.2.6", - "@smithy/property-provider": "^3.1.9", - "@smithy/shared-ini-file-loader": "^3.1.10", - "@smithy/types": "^3.7.0", + "@smithy/core": "^3.1.5", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-middleware": "^4.0.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/middleware-retry": { + "version": "4.0.7", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/client-sso": "3.693.0", - "@aws-sdk/core": "3.693.0", - "@aws-sdk/token-providers": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/property-provider": "^3.1.9", - "@smithy/shared-ini-file-loader": "^3.1.10", - "@smithy/types": "^3.7.0", - "tslib": "^2.6.2" + "@smithy/node-config-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/service-error-classification": "^4.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-retry": "^4.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/middleware-serde": { + "version": "4.0.2", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/core": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/property-provider": "^3.1.9", - "@smithy/types": "^3.7.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/middleware-stack": { + "version": "4.0.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.693.0" + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/middleware-host-header": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/node-config-provider": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/types": "^3.7.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/middleware-logger": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/node-http-handler": { + "version": "4.0.3", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/types": "^3.7.0", + "@smithy/abort-controller": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/querystring-builder": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/property-provider": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/types": "^3.7.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/protocol-http": { + "version": "5.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/core": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@aws-sdk/util-endpoints": "3.693.0", - "@smithy/core": "^2.5.2", - "@smithy/protocol-http": "^4.1.6", - "@smithy/types": "^3.7.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/region-config-resolver": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/shared-ini-file-loader": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/types": "^3.7.0", - "@smithy/util-config-provider": "^3.0.0", - "@smithy/util-middleware": "^3.0.9", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/token-providers": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/signature-v4": { + "version": "5.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/property-provider": "^3.1.9", - "@smithy/shared-ini-file-loader": "^3.1.10", - "@smithy/types": "^3.7.0", + "@smithy/is-array-buffer": "^4.0.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-hex-encoding": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-uri-escape": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sso-oidc": "^3.693.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/util-endpoints": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/smithy-client": { + "version": "4.1.6", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/types": "^3.7.0", - "@smithy/util-endpoints": "^2.1.5", + "@smithy/core": "^3.1.5", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-stream": "^4.1.2", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/types": { + "version": "4.1.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/types": "^3.7.0", - "bowser": "^2.11.0", "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-apprunner/node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/url-parser": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/middleware-user-agent": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/types": "^3.7.0", + "@smithy/querystring-parser": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "aws-crt": ">=1.0.0" - }, - "peerDependenciesMeta": { - "aws-crt": { - "optional": true - } + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-apprunner/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-base64": { + "version": "4.0.0", "license": "Apache-2.0", + "peer": true, "dependencies": { + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-apprunner/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-body-length-browser": { + "version": "4.0.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-apprunner/node_modules/@smithy/util-utf8": { - "version": "3.0.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-body-length-node": { + "version": "4.0.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudcontrol": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-config-provider": { + "version": "4.0.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.693.0", - "@aws-sdk/client-sts": "3.693.0", - "@aws-sdk/core": "3.693.0", - "@aws-sdk/credential-provider-node": "3.693.0", - "@aws-sdk/middleware-host-header": "3.693.0", - "@aws-sdk/middleware-logger": "3.693.0", - "@aws-sdk/middleware-recursion-detection": "3.693.0", - "@aws-sdk/middleware-user-agent": "3.693.0", - "@aws-sdk/region-config-resolver": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@aws-sdk/util-endpoints": "3.693.0", - "@aws-sdk/util-user-agent-browser": "3.693.0", - "@aws-sdk/util-user-agent-node": "3.693.0", - "@smithy/config-resolver": "^3.0.11", - "@smithy/core": "^2.5.2", - "@smithy/fetch-http-handler": "^4.1.0", - "@smithy/hash-node": "^3.0.9", - "@smithy/invalid-dependency": "^3.0.9", - "@smithy/middleware-content-length": "^3.0.11", - "@smithy/middleware-endpoint": "^3.2.2", - "@smithy/middleware-retry": "^3.0.26", - "@smithy/middleware-serde": "^3.0.9", - "@smithy/middleware-stack": "^3.0.9", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/node-http-handler": "^3.3.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/url-parser": "^3.0.9", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.26", - "@smithy/util-defaults-mode-node": "^3.0.26", - "@smithy/util-endpoints": "^2.1.5", - "@smithy/util-middleware": "^3.0.9", - "@smithy/util-retry": "^3.0.9", - "@smithy/util-utf8": "^3.0.0", - "@smithy/util-waiter": "^3.1.8", - "@types/uuid": "^9.0.1", - "tslib": "^2.6.2", - "uuid": "^9.0.1" + "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/client-sso": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-defaults-mode-browser": { + "version": "4.0.7", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.693.0", - "@aws-sdk/middleware-host-header": "3.693.0", - "@aws-sdk/middleware-logger": "3.693.0", - "@aws-sdk/middleware-recursion-detection": "3.693.0", - "@aws-sdk/middleware-user-agent": "3.693.0", - "@aws-sdk/region-config-resolver": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@aws-sdk/util-endpoints": "3.693.0", - "@aws-sdk/util-user-agent-browser": "3.693.0", - "@aws-sdk/util-user-agent-node": "3.693.0", - "@smithy/config-resolver": "^3.0.11", - "@smithy/core": "^2.5.2", - "@smithy/fetch-http-handler": "^4.1.0", - "@smithy/hash-node": "^3.0.9", - "@smithy/invalid-dependency": "^3.0.9", - "@smithy/middleware-content-length": "^3.0.11", - "@smithy/middleware-endpoint": "^3.2.2", - "@smithy/middleware-retry": "^3.0.26", - "@smithy/middleware-serde": "^3.0.9", - "@smithy/middleware-stack": "^3.0.9", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/node-http-handler": "^3.3.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/url-parser": "^3.0.9", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.26", - "@smithy/util-defaults-mode-node": "^3.0.26", - "@smithy/util-endpoints": "^2.1.5", - "@smithy/util-middleware": "^3.0.9", - "@smithy/util-retry": "^3.0.9", - "@smithy/util-utf8": "^3.0.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "bowser": "^2.11.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/client-sso-oidc": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-defaults-mode-node": { + "version": "4.0.7", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.693.0", - "@aws-sdk/credential-provider-node": "3.693.0", - "@aws-sdk/middleware-host-header": "3.693.0", - "@aws-sdk/middleware-logger": "3.693.0", - "@aws-sdk/middleware-recursion-detection": "3.693.0", - "@aws-sdk/middleware-user-agent": "3.693.0", - "@aws-sdk/region-config-resolver": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@aws-sdk/util-endpoints": "3.693.0", - "@aws-sdk/util-user-agent-browser": "3.693.0", - "@aws-sdk/util-user-agent-node": "3.693.0", - "@smithy/config-resolver": "^3.0.11", - "@smithy/core": "^2.5.2", - "@smithy/fetch-http-handler": "^4.1.0", - "@smithy/hash-node": "^3.0.9", - "@smithy/invalid-dependency": "^3.0.9", - "@smithy/middleware-content-length": "^3.0.11", - "@smithy/middleware-endpoint": "^3.2.2", - "@smithy/middleware-retry": "^3.0.26", - "@smithy/middleware-serde": "^3.0.9", - "@smithy/middleware-stack": "^3.0.9", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/node-http-handler": "^3.3.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/url-parser": "^3.0.9", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.26", - "@smithy/util-defaults-mode-node": "^3.0.26", - "@smithy/util-endpoints": "^2.1.5", - "@smithy/util-middleware": "^3.0.9", - "@smithy/util-retry": "^3.0.9", - "@smithy/util-utf8": "^3.0.0", + "@smithy/config-resolver": "^4.0.1", + "@smithy/credential-provider-imds": "^4.0.1", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-endpoints": { + "version": "3.0.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-middleware": { + "version": "4.0.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.693.0" + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/client-sts": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-retry": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.693.0", - "@aws-sdk/core": "3.693.0", - "@aws-sdk/credential-provider-node": "3.693.0", - "@aws-sdk/middleware-host-header": "3.693.0", - "@aws-sdk/middleware-logger": "3.693.0", - "@aws-sdk/middleware-recursion-detection": "3.693.0", - "@aws-sdk/middleware-user-agent": "3.693.0", - "@aws-sdk/region-config-resolver": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@aws-sdk/util-endpoints": "3.693.0", - "@aws-sdk/util-user-agent-browser": "3.693.0", - "@aws-sdk/util-user-agent-node": "3.693.0", - "@smithy/config-resolver": "^3.0.11", - "@smithy/core": "^2.5.2", - "@smithy/fetch-http-handler": "^4.1.0", - "@smithy/hash-node": "^3.0.9", - "@smithy/invalid-dependency": "^3.0.9", - "@smithy/middleware-content-length": "^3.0.11", - "@smithy/middleware-endpoint": "^3.2.2", - "@smithy/middleware-retry": "^3.0.26", - "@smithy/middleware-serde": "^3.0.9", - "@smithy/middleware-stack": "^3.0.9", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/node-http-handler": "^3.3.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/url-parser": "^3.0.9", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.26", - "@smithy/util-defaults-mode-node": "^3.0.26", - "@smithy/util-endpoints": "^2.1.5", - "@smithy/util-middleware": "^3.0.9", - "@smithy/util-retry": "^3.0.9", - "@smithy/util-utf8": "^3.0.0", + "@smithy/service-error-classification": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/core": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-utf8": { + "version": "4.0.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/core": "^2.5.2", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/property-provider": "^3.1.9", - "@smithy/protocol-http": "^4.1.6", - "@smithy/signature-v4": "^4.2.2", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/util-middleware": "^3.0.9", - "fast-xml-parser": "4.4.1", + "@smithy/util-buffer-from": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/credential-provider-http": { + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/core": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.693.0", "@aws-sdk/types": "3.692.0", - "@smithy/fetch-http-handler": "^4.1.0", - "@smithy/node-http-handler": "^3.3.0", + "@smithy/core": "^2.5.2", + "@smithy/node-config-provider": "^3.1.10", "@smithy/property-provider": "^3.1.9", "@smithy/protocol-http": "^4.1.6", + "@smithy/signature-v4": "^4.2.2", "@smithy/smithy-client": "^3.4.3", "@smithy/types": "^3.7.0", - "@smithy/util-stream": "^3.3.0", + "@smithy/util-middleware": "^3.0.9", + "fast-xml-parser": "4.4.1", "tslib": "^2.6.2" }, "engines": { "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env": { + "version": "3.758.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/core": "3.693.0", - "@aws-sdk/credential-provider-env": "3.693.0", - "@aws-sdk/credential-provider-http": "3.693.0", - "@aws-sdk/credential-provider-process": "3.693.0", - "@aws-sdk/credential-provider-sso": "3.693.0", - "@aws-sdk/credential-provider-web-identity": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/credential-provider-imds": "^3.2.6", - "@smithy/property-provider": "^3.1.9", - "@smithy/shared-ini-file-loader": "^3.1.10", - "@smithy/types": "^3.7.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.693.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/credential-provider-node": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@aws-sdk/core": { + "version": "3.758.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/credential-provider-env": "3.693.0", - "@aws-sdk/credential-provider-http": "3.693.0", - "@aws-sdk/credential-provider-ini": "3.693.0", - "@aws-sdk/credential-provider-process": "3.693.0", - "@aws-sdk/credential-provider-sso": "3.693.0", - "@aws-sdk/credential-provider-web-identity": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/credential-provider-imds": "^3.2.6", - "@smithy/property-provider": "^3.1.9", - "@smithy/shared-ini-file-loader": "^3.1.10", - "@smithy/types": "^3.7.0", + "@aws-sdk/types": "3.734.0", + "@smithy/core": "^3.1.5", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/signature-v4": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/util-middleware": "^4.0.1", + "fast-xml-parser": "4.4.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@aws-sdk/types": { + "version": "3.734.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/client-sso": "3.693.0", - "@aws-sdk/core": "3.693.0", - "@aws-sdk/token-providers": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/property-provider": "^3.1.9", - "@smithy/shared-ini-file-loader": "^3.1.10", - "@smithy/types": "^3.7.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/core": { + "version": "3.1.5", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/core": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/property-provider": "^3.1.9", - "@smithy/types": "^3.7.0", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-stream": "^4.1.2", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.693.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/middleware-host-header": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/middleware-endpoint": { + "version": "4.0.6", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/types": "^3.7.0", + "@smithy/core": "^3.1.5", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-middleware": "^4.0.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/middleware-logger": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/middleware-serde": { + "version": "4.0.2", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/types": "^3.7.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/middleware-stack": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/types": "^3.7.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/node-config-provider": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/core": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@aws-sdk/util-endpoints": "3.693.0", - "@smithy/core": "^2.5.2", - "@smithy/protocol-http": "^4.1.6", - "@smithy/types": "^3.7.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/region-config-resolver": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/property-provider": { + "version": "4.0.1", "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/types": "^3.7.0", - "@smithy/util-config-provider": "^3.0.0", - "@smithy/util-middleware": "^3.0.9", + "peer": true, + "dependencies": { + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/token-providers": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/protocol-http": { + "version": "5.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/property-provider": "^3.1.9", - "@smithy/shared-ini-file-loader": "^3.1.10", - "@smithy/types": "^3.7.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sso-oidc": "^3.693.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/util-endpoints": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/shared-ini-file-loader": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/types": "^3.7.0", - "@smithy/util-endpoints": "^2.1.5", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/signature-v4": { + "version": "5.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/types": "^3.7.0", - "bowser": "^2.11.0", + "@smithy/is-array-buffer": "^4.0.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-hex-encoding": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-uri-escape": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/smithy-client": { + "version": "4.1.6", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/middleware-user-agent": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/types": "^3.7.0", + "@smithy/core": "^3.1.5", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-stream": "^4.1.2", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "aws-crt": ">=1.0.0" - }, - "peerDependenciesMeta": { - "aws-crt": { - "optional": true - } + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/types": { + "version": "4.1.0", "license": "Apache-2.0", + "peer": true, "dependencies": { "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/url-parser": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", + "@smithy/querystring-parser": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@smithy/util-utf8": { - "version": "3.0.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/util-body-length-browser": { + "version": "4.0.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudformation": { - "version": "3.682.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/util-middleware": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.682.0", - "@aws-sdk/client-sts": "3.682.0", - "@aws-sdk/core": "3.679.0", - "@aws-sdk/credential-provider-node": "3.682.0", - "@aws-sdk/middleware-host-header": "3.679.0", - "@aws-sdk/middleware-logger": "3.679.0", - "@aws-sdk/middleware-recursion-detection": "3.679.0", - "@aws-sdk/middleware-user-agent": "3.682.0", - "@aws-sdk/region-config-resolver": "3.679.0", - "@aws-sdk/types": "3.679.0", - "@aws-sdk/util-endpoints": "3.679.0", - "@aws-sdk/util-user-agent-browser": "3.679.0", - "@aws-sdk/util-user-agent-node": "3.682.0", - "@smithy/config-resolver": "^3.0.9", - "@smithy/core": "^2.4.8", - "@smithy/fetch-http-handler": "^3.2.9", - "@smithy/hash-node": "^3.0.7", - "@smithy/invalid-dependency": "^3.0.7", - "@smithy/middleware-content-length": "^3.0.9", - "@smithy/middleware-endpoint": "^3.1.4", - "@smithy/middleware-retry": "^3.0.23", - "@smithy/middleware-serde": "^3.0.7", - "@smithy/middleware-stack": "^3.0.7", - "@smithy/node-config-provider": "^3.1.8", - "@smithy/node-http-handler": "^3.2.4", - "@smithy/protocol-http": "^4.1.4", - "@smithy/smithy-client": "^3.4.0", - "@smithy/types": "^3.5.0", - "@smithy/url-parser": "^3.0.7", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.23", - "@smithy/util-defaults-mode-node": "^3.0.23", - "@smithy/util-endpoints": "^2.1.3", - "@smithy/util-middleware": "^3.0.7", - "@smithy/util-retry": "^3.0.7", - "@smithy/util-utf8": "^3.0.0", - "@smithy/util-waiter": "^3.1.6", - "@types/uuid": "^9.0.1", - "tslib": "^2.6.2", - "uuid": "^9.0.1" + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/client-sso": { - "version": "3.682.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/util-utf8": { + "version": "4.0.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.679.0", - "@aws-sdk/middleware-host-header": "3.679.0", - "@aws-sdk/middleware-logger": "3.679.0", - "@aws-sdk/middleware-recursion-detection": "3.679.0", - "@aws-sdk/middleware-user-agent": "3.682.0", - "@aws-sdk/region-config-resolver": "3.679.0", - "@aws-sdk/types": "3.679.0", - "@aws-sdk/util-endpoints": "3.679.0", - "@aws-sdk/util-user-agent-browser": "3.679.0", - "@aws-sdk/util-user-agent-node": "3.682.0", - "@smithy/config-resolver": "^3.0.9", - "@smithy/core": "^2.4.8", - "@smithy/fetch-http-handler": "^3.2.9", - "@smithy/hash-node": "^3.0.7", - "@smithy/invalid-dependency": "^3.0.7", - "@smithy/middleware-content-length": "^3.0.9", - "@smithy/middleware-endpoint": "^3.1.4", - "@smithy/middleware-retry": "^3.0.23", - "@smithy/middleware-serde": "^3.0.7", - "@smithy/middleware-stack": "^3.0.7", - "@smithy/node-config-provider": "^3.1.8", - "@smithy/node-http-handler": "^3.2.4", - "@smithy/protocol-http": "^4.1.4", - "@smithy/smithy-client": "^3.4.0", - "@smithy/types": "^3.5.0", - "@smithy/url-parser": "^3.0.7", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.23", - "@smithy/util-defaults-mode-node": "^3.0.23", - "@smithy/util-endpoints": "^2.1.3", - "@smithy/util-middleware": "^3.0.7", - "@smithy/util-retry": "^3.0.7", - "@smithy/util-utf8": "^3.0.0", + "@smithy/util-buffer-from": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/client-sso-oidc": { - "version": "3.682.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http": { + "version": "3.758.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.679.0", - "@aws-sdk/credential-provider-node": "3.682.0", - "@aws-sdk/middleware-host-header": "3.679.0", - "@aws-sdk/middleware-logger": "3.679.0", - "@aws-sdk/middleware-recursion-detection": "3.679.0", - "@aws-sdk/middleware-user-agent": "3.682.0", - "@aws-sdk/region-config-resolver": "3.679.0", - "@aws-sdk/types": "3.679.0", - "@aws-sdk/util-endpoints": "3.679.0", - "@aws-sdk/util-user-agent-browser": "3.679.0", - "@aws-sdk/util-user-agent-node": "3.682.0", - "@smithy/config-resolver": "^3.0.9", - "@smithy/core": "^2.4.8", - "@smithy/fetch-http-handler": "^3.2.9", - "@smithy/hash-node": "^3.0.7", - "@smithy/invalid-dependency": "^3.0.7", - "@smithy/middleware-content-length": "^3.0.9", - "@smithy/middleware-endpoint": "^3.1.4", - "@smithy/middleware-retry": "^3.0.23", - "@smithy/middleware-serde": "^3.0.7", - "@smithy/middleware-stack": "^3.0.7", - "@smithy/node-config-provider": "^3.1.8", - "@smithy/node-http-handler": "^3.2.4", - "@smithy/protocol-http": "^4.1.4", - "@smithy/smithy-client": "^3.4.0", - "@smithy/types": "^3.5.0", - "@smithy/url-parser": "^3.0.7", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.23", - "@smithy/util-defaults-mode-node": "^3.0.23", - "@smithy/util-endpoints": "^2.1.3", - "@smithy/util-middleware": "^3.0.7", - "@smithy/util-retry": "^3.0.7", - "@smithy/util-utf8": "^3.0.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/node-http-handler": "^4.0.3", + "@smithy/property-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/util-stream": "^4.1.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@aws-sdk/core": { + "version": "3.758.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/core": "^3.1.5", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/signature-v4": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/util-middleware": "^4.0.1", + "fast-xml-parser": "4.4.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.682.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/client-sts": { - "version": "3.682.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@aws-sdk/types": { + "version": "3.734.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.682.0", - "@aws-sdk/core": "3.679.0", - "@aws-sdk/credential-provider-node": "3.682.0", - "@aws-sdk/middleware-host-header": "3.679.0", - "@aws-sdk/middleware-logger": "3.679.0", - "@aws-sdk/middleware-recursion-detection": "3.679.0", - "@aws-sdk/middleware-user-agent": "3.682.0", - "@aws-sdk/region-config-resolver": "3.679.0", - "@aws-sdk/types": "3.679.0", - "@aws-sdk/util-endpoints": "3.679.0", - "@aws-sdk/util-user-agent-browser": "3.679.0", - "@aws-sdk/util-user-agent-node": "3.682.0", - "@smithy/config-resolver": "^3.0.9", - "@smithy/core": "^2.4.8", - "@smithy/fetch-http-handler": "^3.2.9", - "@smithy/hash-node": "^3.0.7", - "@smithy/invalid-dependency": "^3.0.7", - "@smithy/middleware-content-length": "^3.0.9", - "@smithy/middleware-endpoint": "^3.1.4", - "@smithy/middleware-retry": "^3.0.23", - "@smithy/middleware-serde": "^3.0.7", - "@smithy/middleware-stack": "^3.0.7", - "@smithy/node-config-provider": "^3.1.8", - "@smithy/node-http-handler": "^3.2.4", - "@smithy/protocol-http": "^4.1.4", - "@smithy/smithy-client": "^3.4.0", - "@smithy/types": "^3.5.0", - "@smithy/url-parser": "^3.0.7", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.23", - "@smithy/util-defaults-mode-node": "^3.0.23", - "@smithy/util-endpoints": "^2.1.3", - "@smithy/util-middleware": "^3.0.7", - "@smithy/util-retry": "^3.0.7", - "@smithy/util-utf8": "^3.0.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/core": { - "version": "3.679.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/core": { + "version": "3.1.5", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.679.0", - "@smithy/core": "^2.4.8", - "@smithy/node-config-provider": "^3.1.8", - "@smithy/property-provider": "^3.1.7", - "@smithy/protocol-http": "^4.1.4", - "@smithy/signature-v4": "^4.2.0", - "@smithy/smithy-client": "^3.4.0", - "@smithy/types": "^3.5.0", - "@smithy/util-middleware": "^3.0.7", - "fast-xml-parser": "4.4.1", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-stream": "^4.1.2", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/credential-provider-env": { - "version": "3.679.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/fetch-http-handler": { + "version": "5.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/core": "3.679.0", - "@aws-sdk/types": "3.679.0", - "@smithy/property-provider": "^3.1.7", - "@smithy/types": "^3.5.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/querystring-builder": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-base64": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/credential-provider-http": { - "version": "3.679.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/middleware-endpoint": { + "version": "4.0.6", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/core": "3.679.0", - "@aws-sdk/types": "3.679.0", - "@smithy/fetch-http-handler": "^3.2.9", - "@smithy/node-http-handler": "^3.2.4", - "@smithy/property-provider": "^3.1.7", - "@smithy/protocol-http": "^4.1.4", - "@smithy/smithy-client": "^3.4.0", - "@smithy/types": "^3.5.0", - "@smithy/util-stream": "^3.1.9", + "@smithy/core": "^3.1.5", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-middleware": "^4.0.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.682.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/middleware-serde": { + "version": "4.0.2", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/core": "3.679.0", - "@aws-sdk/credential-provider-env": "3.679.0", - "@aws-sdk/credential-provider-http": "3.679.0", - "@aws-sdk/credential-provider-process": "3.679.0", - "@aws-sdk/credential-provider-sso": "3.682.0", - "@aws-sdk/credential-provider-web-identity": "3.679.0", - "@aws-sdk/types": "3.679.0", - "@smithy/credential-provider-imds": "^3.2.4", - "@smithy/property-provider": "^3.1.7", - "@smithy/shared-ini-file-loader": "^3.1.8", - "@smithy/types": "^3.5.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.682.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/credential-provider-node": { - "version": "3.682.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/middleware-stack": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/credential-provider-env": "3.679.0", - "@aws-sdk/credential-provider-http": "3.679.0", - "@aws-sdk/credential-provider-ini": "3.682.0", - "@aws-sdk/credential-provider-process": "3.679.0", - "@aws-sdk/credential-provider-sso": "3.682.0", - "@aws-sdk/credential-provider-web-identity": "3.679.0", - "@aws-sdk/types": "3.679.0", - "@smithy/credential-provider-imds": "^3.2.4", - "@smithy/property-provider": "^3.1.7", - "@smithy/shared-ini-file-loader": "^3.1.8", - "@smithy/types": "^3.5.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/credential-provider-process": { - "version": "3.679.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-config-provider": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/core": "3.679.0", - "@aws-sdk/types": "3.679.0", - "@smithy/property-provider": "^3.1.7", - "@smithy/shared-ini-file-loader": "^3.1.8", - "@smithy/types": "^3.5.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.682.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler": { + "version": "4.0.3", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/client-sso": "3.682.0", - "@aws-sdk/core": "3.679.0", - "@aws-sdk/token-providers": "3.679.0", - "@aws-sdk/types": "3.679.0", - "@smithy/property-provider": "^3.1.7", - "@smithy/shared-ini-file-loader": "^3.1.8", - "@smithy/types": "^3.5.0", + "@smithy/abort-controller": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/querystring-builder": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.679.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/property-provider": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/core": "3.679.0", - "@aws-sdk/types": "3.679.0", - "@smithy/property-provider": "^3.1.7", - "@smithy/types": "^3.5.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/protocol-http": { + "version": "5.0.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.679.0" + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/middleware-host-header": { - "version": "3.679.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/shared-ini-file-loader": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.679.0", - "@smithy/protocol-http": "^4.1.4", - "@smithy/types": "^3.5.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/middleware-logger": { - "version": "3.679.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/signature-v4": { + "version": "5.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.679.0", - "@smithy/types": "^3.5.0", + "@smithy/is-array-buffer": "^4.0.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-hex-encoding": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-uri-escape": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.679.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/smithy-client": { + "version": "4.1.6", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.679.0", - "@smithy/protocol-http": "^4.1.4", - "@smithy/types": "^3.5.0", + "@smithy/core": "^3.1.5", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-stream": "^4.1.2", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.682.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/types": { + "version": "4.1.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/core": "3.679.0", - "@aws-sdk/types": "3.679.0", - "@aws-sdk/util-endpoints": "3.679.0", - "@smithy/core": "^2.4.8", - "@smithy/protocol-http": "^4.1.4", - "@smithy/types": "^3.5.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/region-config-resolver": { - "version": "3.679.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/url-parser": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.679.0", - "@smithy/node-config-provider": "^3.1.8", - "@smithy/types": "^3.5.0", - "@smithy/util-config-provider": "^3.0.0", - "@smithy/util-middleware": "^3.0.7", + "@smithy/querystring-parser": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/token-providers": { - "version": "3.679.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/util-base64": { + "version": "4.0.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.679.0", - "@smithy/property-provider": "^3.1.7", - "@smithy/shared-ini-file-loader": "^3.1.8", - "@smithy/types": "^3.5.0", + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sso-oidc": "^3.679.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/types": { - "version": "3.679.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/util-body-length-browser": { + "version": "4.0.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/types": "^3.5.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints": { - "version": "3.679.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/util-middleware": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.679.0", - "@smithy/types": "^3.5.0", - "@smithy/util-endpoints": "^2.1.3", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.679.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/util-utf8": { + "version": "4.0.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.679.0", - "@smithy/types": "^3.5.0", - "bowser": "^2.11.0", + "@smithy/util-buffer-from": "^4.0.0", "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.682.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-node": { + "version": "3.758.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/middleware-user-agent": "3.682.0", - "@aws-sdk/types": "3.679.0", - "@smithy/node-config-provider": "^3.1.8", - "@smithy/types": "^3.5.0", + "@aws-sdk/credential-provider-env": "3.758.0", + "@aws-sdk/credential-provider-http": "3.758.0", + "@aws-sdk/credential-provider-ini": "3.758.0", + "@aws-sdk/credential-provider-process": "3.758.0", + "@aws-sdk/credential-provider-sso": "3.758.0", + "@aws-sdk/credential-provider-web-identity": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/credential-provider-imds": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "aws-crt": ">=1.0.0" - }, - "peerDependenciesMeta": { - "aws-crt": { - "optional": true - } + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudformation/node_modules/@smithy/fetch-http-handler": { - "version": "3.2.9", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/types": { + "version": "3.734.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/protocol-http": "^4.1.4", - "@smithy/querystring-builder": "^3.0.7", - "@smithy/types": "^3.5.0", - "@smithy/util-base64": "^3.0.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudformation/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-node/node_modules/@smithy/property-provider": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudformation/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-node/node_modules/@smithy/shared-ini-file-loader": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudformation/node_modules/@smithy/util-utf8": { - "version": "3.0.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-node/node_modules/@smithy/types": { + "version": "4.1.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudwatch-logs": { - "version": "3.682.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process": { + "version": "3.758.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.682.0", - "@aws-sdk/client-sts": "3.682.0", - "@aws-sdk/core": "3.679.0", - "@aws-sdk/credential-provider-node": "3.682.0", - "@aws-sdk/middleware-host-header": "3.679.0", - "@aws-sdk/middleware-logger": "3.679.0", - "@aws-sdk/middleware-recursion-detection": "3.679.0", - "@aws-sdk/middleware-user-agent": "3.682.0", - "@aws-sdk/region-config-resolver": "3.679.0", - "@aws-sdk/types": "3.679.0", - "@aws-sdk/util-endpoints": "3.679.0", - "@aws-sdk/util-user-agent-browser": "3.679.0", - "@aws-sdk/util-user-agent-node": "3.682.0", - "@smithy/config-resolver": "^3.0.9", - "@smithy/core": "^2.4.8", - "@smithy/eventstream-serde-browser": "^3.0.10", - "@smithy/eventstream-serde-config-resolver": "^3.0.7", - "@smithy/eventstream-serde-node": "^3.0.9", - "@smithy/fetch-http-handler": "^3.2.9", - "@smithy/hash-node": "^3.0.7", - "@smithy/invalid-dependency": "^3.0.7", - "@smithy/middleware-content-length": "^3.0.9", - "@smithy/middleware-endpoint": "^3.1.4", - "@smithy/middleware-retry": "^3.0.23", - "@smithy/middleware-serde": "^3.0.7", - "@smithy/middleware-stack": "^3.0.7", - "@smithy/node-config-provider": "^3.1.8", - "@smithy/node-http-handler": "^3.2.4", - "@smithy/protocol-http": "^4.1.4", - "@smithy/smithy-client": "^3.4.0", - "@smithy/types": "^3.5.0", - "@smithy/url-parser": "^3.0.7", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.23", - "@smithy/util-defaults-mode-node": "^3.0.23", - "@smithy/util-endpoints": "^2.1.3", - "@smithy/util-middleware": "^3.0.7", - "@smithy/util-retry": "^3.0.7", - "@smithy/util-utf8": "^3.0.0", - "@types/uuid": "^9.0.1", - "tslib": "^2.6.2", - "uuid": "^9.0.1" + "@aws-sdk/core": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/client-sso": { - "version": "3.682.0", - "license": "Apache-2.0", - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.679.0", - "@aws-sdk/middleware-host-header": "3.679.0", - "@aws-sdk/middleware-logger": "3.679.0", - "@aws-sdk/middleware-recursion-detection": "3.679.0", - "@aws-sdk/middleware-user-agent": "3.682.0", - "@aws-sdk/region-config-resolver": "3.679.0", - "@aws-sdk/types": "3.679.0", - "@aws-sdk/util-endpoints": "3.679.0", - "@aws-sdk/util-user-agent-browser": "3.679.0", - "@aws-sdk/util-user-agent-node": "3.682.0", - "@smithy/config-resolver": "^3.0.9", - "@smithy/core": "^2.4.8", - "@smithy/fetch-http-handler": "^3.2.9", - "@smithy/hash-node": "^3.0.7", - "@smithy/invalid-dependency": "^3.0.7", - "@smithy/middleware-content-length": "^3.0.9", - "@smithy/middleware-endpoint": "^3.1.4", - "@smithy/middleware-retry": "^3.0.23", - "@smithy/middleware-serde": "^3.0.7", - "@smithy/middleware-stack": "^3.0.7", - "@smithy/node-config-provider": "^3.1.8", - "@smithy/node-http-handler": "^3.2.4", - "@smithy/protocol-http": "^4.1.4", - "@smithy/smithy-client": "^3.4.0", - "@smithy/types": "^3.5.0", - "@smithy/url-parser": "^3.0.7", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.23", - "@smithy/util-defaults-mode-node": "^3.0.23", - "@smithy/util-endpoints": "^2.1.3", - "@smithy/util-middleware": "^3.0.7", - "@smithy/util-retry": "^3.0.7", - "@smithy/util-utf8": "^3.0.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@aws-sdk/core": { + "version": "3.758.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/core": "^3.1.5", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/signature-v4": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/util-middleware": "^4.0.1", + "fast-xml-parser": "4.4.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/client-sso-oidc": { - "version": "3.682.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@aws-sdk/types": { + "version": "3.734.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.679.0", - "@aws-sdk/credential-provider-node": "3.682.0", - "@aws-sdk/middleware-host-header": "3.679.0", - "@aws-sdk/middleware-logger": "3.679.0", - "@aws-sdk/middleware-recursion-detection": "3.679.0", - "@aws-sdk/middleware-user-agent": "3.682.0", - "@aws-sdk/region-config-resolver": "3.679.0", - "@aws-sdk/types": "3.679.0", - "@aws-sdk/util-endpoints": "3.679.0", - "@aws-sdk/util-user-agent-browser": "3.679.0", - "@aws-sdk/util-user-agent-node": "3.682.0", - "@smithy/config-resolver": "^3.0.9", - "@smithy/core": "^2.4.8", - "@smithy/fetch-http-handler": "^3.2.9", - "@smithy/hash-node": "^3.0.7", - "@smithy/invalid-dependency": "^3.0.7", - "@smithy/middleware-content-length": "^3.0.9", - "@smithy/middleware-endpoint": "^3.1.4", - "@smithy/middleware-retry": "^3.0.23", - "@smithy/middleware-serde": "^3.0.7", - "@smithy/middleware-stack": "^3.0.7", - "@smithy/node-config-provider": "^3.1.8", - "@smithy/node-http-handler": "^3.2.4", - "@smithy/protocol-http": "^4.1.4", - "@smithy/smithy-client": "^3.4.0", - "@smithy/types": "^3.5.0", - "@smithy/url-parser": "^3.0.7", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.23", - "@smithy/util-defaults-mode-node": "^3.0.23", - "@smithy/util-endpoints": "^2.1.3", - "@smithy/util-middleware": "^3.0.7", - "@smithy/util-retry": "^3.0.7", - "@smithy/util-utf8": "^3.0.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.682.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/client-sts": { - "version": "3.682.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/core": { + "version": "3.1.5", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.682.0", - "@aws-sdk/core": "3.679.0", - "@aws-sdk/credential-provider-node": "3.682.0", - "@aws-sdk/middleware-host-header": "3.679.0", - "@aws-sdk/middleware-logger": "3.679.0", - "@aws-sdk/middleware-recursion-detection": "3.679.0", - "@aws-sdk/middleware-user-agent": "3.682.0", - "@aws-sdk/region-config-resolver": "3.679.0", - "@aws-sdk/types": "3.679.0", - "@aws-sdk/util-endpoints": "3.679.0", - "@aws-sdk/util-user-agent-browser": "3.679.0", - "@aws-sdk/util-user-agent-node": "3.682.0", - "@smithy/config-resolver": "^3.0.9", - "@smithy/core": "^2.4.8", - "@smithy/fetch-http-handler": "^3.2.9", - "@smithy/hash-node": "^3.0.7", - "@smithy/invalid-dependency": "^3.0.7", - "@smithy/middleware-content-length": "^3.0.9", - "@smithy/middleware-endpoint": "^3.1.4", - "@smithy/middleware-retry": "^3.0.23", - "@smithy/middleware-serde": "^3.0.7", - "@smithy/middleware-stack": "^3.0.7", - "@smithy/node-config-provider": "^3.1.8", - "@smithy/node-http-handler": "^3.2.4", - "@smithy/protocol-http": "^4.1.4", - "@smithy/smithy-client": "^3.4.0", - "@smithy/types": "^3.5.0", - "@smithy/url-parser": "^3.0.7", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.23", - "@smithy/util-defaults-mode-node": "^3.0.23", - "@smithy/util-endpoints": "^2.1.3", - "@smithy/util-middleware": "^3.0.7", - "@smithy/util-retry": "^3.0.7", - "@smithy/util-utf8": "^3.0.0", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-stream": "^4.1.2", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/core": { - "version": "3.679.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/middleware-endpoint": { + "version": "4.0.6", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.679.0", - "@smithy/core": "^2.4.8", - "@smithy/node-config-provider": "^3.1.8", - "@smithy/property-provider": "^3.1.7", - "@smithy/protocol-http": "^4.1.4", - "@smithy/signature-v4": "^4.2.0", - "@smithy/smithy-client": "^3.4.0", - "@smithy/types": "^3.5.0", - "@smithy/util-middleware": "^3.0.7", - "fast-xml-parser": "4.4.1", + "@smithy/core": "^3.1.5", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-middleware": "^4.0.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/credential-provider-env": { - "version": "3.679.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/middleware-serde": { + "version": "4.0.2", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/core": "3.679.0", - "@aws-sdk/types": "3.679.0", - "@smithy/property-provider": "^3.1.7", - "@smithy/types": "^3.5.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/credential-provider-http": { - "version": "3.679.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/middleware-stack": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/core": "3.679.0", - "@aws-sdk/types": "3.679.0", - "@smithy/fetch-http-handler": "^3.2.9", - "@smithy/node-http-handler": "^3.2.4", - "@smithy/property-provider": "^3.1.7", - "@smithy/protocol-http": "^4.1.4", - "@smithy/smithy-client": "^3.4.0", - "@smithy/types": "^3.5.0", - "@smithy/util-stream": "^3.1.9", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.682.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/node-config-provider": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/core": "3.679.0", - "@aws-sdk/credential-provider-env": "3.679.0", - "@aws-sdk/credential-provider-http": "3.679.0", - "@aws-sdk/credential-provider-process": "3.679.0", - "@aws-sdk/credential-provider-sso": "3.682.0", - "@aws-sdk/credential-provider-web-identity": "3.679.0", - "@aws-sdk/types": "3.679.0", - "@smithy/credential-provider-imds": "^3.2.4", - "@smithy/property-provider": "^3.1.7", - "@smithy/shared-ini-file-loader": "^3.1.8", - "@smithy/types": "^3.5.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.682.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/credential-provider-node": { - "version": "3.682.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/property-provider": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/credential-provider-env": "3.679.0", - "@aws-sdk/credential-provider-http": "3.679.0", - "@aws-sdk/credential-provider-ini": "3.682.0", - "@aws-sdk/credential-provider-process": "3.679.0", - "@aws-sdk/credential-provider-sso": "3.682.0", - "@aws-sdk/credential-provider-web-identity": "3.679.0", - "@aws-sdk/types": "3.679.0", - "@smithy/credential-provider-imds": "^3.2.4", - "@smithy/property-provider": "^3.1.7", - "@smithy/shared-ini-file-loader": "^3.1.8", - "@smithy/types": "^3.5.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/credential-provider-process": { - "version": "3.679.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/protocol-http": { + "version": "5.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/core": "3.679.0", - "@aws-sdk/types": "3.679.0", - "@smithy/property-provider": "^3.1.7", - "@smithy/shared-ini-file-loader": "^3.1.8", - "@smithy/types": "^3.5.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.682.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/shared-ini-file-loader": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/client-sso": "3.682.0", - "@aws-sdk/core": "3.679.0", - "@aws-sdk/token-providers": "3.679.0", - "@aws-sdk/types": "3.679.0", - "@smithy/property-provider": "^3.1.7", - "@smithy/shared-ini-file-loader": "^3.1.8", - "@smithy/types": "^3.5.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.679.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/signature-v4": { + "version": "5.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/core": "3.679.0", - "@aws-sdk/types": "3.679.0", - "@smithy/property-provider": "^3.1.7", - "@smithy/types": "^3.5.0", + "@smithy/is-array-buffer": "^4.0.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-hex-encoding": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-uri-escape": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.679.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/middleware-host-header": { - "version": "3.679.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/smithy-client": { + "version": "4.1.6", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.679.0", - "@smithy/protocol-http": "^4.1.4", - "@smithy/types": "^3.5.0", + "@smithy/core": "^3.1.5", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-stream": "^4.1.2", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/middleware-logger": { - "version": "3.679.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/types": { + "version": "4.1.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.679.0", - "@smithy/types": "^3.5.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.679.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/url-parser": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.679.0", - "@smithy/protocol-http": "^4.1.4", - "@smithy/types": "^3.5.0", + "@smithy/querystring-parser": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.682.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/util-body-length-browser": { + "version": "4.0.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/core": "3.679.0", - "@aws-sdk/types": "3.679.0", - "@aws-sdk/util-endpoints": "3.679.0", - "@smithy/core": "^2.4.8", - "@smithy/protocol-http": "^4.1.4", - "@smithy/types": "^3.5.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/region-config-resolver": { - "version": "3.679.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/util-middleware": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.679.0", - "@smithy/node-config-provider": "^3.1.8", - "@smithy/types": "^3.5.0", - "@smithy/util-config-provider": "^3.0.0", - "@smithy/util-middleware": "^3.0.7", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/token-providers": { - "version": "3.679.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/util-utf8": { + "version": "4.0.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.679.0", - "@smithy/property-provider": "^3.1.7", - "@smithy/shared-ini-file-loader": "^3.1.8", - "@smithy/types": "^3.5.0", + "@smithy/util-buffer-from": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sso-oidc": "^3.679.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/types": { - "version": "3.679.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.758.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/types": "^3.5.0", + "@aws-sdk/client-sso": "3.758.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/token-providers": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/util-endpoints": { - "version": "3.679.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/core": { + "version": "3.758.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.679.0", - "@smithy/types": "^3.5.0", - "@smithy/util-endpoints": "^2.1.3", + "@aws-sdk/types": "3.734.0", + "@smithy/core": "^3.1.5", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/signature-v4": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/util-middleware": "^4.0.1", + "fast-xml-parser": "4.4.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.679.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers": { + "version": "3.758.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.679.0", - "@smithy/types": "^3.5.0", - "bowser": "^2.11.0", + "@aws-sdk/nested-clients": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.682.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/types": { + "version": "3.734.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/middleware-user-agent": "3.682.0", - "@aws-sdk/types": "3.679.0", - "@smithy/node-config-provider": "^3.1.8", - "@smithy/types": "^3.5.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "aws-crt": ">=1.0.0" - }, - "peerDependenciesMeta": { - "aws-crt": { - "optional": true - } + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@smithy/fetch-http-handler": { - "version": "3.2.9", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/core": { + "version": "3.1.5", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/protocol-http": "^4.1.4", - "@smithy/querystring-builder": "^3.0.7", - "@smithy/types": "^3.5.0", - "@smithy/util-base64": "^3.0.0", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-stream": "^4.1.2", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/middleware-endpoint": { + "version": "4.0.6", "license": "Apache-2.0", + "peer": true, "dependencies": { + "@smithy/core": "^3.1.5", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-middleware": "^4.0.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/middleware-serde": { + "version": "4.0.2", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-cloudwatch-logs/node_modules/@smithy/util-utf8": { - "version": "3.0.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/middleware-stack": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/node-config-provider": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.693.0", - "@aws-sdk/middleware-host-header": "3.693.0", - "@aws-sdk/middleware-logger": "3.693.0", - "@aws-sdk/middleware-recursion-detection": "3.693.0", - "@aws-sdk/middleware-user-agent": "3.693.0", - "@aws-sdk/region-config-resolver": "3.693.0", - "@aws-sdk/token-providers": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@aws-sdk/util-endpoints": "3.693.0", - "@aws-sdk/util-user-agent-browser": "3.693.0", - "@aws-sdk/util-user-agent-node": "3.693.0", - "@smithy/config-resolver": "^3.0.11", - "@smithy/core": "^2.5.2", - "@smithy/fetch-http-handler": "^4.1.0", - "@smithy/hash-node": "^3.0.9", - "@smithy/invalid-dependency": "^3.0.9", - "@smithy/middleware-content-length": "^3.0.11", - "@smithy/middleware-endpoint": "^3.2.2", - "@smithy/middleware-retry": "^3.0.26", - "@smithy/middleware-serde": "^3.0.9", - "@smithy/middleware-stack": "^3.0.9", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/node-http-handler": "^3.3.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/url-parser": "^3.0.9", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.26", - "@smithy/util-defaults-mode-node": "^3.0.26", - "@smithy/util-endpoints": "^2.1.5", - "@smithy/util-middleware": "^3.0.9", - "@smithy/util-retry": "^3.0.9", - "@smithy/util-utf8": "^3.0.0", - "@types/uuid": "^9.0.1", - "tslib": "^2.6.2", - "uuid": "^9.0.1" + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso": { - "version": "3.758.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/property-provider": { + "version": "4.0.1", "license": "Apache-2.0", "peer": true, "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.758.0", - "@aws-sdk/middleware-host-header": "3.734.0", - "@aws-sdk/middleware-logger": "3.734.0", - "@aws-sdk/middleware-recursion-detection": "3.734.0", - "@aws-sdk/middleware-user-agent": "3.758.0", - "@aws-sdk/region-config-resolver": "3.734.0", - "@aws-sdk/types": "3.734.0", - "@aws-sdk/util-endpoints": "3.743.0", - "@aws-sdk/util-user-agent-browser": "3.734.0", - "@aws-sdk/util-user-agent-node": "3.758.0", - "@smithy/config-resolver": "^4.0.1", - "@smithy/core": "^3.1.5", - "@smithy/fetch-http-handler": "^5.0.1", - "@smithy/hash-node": "^4.0.1", - "@smithy/invalid-dependency": "^4.0.1", - "@smithy/middleware-content-length": "^4.0.1", - "@smithy/middleware-endpoint": "^4.0.6", - "@smithy/middleware-retry": "^4.0.7", - "@smithy/middleware-serde": "^4.0.2", - "@smithy/middleware-stack": "^4.0.1", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/node-http-handler": "^4.0.3", - "@smithy/protocol-http": "^5.0.1", - "@smithy/smithy-client": "^4.1.6", "@smithy/types": "^4.1.0", - "@smithy/url-parser": "^4.0.1", - "@smithy/util-base64": "^4.0.0", - "@smithy/util-body-length-browser": "^4.0.0", - "@smithy/util-body-length-node": "^4.0.0", - "@smithy/util-defaults-mode-browser": "^4.0.7", - "@smithy/util-defaults-mode-node": "^4.0.7", - "@smithy/util-endpoints": "^3.0.1", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-retry": "^4.0.1", - "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc": { - "version": "3.758.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/protocol-http": { + "version": "5.0.1", "license": "Apache-2.0", "peer": true, "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.758.0", - "@aws-sdk/credential-provider-node": "3.758.0", - "@aws-sdk/middleware-host-header": "3.734.0", - "@aws-sdk/middleware-logger": "3.734.0", - "@aws-sdk/middleware-recursion-detection": "3.734.0", - "@aws-sdk/middleware-user-agent": "3.758.0", - "@aws-sdk/region-config-resolver": "3.734.0", - "@aws-sdk/types": "3.734.0", - "@aws-sdk/util-endpoints": "3.743.0", - "@aws-sdk/util-user-agent-browser": "3.734.0", - "@aws-sdk/util-user-agent-node": "3.758.0", - "@smithy/config-resolver": "^4.0.1", - "@smithy/core": "^3.1.5", - "@smithy/fetch-http-handler": "^5.0.1", - "@smithy/hash-node": "^4.0.1", - "@smithy/invalid-dependency": "^4.0.1", - "@smithy/middleware-content-length": "^4.0.1", - "@smithy/middleware-endpoint": "^4.0.6", - "@smithy/middleware-retry": "^4.0.7", - "@smithy/middleware-serde": "^4.0.2", - "@smithy/middleware-stack": "^4.0.1", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/node-http-handler": "^4.0.3", - "@smithy/protocol-http": "^5.0.1", - "@smithy/smithy-client": "^4.1.6", "@smithy/types": "^4.1.0", - "@smithy/url-parser": "^4.0.1", - "@smithy/util-base64": "^4.0.0", - "@smithy/util-body-length-browser": "^4.0.0", - "@smithy/util-body-length-node": "^4.0.0", - "@smithy/util-defaults-mode-browser": "^4.0.7", - "@smithy/util-defaults-mode-node": "^4.0.7", - "@smithy/util-endpoints": "^3.0.1", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-retry": "^4.0.1", - "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/core": { - "version": "3.758.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/shared-ini-file-loader": { + "version": "4.0.1", "license": "Apache-2.0", "peer": true, "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/core": "^3.1.5", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/property-provider": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/signature-v4": "^5.0.1", - "@smithy/smithy-client": "^4.1.6", "@smithy/types": "^4.1.0", - "@smithy/util-middleware": "^4.0.1", - "fast-xml-parser": "4.4.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/middleware-host-header": { - "version": "3.734.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/signature-v4": { + "version": "5.0.1", "license": "Apache-2.0", "peer": true, "dependencies": { - "@aws-sdk/types": "3.734.0", + "@smithy/is-array-buffer": "^4.0.0", "@smithy/protocol-http": "^5.0.1", "@smithy/types": "^4.1.0", + "@smithy/util-hex-encoding": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-uri-escape": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/middleware-logger": { - "version": "3.734.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/smithy-client": { + "version": "4.1.6", "license": "Apache-2.0", "peer": true, "dependencies": { - "@aws-sdk/types": "3.734.0", + "@smithy/core": "^3.1.5", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", "@smithy/types": "^4.1.0", + "@smithy/util-stream": "^4.1.2", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.734.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/types": { + "version": "4.1.0", "license": "Apache-2.0", "peer": true, "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.758.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/url-parser": { + "version": "4.0.1", "license": "Apache-2.0", "peer": true, "dependencies": { - "@aws-sdk/core": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@aws-sdk/util-endpoints": "3.743.0", - "@smithy/core": "^3.1.5", - "@smithy/protocol-http": "^5.0.1", + "@smithy/querystring-parser": "^4.0.1", "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, @@ -2873,24 +6009,19 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/region-config-resolver": { - "version": "3.734.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/util-body-length-browser": { + "version": "4.0.0", "license": "Apache-2.0", "peer": true, "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-config-provider": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/types": { - "version": "3.734.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/util-middleware": { + "version": "4.0.1", "license": "Apache-2.0", "peer": true, "dependencies": { @@ -2901,44 +6032,139 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/util-endpoints": { - "version": "3.743.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/util-utf8": { + "version": "4.0.0", "license": "Apache-2.0", "peer": true, "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/types": "^4.1.0", - "@smithy/util-endpoints": "^3.0.1", + "@smithy/util-buffer-from": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.734.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/middleware-host-header": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/middleware-logger": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@smithy/core": "^2.5.2", + "@smithy/protocol-http": "^4.1.6", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/region-config-resolver": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/types": "^3.7.0", + "@smithy/util-config-provider": "^3.0.0", + "@smithy/util-middleware": "^3.0.9", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/token-providers": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sso-oidc": "^3.693.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/util-endpoints": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/types": "^3.7.0", + "@smithy/util-endpoints": "^2.1.5", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/types": "^4.1.0", + "@aws-sdk/types": "3.692.0", + "@smithy/types": "^3.7.0", "bowser": "^2.11.0", "tslib": "^2.6.2" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.758.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@aws-sdk/middleware-user-agent": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/types": "^4.1.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" }, "peerDependencies": { "aws-crt": ">=1.0.0" @@ -2949,69 +6175,59 @@ } } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/config-resolver": { + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/abort-controller": { "version": "4.0.1", "license": "Apache-2.0", "peer": true, "dependencies": { - "@smithy/node-config-provider": "^4.0.1", "@smithy/types": "^4.1.0", - "@smithy/util-config-provider": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/core": { - "version": "3.1.5", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/abort-controller/node_modules/@smithy/types": { + "version": "4.1.0", "license": "Apache-2.0", "peer": true, "dependencies": { - "@smithy/middleware-serde": "^4.0.2", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-body-length-browser": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-stream": "^4.1.2", - "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/fetch-http-handler": { - "version": "5.0.1", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/credential-provider-imds": { + "version": "4.0.1", "license": "Apache-2.0", "peer": true, "dependencies": { - "@smithy/protocol-http": "^5.0.1", - "@smithy/querystring-builder": "^4.0.1", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/property-provider": "^4.0.1", "@smithy/types": "^4.1.0", - "@smithy/util-base64": "^4.0.0", + "@smithy/url-parser": "^4.0.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/hash-node": { + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/credential-provider-imds/node_modules/@smithy/node-config-provider": { "version": "4.0.1", "license": "Apache-2.0", "peer": true, "dependencies": { + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", "@smithy/types": "^4.1.0", - "@smithy/util-buffer-from": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/invalid-dependency": { + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/credential-provider-imds/node_modules/@smithy/property-provider": { "version": "4.0.1", "license": "Apache-2.0", "peer": true, @@ -3023,12 +6239,11 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/middleware-content-length": { + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/credential-provider-imds/node_modules/@smithy/shared-ini-file-loader": { "version": "4.0.1", "license": "Apache-2.0", "peer": true, "dependencies": { - "@smithy/protocol-http": "^5.0.1", "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, @@ -3036,74 +6251,70 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/middleware-endpoint": { - "version": "4.0.6", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/credential-provider-imds/node_modules/@smithy/types": { + "version": "4.1.0", "license": "Apache-2.0", "peer": true, "dependencies": { - "@smithy/core": "^3.1.5", - "@smithy/middleware-serde": "^4.0.2", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/url-parser": "^4.0.1", - "@smithy/util-middleware": "^4.0.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/middleware-retry": { - "version": "4.0.7", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/credential-provider-imds/node_modules/@smithy/url-parser": { + "version": "4.0.1", "license": "Apache-2.0", "peer": true, "dependencies": { - "@smithy/node-config-provider": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/service-error-classification": "^4.0.1", - "@smithy/smithy-client": "^4.1.6", + "@smithy/querystring-parser": "^4.0.1", "@smithy/types": "^4.1.0", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-retry": "^4.0.1", - "tslib": "^2.6.2", - "uuid": "^9.0.1" + "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/middleware-serde": { - "version": "4.0.2", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/is-array-buffer": { + "version": "4.0.0", "license": "Apache-2.0", "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/middleware-stack": { + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/querystring-builder": { "version": "4.0.1", "license": "Apache-2.0", "peer": true, "dependencies": { "@smithy/types": "^4.1.0", + "@smithy/util-uri-escape": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/node-config-provider": { + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/querystring-builder/node_modules/@smithy/types": { + "version": "4.1.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/querystring-parser": { "version": "4.0.1", "license": "Apache-2.0", "peer": true, "dependencies": { - "@smithy/property-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, @@ -3111,68 +6322,73 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/node-http-handler": { - "version": "4.0.3", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/querystring-parser/node_modules/@smithy/types": { + "version": "4.1.0", "license": "Apache-2.0", "peer": true, "dependencies": { - "@smithy/abort-controller": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/querystring-builder": "^4.0.1", - "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/property-provider": { + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/service-error-classification": { "version": "4.0.1", "license": "Apache-2.0", "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", + "@smithy/types": "^4.1.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/service-error-classification/node_modules/@smithy/types": { + "version": "4.1.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/protocol-http": { - "version": "5.0.1", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/util-buffer-from": { + "version": "4.0.0", "license": "Apache-2.0", "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", + "@smithy/is-array-buffer": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/shared-ini-file-loader": { - "version": "4.0.1", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/util-hex-encoding": { + "version": "4.0.0", "license": "Apache-2.0", "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/signature-v4": { - "version": "5.0.1", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/util-stream": { + "version": "4.1.2", "license": "Apache-2.0", "peer": true, "dependencies": { - "@smithy/is-array-buffer": "^4.0.0", - "@smithy/protocol-http": "^5.0.1", + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/node-http-handler": "^4.0.3", "@smithy/types": "^4.1.0", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-buffer-from": "^4.0.0", "@smithy/util-hex-encoding": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-uri-escape": "^4.0.0", "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, @@ -3180,40 +6396,41 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/smithy-client": { - "version": "4.1.6", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/util-stream/node_modules/@smithy/fetch-http-handler": { + "version": "5.0.1", "license": "Apache-2.0", "peer": true, "dependencies": { - "@smithy/core": "^3.1.5", - "@smithy/middleware-endpoint": "^4.0.6", - "@smithy/middleware-stack": "^4.0.1", "@smithy/protocol-http": "^5.0.1", + "@smithy/querystring-builder": "^4.0.1", "@smithy/types": "^4.1.0", - "@smithy/util-stream": "^4.1.2", + "@smithy/util-base64": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/types": { - "version": "4.1.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/util-stream/node_modules/@smithy/node-http-handler": { + "version": "4.0.3", "license": "Apache-2.0", "peer": true, "dependencies": { + "@smithy/abort-controller": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/querystring-builder": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/url-parser": { - "version": "4.0.1", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/util-stream/node_modules/@smithy/protocol-http": { + "version": "5.0.1", "license": "Apache-2.0", "peer": true, "dependencies": { - "@smithy/querystring-parser": "^4.0.1", "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, @@ -3221,42 +6438,43 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-base64": { - "version": "4.0.0", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/util-stream/node_modules/@smithy/types": { + "version": "4.1.0", "license": "Apache-2.0", "peer": true, "dependencies": { - "@smithy/util-buffer-from": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-body-length-browser": { + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/util-stream/node_modules/@smithy/util-base64": { "version": "4.0.0", "license": "Apache-2.0", "peer": true, "dependencies": { + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-body-length-node": { + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/util-stream/node_modules/@smithy/util-utf8": { "version": "4.0.0", "license": "Apache-2.0", "peer": true, "dependencies": { + "@smithy/util-buffer-from": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-config-provider": { + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/util-uri-escape": { "version": "4.0.0", "license": "Apache-2.0", "peer": true, @@ -3267,269 +6485,385 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-defaults-mode-browser": { - "version": "4.0.7", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/util-utf8": { + "version": "3.0.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/property-provider": "^4.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", - "bowser": "^2.11.0", + "@smithy/util-buffer-from": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-defaults-mode-node": { - "version": "4.0.7", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/util-utf8/node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/config-resolver": "^4.0.1", - "@smithy/credential-provider-imds": "^4.0.1", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/property-provider": "^4.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-endpoints": { - "version": "3.0.1", + "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/node-config-provider": "^4.0.1", - "@smithy/types": "^4.1.0", + "@smithy/is-array-buffer": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-middleware": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.730.0.tgz", + "integrity": "sha512-iJt2pL6RqWg7R3pja1WfcC2+oTjwaKFYndNE9oUQqyc6RN24XWUtGy9JnWqTUOy8jYzaP2eoF00fGeasSBX+Dw==", "dependencies": { - "@smithy/types": "^4.1.0", + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.730.0", + "@aws-sdk/credential-provider-node": "3.730.0", + "@aws-sdk/middleware-host-header": "3.723.0", + "@aws-sdk/middleware-logger": "3.723.0", + "@aws-sdk/middleware-recursion-detection": "3.723.0", + "@aws-sdk/middleware-user-agent": "3.730.0", + "@aws-sdk/region-config-resolver": "3.723.0", + "@aws-sdk/types": "3.723.0", + "@aws-sdk/util-endpoints": "3.730.0", + "@aws-sdk/util-user-agent-browser": "3.723.0", + "@aws-sdk/util-user-agent-node": "3.730.0", + "@smithy/config-resolver": "^4.0.0", + "@smithy/core": "^3.0.0", + "@smithy/fetch-http-handler": "^5.0.0", + "@smithy/hash-node": "^4.0.0", + "@smithy/invalid-dependency": "^4.0.0", + "@smithy/middleware-content-length": "^4.0.0", + "@smithy/middleware-endpoint": "^4.0.0", + "@smithy/middleware-retry": "^4.0.0", + "@smithy/middleware-serde": "^4.0.0", + "@smithy/middleware-stack": "^4.0.0", + "@smithy/node-config-provider": "^4.0.0", + "@smithy/node-http-handler": "^4.0.0", + "@smithy/protocol-http": "^5.0.0", + "@smithy/smithy-client": "^4.0.0", + "@smithy/types": "^4.0.0", + "@smithy/url-parser": "^4.0.0", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.0", + "@smithy/util-defaults-mode-node": "^4.0.0", + "@smithy/util-endpoints": "^3.0.0", + "@smithy/util-middleware": "^4.0.0", + "@smithy/util-retry": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-retry": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/client-sso": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.730.0.tgz", + "integrity": "sha512-mI8kqkSuVlZklewEmN7jcbBMyVODBld3MsTjCKSl5ztduuPX69JD7nXLnWWPkw1PX4aGTO24AEoRMGNxntoXUg==", "dependencies": { - "@smithy/service-error-classification": "^4.0.1", - "@smithy/types": "^4.1.0", + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.730.0", + "@aws-sdk/middleware-host-header": "3.723.0", + "@aws-sdk/middleware-logger": "3.723.0", + "@aws-sdk/middleware-recursion-detection": "3.723.0", + "@aws-sdk/middleware-user-agent": "3.730.0", + "@aws-sdk/region-config-resolver": "3.723.0", + "@aws-sdk/types": "3.723.0", + "@aws-sdk/util-endpoints": "3.730.0", + "@aws-sdk/util-user-agent-browser": "3.723.0", + "@aws-sdk/util-user-agent-node": "3.730.0", + "@smithy/config-resolver": "^4.0.0", + "@smithy/core": "^3.0.0", + "@smithy/fetch-http-handler": "^5.0.0", + "@smithy/hash-node": "^4.0.0", + "@smithy/invalid-dependency": "^4.0.0", + "@smithy/middleware-content-length": "^4.0.0", + "@smithy/middleware-endpoint": "^4.0.0", + "@smithy/middleware-retry": "^4.0.0", + "@smithy/middleware-serde": "^4.0.0", + "@smithy/middleware-stack": "^4.0.0", + "@smithy/node-config-provider": "^4.0.0", + "@smithy/node-http-handler": "^4.0.0", + "@smithy/protocol-http": "^5.0.0", + "@smithy/smithy-client": "^4.0.0", + "@smithy/types": "^4.0.0", + "@smithy/url-parser": "^4.0.0", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.0", + "@smithy/util-defaults-mode-node": "^4.0.0", + "@smithy/util-endpoints": "^3.0.0", + "@smithy/util-middleware": "^4.0.0", + "@smithy/util-retry": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-utf8": { - "version": "4.0.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/core": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.730.0.tgz", + "integrity": "sha512-jonKyR+2GcqbZj2WDICZS0c633keLc9qwXnePu83DfAoFXMMIMyoR/7FOGf8F3OrIdGh8KzE9VvST+nZCK9EJA==", "dependencies": { - "@smithy/util-buffer-from": "^4.0.0", + "@aws-sdk/types": "3.723.0", + "@smithy/core": "^3.0.0", + "@smithy/node-config-provider": "^4.0.0", + "@smithy/property-provider": "^4.0.0", + "@smithy/protocol-http": "^5.0.0", + "@smithy/signature-v4": "^5.0.0", + "@smithy/smithy-client": "^4.0.0", + "@smithy/types": "^4.0.0", + "@smithy/util-middleware": "^4.0.0", + "fast-xml-parser": "4.4.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/core": { - "version": "3.758.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/credential-provider-env": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.730.0.tgz", + "integrity": "sha512-fFXgo3jBXLWqu8I07Hd96mS7RjrtpDgm3bZShm0F3lKtqDQF+hObFWq9A013SOE+RjMLVfbABhToXAYct3FcBw==", "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/core": "^3.1.5", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/property-provider": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/signature-v4": "^5.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", - "@smithy/util-middleware": "^4.0.1", - "fast-xml-parser": "4.4.1", + "@aws-sdk/core": "3.730.0", + "@aws-sdk/types": "3.723.0", + "@smithy/property-provider": "^4.0.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/middleware-host-header": { - "version": "3.734.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/credential-provider-http": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.730.0.tgz", + "integrity": "sha512-1aF3elbCzpVhWLAuV63iFElfLOqLGGTp4fkf2VAFIDO3hjshpXUQssTgIWiBwwtJYJdOSxaFrCU7u8frjr/5aQ==", "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", + "@aws-sdk/core": "3.730.0", + "@aws-sdk/types": "3.723.0", + "@smithy/fetch-http-handler": "^5.0.0", + "@smithy/node-http-handler": "^4.0.0", + "@smithy/property-provider": "^4.0.0", + "@smithy/protocol-http": "^5.0.0", + "@smithy/smithy-client": "^4.0.0", + "@smithy/types": "^4.0.0", + "@smithy/util-stream": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/middleware-logger": { - "version": "3.734.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.730.0.tgz", + "integrity": "sha512-zwsxkBuQuPp06o45ATAnznHzj3+ibop/EaTytNzSv0O87Q59K/jnS/bdtv1n6bhe99XCieRNTihvtS7YklzK7A==", "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/types": "^4.1.0", + "@aws-sdk/core": "3.730.0", + "@aws-sdk/credential-provider-env": "3.730.0", + "@aws-sdk/credential-provider-http": "3.730.0", + "@aws-sdk/credential-provider-process": "3.730.0", + "@aws-sdk/credential-provider-sso": "3.730.0", + "@aws-sdk/credential-provider-web-identity": "3.730.0", + "@aws-sdk/nested-clients": "3.730.0", + "@aws-sdk/types": "3.723.0", + "@smithy/credential-provider-imds": "^4.0.0", + "@smithy/property-provider": "^4.0.0", + "@smithy/shared-ini-file-loader": "^4.0.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.734.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/credential-provider-node": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.730.0.tgz", + "integrity": "sha512-ztRjh1edY7ut2wwrj1XqHtqPY/NXEYIk5fYf04KKsp8zBi81ScVqP7C+Cst6PFKixjgLSG6RsqMx9GSAalVv0Q==", "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", + "@aws-sdk/credential-provider-env": "3.730.0", + "@aws-sdk/credential-provider-http": "3.730.0", + "@aws-sdk/credential-provider-ini": "3.730.0", + "@aws-sdk/credential-provider-process": "3.730.0", + "@aws-sdk/credential-provider-sso": "3.730.0", + "@aws-sdk/credential-provider-web-identity": "3.730.0", + "@aws-sdk/types": "3.723.0", + "@smithy/credential-provider-imds": "^4.0.0", + "@smithy/property-provider": "^4.0.0", + "@smithy/shared-ini-file-loader": "^4.0.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.758.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/credential-provider-process": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.730.0.tgz", + "integrity": "sha512-cNKUQ81eptfZN8MlSqwUq3+5ln8u/PcY57UmLZ+npxUHanqO1akpgcpNsLpmsIkoXGbtSQrLuDUgH86lS/SWOw==", "dependencies": { - "@aws-sdk/core": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@aws-sdk/util-endpoints": "3.743.0", - "@smithy/core": "^3.1.5", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", + "@aws-sdk/core": "3.730.0", + "@aws-sdk/types": "3.723.0", + "@smithy/property-provider": "^4.0.0", + "@smithy/shared-ini-file-loader": "^4.0.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/region-config-resolver": { - "version": "3.734.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.730.0.tgz", + "integrity": "sha512-SdI2xrTbquJLMxUh5LpSwB8zfiKq3/jso53xWRgrVfeDlrSzZuyV6QghaMs3KEEjcNzwEnTfSIjGQyRXG9VrEw==", "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-config-provider": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", + "@aws-sdk/client-sso": "3.730.0", + "@aws-sdk/core": "3.730.0", + "@aws-sdk/token-providers": "3.730.0", + "@aws-sdk/types": "3.723.0", + "@smithy/property-provider": "^4.0.0", + "@smithy/shared-ini-file-loader": "^4.0.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/types": { - "version": "3.734.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.730.0.tgz", + "integrity": "sha512-l5vdPmvF/d890pbvv5g1GZrdjaSQkyPH/Bc8dO/ZqkWxkIP8JNgl48S2zgf4DkP3ik9K2axWO828L5RsMDQzdA==", "dependencies": { - "@smithy/types": "^4.1.0", + "@aws-sdk/core": "3.730.0", + "@aws-sdk/nested-clients": "3.730.0", + "@aws-sdk/types": "3.723.0", + "@smithy/property-provider": "^4.0.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/util-endpoints": { - "version": "3.743.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/middleware-host-header": { + "version": "3.723.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.723.0.tgz", + "integrity": "sha512-LLVzLvk299pd7v4jN9yOSaWDZDfH0SnBPb6q+FDPaOCMGBY8kuwQso7e/ozIKSmZHRMGO3IZrflasHM+rI+2YQ==", "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/types": "^4.1.0", - "@smithy/util-endpoints": "^3.0.1", + "@aws-sdk/types": "3.723.0", + "@smithy/protocol-http": "^5.0.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.734.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/middleware-logger": { + "version": "3.723.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.723.0.tgz", + "integrity": "sha512-chASQfDG5NJ8s5smydOEnNK7N0gDMyuPbx7dYYcm1t/PKtnVfvWF+DHCTrRC2Ej76gLJVCVizlAJKM8v8Kg3cg==", "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/types": "^4.1.0", - "bowser": "^2.11.0", + "@aws-sdk/types": "3.723.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.758.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.723.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.723.0.tgz", + "integrity": "sha512-7usZMtoynT9/jxL/rkuDOFQ0C2mhXl4yCm67Rg7GNTstl67u7w5WN1aIRImMeztaKlw8ExjoTyo6WTs1Kceh7A==", "dependencies": { - "@aws-sdk/middleware-user-agent": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/types": "^4.1.0", + "@aws-sdk/types": "3.723.0", + "@smithy/protocol-http": "^5.0.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" - }, - "peerDependencies": { - "aws-crt": ">=1.0.0" - }, - "peerDependenciesMeta": { - "aws-crt": { - "optional": true - } } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/config-resolver": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.730.0.tgz", + "integrity": "sha512-aPMZvNmf2a42B41au3bA3ODU4HfHka2nYT/SAIhhVXH1ENYfAmZo7FraFPxetKepFMCtL7j4QE6/LDucK6liIw==", "dependencies": { - "@smithy/node-config-provider": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-config-provider": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", + "@aws-sdk/core": "3.730.0", + "@aws-sdk/types": "3.723.0", + "@aws-sdk/util-endpoints": "3.730.0", + "@smithy/core": "^3.0.0", + "@smithy/protocol-http": "^5.0.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/core": { - "version": "3.1.5", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/nested-clients": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.730.0.tgz", + "integrity": "sha512-vilIgf1/7kre8DdE5zAQkDOwHFb/TahMn/6j2RZwFLlK7cDk91r19deSiVYnKQkupDMtOfNceNqnorM4I3PDzw==", "dependencies": { - "@smithy/middleware-serde": "^4.0.2", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.730.0", + "@aws-sdk/middleware-host-header": "3.723.0", + "@aws-sdk/middleware-logger": "3.723.0", + "@aws-sdk/middleware-recursion-detection": "3.723.0", + "@aws-sdk/middleware-user-agent": "3.730.0", + "@aws-sdk/region-config-resolver": "3.723.0", + "@aws-sdk/types": "3.723.0", + "@aws-sdk/util-endpoints": "3.730.0", + "@aws-sdk/util-user-agent-browser": "3.723.0", + "@aws-sdk/util-user-agent-node": "3.730.0", + "@smithy/config-resolver": "^4.0.0", + "@smithy/core": "^3.0.0", + "@smithy/fetch-http-handler": "^5.0.0", + "@smithy/hash-node": "^4.0.0", + "@smithy/invalid-dependency": "^4.0.0", + "@smithy/middleware-content-length": "^4.0.0", + "@smithy/middleware-endpoint": "^4.0.0", + "@smithy/middleware-retry": "^4.0.0", + "@smithy/middleware-serde": "^4.0.0", + "@smithy/middleware-stack": "^4.0.0", + "@smithy/node-config-provider": "^4.0.0", + "@smithy/node-http-handler": "^4.0.0", + "@smithy/protocol-http": "^5.0.0", + "@smithy/smithy-client": "^4.0.0", + "@smithy/types": "^4.0.0", + "@smithy/url-parser": "^4.0.0", + "@smithy/util-base64": "^4.0.0", "@smithy/util-body-length-browser": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-stream": "^4.1.2", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.0", + "@smithy/util-defaults-mode-node": "^4.0.0", + "@smithy/util-endpoints": "^3.0.0", + "@smithy/util-middleware": "^4.0.0", + "@smithy/util-retry": "^4.0.0", "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, @@ -3537,1539 +6871,2029 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/fetch-http-handler": { - "version": "5.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/region-config-resolver": { + "version": "3.723.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.723.0.tgz", + "integrity": "sha512-tGF/Cvch3uQjZIj34LY2mg8M2Dr4kYG8VU8Yd0dFnB1ybOEOveIK/9ypUo9ycZpB9oO6q01KRe5ijBaxNueUQg==", "dependencies": { - "@smithy/protocol-http": "^5.0.1", - "@smithy/querystring-builder": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-base64": "^4.0.0", + "@aws-sdk/types": "3.723.0", + "@smithy/node-config-provider": "^4.0.0", + "@smithy/types": "^4.0.0", + "@smithy/util-config-provider": "^4.0.0", + "@smithy/util-middleware": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/hash-node": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/token-providers": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.730.0.tgz", + "integrity": "sha512-BSPssGj54B/AABWXARIPOT/1ybFahM1ldlfmXy9gRmZi/afe9geWJGlFYCCt3PmqR+1Ny5XIjSfue+kMd//drQ==", "dependencies": { - "@smithy/types": "^4.1.0", - "@smithy/util-buffer-from": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", + "@aws-sdk/nested-clients": "3.730.0", + "@aws-sdk/types": "3.723.0", + "@smithy/property-provider": "^4.0.0", + "@smithy/shared-ini-file-loader": "^4.0.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/invalid-dependency": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/types": { + "version": "3.723.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.723.0.tgz", + "integrity": "sha512-LmK3kwiMZG1y5g3LGihT9mNkeNOmwEyPk6HGcJqh0wOSV4QpWoKu2epyKE4MLQNUUlz2kOVbVbOrwmI6ZcteuA==", "dependencies": { - "@smithy/types": "^4.1.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/middleware-content-length": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/util-endpoints": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.730.0.tgz", + "integrity": "sha512-1KTFuVnk+YtLgWr6TwDiggcDqtPpOY2Cszt3r2lkXfaEAX6kHyOZi1vdvxXjPU5LsOBJem8HZ7KlkmrEi+xowg==", "dependencies": { - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", + "@aws-sdk/types": "3.723.0", + "@smithy/types": "^4.0.0", + "@smithy/util-endpoints": "^3.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/middleware-endpoint": { - "version": "4.0.6", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.723.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.723.0.tgz", + "integrity": "sha512-Wh9I6j2jLhNFq6fmXydIpqD1WyQLyTfSxjW9B+PXSnPyk3jtQW8AKQur7p97rO8LAUzVI0bv8kb3ZzDEVbquIg==", "dependencies": { - "@smithy/core": "^3.1.5", - "@smithy/middleware-serde": "^4.0.2", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/url-parser": "^4.0.1", - "@smithy/util-middleware": "^4.0.1", + "@aws-sdk/types": "3.723.0", + "@smithy/types": "^4.0.0", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.730.0.tgz", + "integrity": "sha512-yBvkOAjqsDEl1va4eHNOhnFBk0iCY/DBFNyhvtTMqPF4NO+MITWpFs3J9JtZKzJlQ6x0Yb9TLQ8NhDjEISz5Ug==", + "dependencies": { + "@aws-sdk/middleware-user-agent": "3.730.0", + "@aws-sdk/types": "3.723.0", + "@smithy/node-config-provider": "^4.0.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/middleware-retry": { - "version": "4.0.7", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/abort-controller": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-4.0.4.tgz", + "integrity": "sha512-gJnEjZMvigPDQWHrW3oPrFhQtkrgqBkyjj3pCIdF3A5M6vsZODG93KNlfJprv6bp4245bdT32fsHK4kkH3KYDA==", "dependencies": { - "@smithy/node-config-provider": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/service-error-classification": "^4.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-retry": "^4.0.1", - "tslib": "^2.6.2", - "uuid": "^9.0.1" + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/middleware-serde": { - "version": "4.0.2", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/config-resolver": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-4.1.4.tgz", + "integrity": "sha512-prmU+rDddxHOH0oNcwemL+SwnzcG65sBF2yXRO7aeXIn/xTlq2pX7JLVbkBnVLowHLg4/OL4+jBmv9hVrVGS+w==", "dependencies": { - "@smithy/types": "^4.1.0", + "@smithy/node-config-provider": "^4.1.3", + "@smithy/types": "^4.3.1", + "@smithy/util-config-provider": "^4.0.0", + "@smithy/util-middleware": "^4.0.4", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/middleware-stack": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/core": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.5.3.tgz", + "integrity": "sha512-xa5byV9fEguZNofCclv6v9ra0FYh5FATQW/da7FQUVTic94DfrN/NvmKZjrMyzbpqfot9ZjBaO8U1UeTbmSLuA==", "dependencies": { - "@smithy/types": "^4.1.0", + "@smithy/middleware-serde": "^4.0.8", + "@smithy/protocol-http": "^5.1.2", + "@smithy/types": "^4.3.1", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-middleware": "^4.0.4", + "@smithy/util-stream": "^4.2.2", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/node-config-provider": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/credential-provider-imds": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.0.6.tgz", + "integrity": "sha512-hKMWcANhUiNbCJouYkZ9V3+/Qf9pteR1dnwgdyzR09R4ODEYx8BbUysHwRSyex4rZ9zapddZhLFTnT4ZijR4pw==", "dependencies": { - "@smithy/property-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", + "@smithy/node-config-provider": "^4.1.3", + "@smithy/property-provider": "^4.0.4", + "@smithy/types": "^4.3.1", + "@smithy/url-parser": "^4.0.4", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/node-http-handler": { - "version": "4.0.3", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/fetch-http-handler": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.0.4.tgz", + "integrity": "sha512-AMtBR5pHppYMVD7z7G+OlHHAcgAN7v0kVKEpHuTO4Gb199Gowh0taYi9oDStFeUhetkeP55JLSVlTW1n9rFtUw==", "dependencies": { - "@smithy/abort-controller": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/querystring-builder": "^4.0.1", - "@smithy/types": "^4.1.0", + "@smithy/protocol-http": "^5.1.2", + "@smithy/querystring-builder": "^4.0.4", + "@smithy/types": "^4.3.1", + "@smithy/util-base64": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/property-provider": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/hash-node": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-4.0.4.tgz", + "integrity": "sha512-qnbTPUhCVnCgBp4z4BUJUhOEkVwxiEi1cyFM+Zj6o+aY8OFGxUQleKWq8ltgp3dujuhXojIvJWdoqpm6dVO3lQ==", "dependencies": { - "@smithy/types": "^4.1.0", + "@smithy/types": "^4.3.1", + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/protocol-http": { - "version": "5.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/invalid-dependency": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-4.0.4.tgz", + "integrity": "sha512-bNYMi7WKTJHu0gn26wg8OscncTt1t2b8KcsZxvOv56XA6cyXtOAAAaNP7+m45xfppXfOatXF3Sb1MNsLUgVLTw==", "dependencies": { - "@smithy/types": "^4.1.0", + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/shared-ini-file-loader": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/is-array-buffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-4.0.0.tgz", + "integrity": "sha512-saYhF8ZZNoJDTvJBEWgeBccCg+yvp1CX+ed12yORU3NilJScfc6gfch2oVb4QgxZrGUx3/ZJlb+c/dJbyupxlw==", "dependencies": { - "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/signature-v4": { - "version": "5.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/middleware-content-length": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-4.0.4.tgz", + "integrity": "sha512-F7gDyfI2BB1Kc+4M6rpuOLne5LOcEknH1n6UQB69qv+HucXBR1rkzXBnQTB2q46sFy1PM/zuSJOB532yc8bg3w==", "dependencies": { - "@smithy/is-array-buffer": "^4.0.0", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-hex-encoding": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-uri-escape": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", + "@smithy/protocol-http": "^5.1.2", + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/smithy-client": { - "version": "4.1.6", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/middleware-endpoint": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.1.11.tgz", + "integrity": "sha512-zDogwtRLzKl58lVS8wPcARevFZNBOOqnmzWWxVe9XiaXU2CADFjvJ9XfNibgkOWs08sxLuSr81NrpY4mgp9OwQ==", "dependencies": { - "@smithy/core": "^3.1.5", - "@smithy/middleware-endpoint": "^4.0.6", - "@smithy/middleware-stack": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-stream": "^4.1.2", + "@smithy/core": "^3.5.3", + "@smithy/middleware-serde": "^4.0.8", + "@smithy/node-config-provider": "^4.1.3", + "@smithy/shared-ini-file-loader": "^4.0.4", + "@smithy/types": "^4.3.1", + "@smithy/url-parser": "^4.0.4", + "@smithy/util-middleware": "^4.0.4", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/types": { - "version": "4.1.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/middleware-retry": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.1.12.tgz", + "integrity": "sha512-wvIH70c4e91NtRxdaLZF+mbLZ/HcC6yg7ySKUiufL6ESp6zJUSnJucZ309AvG9nqCFHSRB5I6T3Ez1Q9wCh0Ww==", "dependencies": { - "tslib": "^2.6.2" + "@smithy/node-config-provider": "^4.1.3", + "@smithy/protocol-http": "^5.1.2", + "@smithy/service-error-classification": "^4.0.5", + "@smithy/smithy-client": "^4.4.3", + "@smithy/types": "^4.3.1", + "@smithy/util-middleware": "^4.0.4", + "@smithy/util-retry": "^4.0.5", + "tslib": "^2.6.2", + "uuid": "^9.0.1" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/url-parser": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/middleware-serde": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.0.8.tgz", + "integrity": "sha512-iSSl7HJoJaGyMIoNn2B7czghOVwJ9nD7TMvLhMWeSB5vt0TnEYyRRqPJu/TqW76WScaNvYYB8nRoiBHR9S1Ddw==", "dependencies": { - "@smithy/querystring-parser": "^4.0.1", - "@smithy/types": "^4.1.0", + "@smithy/protocol-http": "^5.1.2", + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-base64": { - "version": "4.0.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/middleware-stack": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-4.0.4.tgz", + "integrity": "sha512-kagK5ggDrBUCCzI93ft6DjteNSfY8Ulr83UtySog/h09lTIOAJ/xUSObutanlPT0nhoHAkpmW9V5K8oPyLh+QA==", "dependencies": { - "@smithy/util-buffer-from": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-body-length-browser": { - "version": "4.0.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/node-config-provider": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-4.1.3.tgz", + "integrity": "sha512-HGHQr2s59qaU1lrVH6MbLlmOBxadtzTsoO4c+bF5asdgVik3I8o7JIOzoeqWc5MjVa+vD36/LWE0iXKpNqooRw==", "dependencies": { + "@smithy/property-provider": "^4.0.4", + "@smithy/shared-ini-file-loader": "^4.0.4", + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-body-length-node": { - "version": "4.0.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/node-http-handler": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.0.6.tgz", + "integrity": "sha512-NqbmSz7AW2rvw4kXhKGrYTiJVDHnMsFnX4i+/FzcZAfbOBauPYs2ekuECkSbtqaxETLLTu9Rl/ex6+I2BKErPA==", "dependencies": { + "@smithy/abort-controller": "^4.0.4", + "@smithy/protocol-http": "^5.1.2", + "@smithy/querystring-builder": "^4.0.4", + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-config-provider": { - "version": "4.0.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/property-provider": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.0.4.tgz", + "integrity": "sha512-qHJ2sSgu4FqF4U/5UUp4DhXNmdTrgmoAai6oQiM+c5RZ/sbDwJ12qxB1M6FnP+Tn/ggkPZf9ccn4jqKSINaquw==", "dependencies": { + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-defaults-mode-browser": { - "version": "4.0.7", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/protocol-http": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-5.1.2.tgz", + "integrity": "sha512-rOG5cNLBXovxIrICSBm95dLqzfvxjEmuZx4KK3hWwPFHGdW3lxY0fZNXfv2zebfRO7sJZ5pKJYHScsqopeIWtQ==", "dependencies": { - "@smithy/property-provider": "^4.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", - "bowser": "^2.11.0", + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-defaults-mode-node": { - "version": "4.0.7", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/querystring-builder": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-4.0.4.tgz", + "integrity": "sha512-SwREZcDnEYoh9tLNgMbpop+UTGq44Hl9tdj3rf+yeLcfH7+J8OXEBaMc2kDxtyRHu8BhSg9ADEx0gFHvpJgU8w==", "dependencies": { - "@smithy/config-resolver": "^4.0.1", - "@smithy/credential-provider-imds": "^4.0.1", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/property-provider": "^4.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", + "@smithy/types": "^4.3.1", + "@smithy/util-uri-escape": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-endpoints": { - "version": "3.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/querystring-parser": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-4.0.4.tgz", + "integrity": "sha512-6yZf53i/qB8gRHH/l2ZwUG5xgkPgQF15/KxH0DdXMDHjesA9MeZje/853ifkSY0x4m5S+dfDZ+c4x439PF0M2w==", "dependencies": { - "@smithy/node-config-provider": "^4.0.1", - "@smithy/types": "^4.1.0", + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-middleware": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/service-error-classification": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.0.5.tgz", + "integrity": "sha512-LvcfhrnCBvCmTee81pRlh1F39yTS/+kYleVeLCwNtkY8wtGg8V/ca9rbZZvYIl8OjlMtL6KIjaiL/lgVqHD2nA==", "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" + "@smithy/types": "^4.3.1" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-retry": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/shared-ini-file-loader": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.0.4.tgz", + "integrity": "sha512-63X0260LoFBjrHifPDs+nM9tV0VMkOTl4JRMYNuKh/f5PauSjowTfvF3LogfkWdcPoxsA9UjqEOgjeYIbhb7Nw==", "dependencies": { - "@smithy/service-error-classification": "^4.0.1", - "@smithy/types": "^4.1.0", + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-utf8": { - "version": "4.0.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/signature-v4": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.1.2.tgz", + "integrity": "sha512-d3+U/VpX7a60seHziWnVZOHuEgJlclufjkS6zhXvxcJgkJq4UWdH5eOBLzHRMx6gXjsdT9h6lfpmLzbrdupHgQ==", "dependencies": { - "@smithy/util-buffer-from": "^4.0.0", + "@smithy/is-array-buffer": "^4.0.0", + "@smithy/protocol-http": "^5.1.2", + "@smithy/types": "^4.3.1", + "@smithy/util-hex-encoding": "^4.0.0", + "@smithy/util-middleware": "^4.0.4", + "@smithy/util-uri-escape": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/core": { - "version": "3.693.0", - "license": "Apache-2.0", + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/smithy-client": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.4.3.tgz", + "integrity": "sha512-xxzNYgA0HD6ETCe5QJubsxP0hQH3QK3kbpJz3QrosBCuIWyEXLR/CO5hFb2OeawEKUxMNhz3a1nuJNN2np2RMA==", "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/core": "^2.5.2", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/property-provider": "^3.1.9", - "@smithy/protocol-http": "^4.1.6", - "@smithy/signature-v4": "^4.2.2", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/util-middleware": "^3.0.9", - "fast-xml-parser": "4.4.1", + "@smithy/core": "^3.5.3", + "@smithy/middleware-endpoint": "^4.1.11", + "@smithy/middleware-stack": "^4.0.4", + "@smithy/protocol-http": "^5.1.2", + "@smithy/types": "^4.3.1", + "@smithy/util-stream": "^4.2.2", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env": { - "version": "3.758.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/types": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.3.1.tgz", + "integrity": "sha512-UqKOQBL2x6+HWl3P+3QqFD4ncKq0I8Nuz9QItGv5WuKuMHuuwlhvqcZCoXGfc+P1QmfJE7VieykoYYmrOoFJxA==", "dependencies": { - "@aws-sdk/core": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@smithy/property-provider": "^4.0.1", - "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@aws-sdk/core": { - "version": "3.758.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/url-parser": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-4.0.4.tgz", + "integrity": "sha512-eMkc144MuN7B0TDA4U2fKs+BqczVbk3W+qIvcoCY6D1JY3hnAdCuhCZODC+GAeaxj0p6Jroz4+XMUn3PCxQQeQ==", "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/core": "^3.1.5", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/property-provider": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/signature-v4": "^5.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", - "@smithy/util-middleware": "^4.0.1", - "fast-xml-parser": "4.4.1", + "@smithy/querystring-parser": "^4.0.4", + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@aws-sdk/types": { - "version": "3.734.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/util-base64": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-4.0.0.tgz", + "integrity": "sha512-CvHfCmO2mchox9kjrtzoHkWHxjHZzaFojLc8quxXY7WAAMAg43nuxwv95tATVgQFNDwd4M9S1qFzj40Ul41Kmg==", "dependencies": { - "@smithy/types": "^4.1.0", + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/core": { - "version": "3.1.5", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/util-body-length-browser": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-4.0.0.tgz", + "integrity": "sha512-sNi3DL0/k64/LO3A256M+m3CDdG6V7WKWHdAiBBMUN8S3hK3aMPhwnPik2A/a2ONN+9doY9UxaLfgqsIRg69QA==", "dependencies": { - "@smithy/middleware-serde": "^4.0.2", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-body-length-browser": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-stream": "^4.1.2", - "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/middleware-endpoint": { - "version": "4.0.6", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/util-body-length-node": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-4.0.0.tgz", + "integrity": "sha512-q0iDP3VsZzqJyje8xJWEJCNIu3lktUGVoSy1KB0UWym2CL1siV3artm+u1DFYTLejpsrdGyCSWBdGNjJzfDPjg==", "dependencies": { - "@smithy/core": "^3.1.5", - "@smithy/middleware-serde": "^4.0.2", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/url-parser": "^4.0.1", - "@smithy/util-middleware": "^4.0.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/middleware-serde": { - "version": "4.0.2", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/util-buffer-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-4.0.0.tgz", + "integrity": "sha512-9TOQ7781sZvddgO8nxueKi3+yGvkY35kotA0Y6BWRajAv8jjmigQ1sBwz0UX47pQMYXJPahSKEKYFgt+rXdcug==", "dependencies": { - "@smithy/types": "^4.1.0", + "@smithy/is-array-buffer": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/middleware-stack": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/util-config-provider": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-4.0.0.tgz", + "integrity": "sha512-L1RBVzLyfE8OXH+1hsJ8p+acNUSirQnWQ6/EgpchV88G6zGBTDPdXiiExei6Z1wR2RxYvxY/XLw6AMNCCt8H3w==", "dependencies": { - "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/node-config-provider": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/util-defaults-mode-browser": { + "version": "4.0.19", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.0.19.tgz", + "integrity": "sha512-mvLMh87xSmQrV5XqnUYEPoiFFeEGYeAKIDDKdhE2ahqitm8OHM3aSvhqL6rrK6wm1brIk90JhxDf5lf2hbrLbQ==", "dependencies": { - "@smithy/property-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", + "@smithy/property-provider": "^4.0.4", + "@smithy/smithy-client": "^4.4.3", + "@smithy/types": "^4.3.1", + "bowser": "^2.11.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/property-provider": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/util-defaults-mode-node": { + "version": "4.0.19", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.0.19.tgz", + "integrity": "sha512-8tYnx+LUfj6m+zkUUIrIQJxPM1xVxfRBvoGHua7R/i6qAxOMjqR6CpEpDwKoIs1o0+hOjGvkKE23CafKL0vJ9w==", "dependencies": { - "@smithy/types": "^4.1.0", + "@smithy/config-resolver": "^4.1.4", + "@smithy/credential-provider-imds": "^4.0.6", + "@smithy/node-config-provider": "^4.1.3", + "@smithy/property-provider": "^4.0.4", + "@smithy/smithy-client": "^4.4.3", + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/protocol-http": { - "version": "5.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/util-endpoints": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-3.0.6.tgz", + "integrity": "sha512-YARl3tFL3WgPuLzljRUnrS2ngLiUtkwhQtj8PAL13XZSyUiNLQxwG3fBBq3QXFqGFUXepIN73pINp3y8c2nBmA==", "dependencies": { - "@smithy/types": "^4.1.0", + "@smithy/node-config-provider": "^4.1.3", + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/shared-ini-file-loader": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/util-hex-encoding": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-4.0.0.tgz", + "integrity": "sha512-Yk5mLhHtfIgW2W2WQZWSg5kuMZCVbvhFmC7rV4IO2QqnZdbEFPmQnCcGMAX2z/8Qj3B9hYYNjZOhWym+RwhePw==", "dependencies": { - "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/signature-v4": { - "version": "5.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/util-middleware": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-4.0.4.tgz", + "integrity": "sha512-9MLKmkBmf4PRb0ONJikCbCwORACcil6gUWojwARCClT7RmLzF04hUR4WdRprIXal7XVyrddadYNfp2eF3nrvtQ==", "dependencies": { - "@smithy/is-array-buffer": "^4.0.0", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-hex-encoding": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-uri-escape": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/smithy-client": { - "version": "4.1.6", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/util-retry": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.0.5.tgz", + "integrity": "sha512-V7MSjVDTlEt/plmOFBn1762Dyu5uqMrV2Pl2X0dYk4XvWfdWJNe9Bs5Bzb56wkCuiWjSfClVMGcsuKrGj7S/yg==", "dependencies": { - "@smithy/core": "^3.1.5", - "@smithy/middleware-endpoint": "^4.0.6", - "@smithy/middleware-stack": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-stream": "^4.1.2", + "@smithy/service-error-classification": "^4.0.5", + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/types": { - "version": "4.1.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/util-stream": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.2.2.tgz", + "integrity": "sha512-aI+GLi7MJoVxg24/3J1ipwLoYzgkB4kUfogZfnslcYlynj3xsQ0e7vk4TnTro9hhsS5PvX1mwmkRqqHQjwcU7w==", "dependencies": { + "@smithy/fetch-http-handler": "^5.0.4", + "@smithy/node-http-handler": "^4.0.6", + "@smithy/types": "^4.3.1", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-hex-encoding": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/url-parser": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/util-uri-escape": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-4.0.0.tgz", + "integrity": "sha512-77yfbCbQMtgtTylO9itEAdpPXSog3ZxMe09AEhm0dU0NLTalV70ghDZFR+Nfi1C60jnJoh/Re4090/DuZh2Omg==", "dependencies": { - "@smithy/querystring-parser": "^4.0.1", - "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/util-body-length-browser": { + "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/util-utf8": { "version": "4.0.0", - "license": "Apache-2.0", - "peer": true, + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-4.0.0.tgz", + "integrity": "sha512-b+zebfKCfRdgNJDknHCob3O7FpeYQN6ZG6YLExMcasDHsCXlsXCEuiPZeLnJLpwa5dvPetGlnGCiMHuLwGvFow==", "dependencies": { + "@smithy/util-buffer-from": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/util-middleware": { - "version": "4.0.1", + "node_modules/@aws-sdk/client-ec2": { + "version": "3.695.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.693.0", + "@aws-sdk/client-sts": "3.693.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-node": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-sdk-ec2": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", + "@smithy/util-waiter": "^3.1.8", + "@types/uuid": "^9.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/util-utf8": { - "version": "4.0.0", + "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/client-sso": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/util-buffer-from": "^4.0.0", + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http": { - "version": "3.758.0", + "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/client-sso-oidc": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@aws-sdk/core": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@smithy/fetch-http-handler": "^5.0.1", - "@smithy/node-http-handler": "^4.0.3", - "@smithy/property-provider": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", - "@smithy/util-stream": "^4.1.2", + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-node": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@aws-sdk/core": { - "version": "3.758.0", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/core": "^3.1.5", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/property-provider": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/signature-v4": "^5.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", - "@smithy/util-middleware": "^4.0.1", - "fast-xml-parser": "4.4.1", - "tslib": "^2.6.2" + "node": ">=16.0.0" }, - "engines": { - "node": ">=18.0.0" + "peerDependencies": { + "@aws-sdk/client-sts": "^3.693.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@aws-sdk/types": { - "version": "3.734.0", + "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/client-sts": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.693.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-node": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/core": { - "version": "3.1.5", + "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/core": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/middleware-serde": "^4.0.2", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-body-length-browser": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-stream": "^4.1.2", - "@smithy/util-utf8": "^4.0.0", + "@aws-sdk/types": "3.692.0", + "@smithy/core": "^2.5.2", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/property-provider": "^3.1.9", + "@smithy/protocol-http": "^4.1.6", + "@smithy/signature-v4": "^4.2.2", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/util-middleware": "^3.0.9", + "fast-xml-parser": "4.4.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/fetch-http-handler": { - "version": "5.0.1", + "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/credential-provider-http": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/protocol-http": "^5.0.1", - "@smithy/querystring-builder": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-base64": "^4.0.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/util-stream": "^3.3.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/middleware-endpoint": { - "version": "4.0.6", + "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/core": "^3.1.5", - "@smithy/middleware-serde": "^4.0.2", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/url-parser": "^4.0.1", - "@smithy/util-middleware": "^4.0.1", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-env": "3.693.0", + "@aws-sdk/credential-provider-http": "3.693.0", + "@aws-sdk/credential-provider-process": "3.693.0", + "@aws-sdk/credential-provider-sso": "3.693.0", + "@aws-sdk/credential-provider-web-identity": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/credential-provider-imds": "^3.2.6", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/middleware-serde": { - "version": "4.0.2", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" + "node": ">=16.0.0" }, - "engines": { - "node": ">=18.0.0" + "peerDependencies": { + "@aws-sdk/client-sts": "^3.693.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/middleware-stack": { - "version": "4.0.1", + "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/credential-provider-node": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", + "@aws-sdk/credential-provider-env": "3.693.0", + "@aws-sdk/credential-provider-http": "3.693.0", + "@aws-sdk/credential-provider-ini": "3.693.0", + "@aws-sdk/credential-provider-process": "3.693.0", + "@aws-sdk/credential-provider-sso": "3.693.0", + "@aws-sdk/credential-provider-web-identity": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/credential-provider-imds": "^3.2.6", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-config-provider": { - "version": "4.0.1", + "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/property-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", + "@aws-sdk/client-sso": "3.693.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/token-providers": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler": { - "version": "4.0.3", + "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/abort-controller": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/querystring-builder": "^4.0.1", - "@smithy/types": "^4.1.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.693.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/property-provider": { - "version": "4.0.1", + "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/middleware-host-header": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", + "@aws-sdk/types": "3.692.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/protocol-http": { - "version": "5.0.1", + "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/middleware-logger": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", + "@aws-sdk/types": "3.692.0", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/shared-ini-file-loader": { - "version": "4.0.1", + "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", + "@aws-sdk/types": "3.692.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/signature-v4": { - "version": "5.0.1", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@smithy/is-array-buffer": "^4.0.0", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-hex-encoding": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-uri-escape": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", + "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@smithy/core": "^2.5.2", + "@smithy/protocol-http": "^4.1.6", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/smithy-client": { - "version": "4.1.6", + "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/region-config-resolver": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/core": "^3.1.5", - "@smithy/middleware-endpoint": "^4.0.6", - "@smithy/middleware-stack": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-stream": "^4.1.2", + "@aws-sdk/types": "3.692.0", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/types": "^3.7.0", + "@smithy/util-config-provider": "^3.0.0", + "@smithy/util-middleware": "^3.0.9", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/types": { - "version": "4.1.0", + "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/token-providers": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sso-oidc": "^3.693.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/url-parser": { - "version": "4.0.1", + "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/util-endpoints": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/querystring-parser": "^4.0.1", - "@smithy/types": "^4.1.0", + "@aws-sdk/types": "3.692.0", + "@smithy/types": "^3.7.0", + "@smithy/util-endpoints": "^2.1.5", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/util-base64": { - "version": "4.0.0", + "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/util-buffer-from": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", + "@aws-sdk/types": "3.692.0", + "@smithy/types": "^3.7.0", + "bowser": "^2.11.0", "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/util-body-length-browser": { - "version": "4.0.0", + "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/util-middleware": { - "version": "4.0.1", + "node_modules/@aws-sdk/client-ec2/node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/util-utf8": { - "version": "4.0.0", + "node_modules/@aws-sdk/client-ec2/node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/util-buffer-from": "^4.0.0", + "@smithy/is-array-buffer": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-node": { - "version": "3.758.0", + "node_modules/@aws-sdk/client-ec2/node_modules/@smithy/util-utf8": { + "version": "3.0.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@aws-sdk/credential-provider-env": "3.758.0", - "@aws-sdk/credential-provider-http": "3.758.0", - "@aws-sdk/credential-provider-ini": "3.758.0", - "@aws-sdk/credential-provider-process": "3.758.0", - "@aws-sdk/credential-provider-sso": "3.758.0", - "@aws-sdk/credential-provider-web-identity": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@smithy/credential-provider-imds": "^4.0.1", - "@smithy/property-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", + "@smithy/util-buffer-from": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/types": { - "version": "3.734.0", + "node_modules/@aws-sdk/client-iam": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.693.0", + "@aws-sdk/client-sts": "3.693.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-node": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", + "@smithy/util-waiter": "^3.1.8", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-node/node_modules/@smithy/property-provider": { - "version": "4.0.1", + "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/client-sso": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-node/node_modules/@smithy/shared-ini-file-loader": { - "version": "4.0.1", + "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/client-sso-oidc": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-node": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-node/node_modules/@smithy/types": { - "version": "4.1.0", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "tslib": "^2.6.2" + "node": ">=16.0.0" }, - "engines": { - "node": ">=18.0.0" + "peerDependencies": { + "@aws-sdk/client-sts": "^3.693.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process": { - "version": "3.758.0", + "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/client-sts": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@aws-sdk/core": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@smithy/property-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.693.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-node": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@aws-sdk/core": { - "version": "3.758.0", + "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/core": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/core": "^3.1.5", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/property-provider": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/signature-v4": "^5.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", - "@smithy/util-middleware": "^4.0.1", + "@aws-sdk/types": "3.692.0", + "@smithy/core": "^2.5.2", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/property-provider": "^3.1.9", + "@smithy/protocol-http": "^4.1.6", + "@smithy/signature-v4": "^4.2.2", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/util-middleware": "^3.0.9", "fast-xml-parser": "4.4.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@aws-sdk/types": { - "version": "3.734.0", + "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/credential-provider-http": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/util-stream": "^3.3.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/core": { - "version": "3.1.5", + "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/middleware-serde": "^4.0.2", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-body-length-browser": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-stream": "^4.1.2", - "@smithy/util-utf8": "^4.0.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-env": "3.693.0", + "@aws-sdk/credential-provider-http": "3.693.0", + "@aws-sdk/credential-provider-process": "3.693.0", + "@aws-sdk/credential-provider-sso": "3.693.0", + "@aws-sdk/credential-provider-web-identity": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/credential-provider-imds": "^3.2.6", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.693.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/middleware-endpoint": { - "version": "4.0.6", + "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/credential-provider-node": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/core": "^3.1.5", - "@smithy/middleware-serde": "^4.0.2", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/url-parser": "^4.0.1", - "@smithy/util-middleware": "^4.0.1", + "@aws-sdk/credential-provider-env": "3.693.0", + "@aws-sdk/credential-provider-http": "3.693.0", + "@aws-sdk/credential-provider-ini": "3.693.0", + "@aws-sdk/credential-provider-process": "3.693.0", + "@aws-sdk/credential-provider-sso": "3.693.0", + "@aws-sdk/credential-provider-web-identity": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/credential-provider-imds": "^3.2.6", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/middleware-serde": { - "version": "4.0.2", + "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", + "@aws-sdk/client-sso": "3.693.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/token-providers": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/middleware-stack": { - "version": "4.0.1", + "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.693.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/node-config-provider": { - "version": "4.0.1", + "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/middleware-host-header": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/property-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", + "@aws-sdk/types": "3.692.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/property-provider": { - "version": "4.0.1", + "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/middleware-logger": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", + "@aws-sdk/types": "3.692.0", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/protocol-http": { - "version": "5.0.1", + "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", + "@aws-sdk/types": "3.692.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/shared-ini-file-loader": { - "version": "4.0.1", + "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@smithy/core": "^2.5.2", + "@smithy/protocol-http": "^4.1.6", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } - }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/signature-v4": { - "version": "5.0.1", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@smithy/is-array-buffer": "^4.0.0", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-hex-encoding": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-uri-escape": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", + }, + "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/region-config-resolver": { + "version": "3.693.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/types": "^3.7.0", + "@smithy/util-config-provider": "^3.0.0", + "@smithy/util-middleware": "^3.0.9", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/smithy-client": { - "version": "4.1.6", + "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/token-providers": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/core": "^3.1.5", - "@smithy/middleware-endpoint": "^4.0.6", - "@smithy/middleware-stack": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-stream": "^4.1.2", + "@aws-sdk/types": "3.692.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sso-oidc": "^3.693.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/types": { - "version": "4.1.0", + "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/util-endpoints": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/types": "^3.7.0", + "@smithy/util-endpoints": "^2.1.5", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/url-parser": { - "version": "4.0.1", + "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/querystring-parser": "^4.0.1", - "@smithy/types": "^4.1.0", + "@aws-sdk/types": "3.692.0", + "@smithy/types": "^3.7.0", + "bowser": "^2.11.0", "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/util-body-length-browser": { - "version": "4.0.0", + "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/util-middleware": { - "version": "4.0.1", + "node_modules/@aws-sdk/client-iam/node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/util-utf8": { - "version": "4.0.0", + "node_modules/@aws-sdk/client-iam/node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/util-buffer-from": "^4.0.0", + "@smithy/is-array-buffer": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.758.0", + "node_modules/@aws-sdk/client-iam/node_modules/@smithy/util-utf8": { + "version": "3.0.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@aws-sdk/client-sso": "3.758.0", - "@aws-sdk/core": "3.758.0", - "@aws-sdk/token-providers": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@smithy/property-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", + "@smithy/util-buffer-from": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/core": { - "version": "3.758.0", + "node_modules/@aws-sdk/client-lambda": { + "version": "3.637.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/core": "^3.1.5", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/property-provider": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/signature-v4": "^5.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", - "@smithy/util-middleware": "^4.0.1", - "fast-xml-parser": "4.4.1", + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.637.0", + "@aws-sdk/client-sts": "3.637.0", + "@aws-sdk/core": "3.635.0", + "@aws-sdk/credential-provider-node": "3.637.0", + "@aws-sdk/middleware-host-header": "3.620.0", + "@aws-sdk/middleware-logger": "3.609.0", + "@aws-sdk/middleware-recursion-detection": "3.620.0", + "@aws-sdk/middleware-user-agent": "3.637.0", + "@aws-sdk/region-config-resolver": "3.614.0", + "@aws-sdk/types": "3.609.0", + "@aws-sdk/util-endpoints": "3.637.0", + "@aws-sdk/util-user-agent-browser": "3.609.0", + "@aws-sdk/util-user-agent-node": "3.614.0", + "@smithy/config-resolver": "^3.0.5", + "@smithy/core": "^2.4.0", + "@smithy/eventstream-serde-browser": "^3.0.6", + "@smithy/eventstream-serde-config-resolver": "^3.0.3", + "@smithy/eventstream-serde-node": "^3.0.5", + "@smithy/fetch-http-handler": "^3.2.4", + "@smithy/hash-node": "^3.0.3", + "@smithy/invalid-dependency": "^3.0.3", + "@smithy/middleware-content-length": "^3.0.5", + "@smithy/middleware-endpoint": "^3.1.0", + "@smithy/middleware-retry": "^3.0.15", + "@smithy/middleware-serde": "^3.0.3", + "@smithy/middleware-stack": "^3.0.3", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/node-http-handler": "^3.1.4", + "@smithy/protocol-http": "^4.1.0", + "@smithy/smithy-client": "^3.2.0", + "@smithy/types": "^3.3.0", + "@smithy/url-parser": "^3.0.3", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.15", + "@smithy/util-defaults-mode-node": "^3.0.15", + "@smithy/util-endpoints": "^2.0.5", + "@smithy/util-middleware": "^3.0.3", + "@smithy/util-retry": "^3.0.3", + "@smithy/util-stream": "^3.1.3", + "@smithy/util-utf8": "^3.0.0", + "@smithy/util-waiter": "^3.1.2", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers": { - "version": "3.758.0", + "node_modules/@aws-sdk/client-lambda/node_modules/@aws-sdk/types": { + "version": "3.609.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@aws-sdk/nested-clients": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@smithy/property-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", + "@smithy/types": "^3.3.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/types": { - "version": "3.734.0", + "node_modules/@aws-sdk/client-lambda/node_modules/@smithy/fetch-http-handler": { + "version": "3.2.4", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", + "@smithy/protocol-http": "^4.1.0", + "@smithy/querystring-builder": "^3.0.3", + "@smithy/types": "^3.3.0", + "@smithy/util-base64": "^3.0.0", "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/core": { - "version": "3.1.5", + "node_modules/@aws-sdk/client-lambda/node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/middleware-serde": "^4.0.2", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-body-length-browser": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-stream": "^4.1.2", - "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/middleware-endpoint": { - "version": "4.0.6", + "node_modules/@aws-sdk/client-lambda/node_modules/@smithy/util-utf8": { + "version": "3.0.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/core": "^3.1.5", - "@smithy/middleware-serde": "^4.0.2", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/url-parser": "^4.0.1", - "@smithy/util-middleware": "^4.0.1", + "@smithy/util-buffer-from": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/middleware-serde": { - "version": "4.0.2", + "node_modules/@aws-sdk/client-lambda/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", + "@smithy/is-array-buffer": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/middleware-stack": { - "version": "4.0.1", + "node_modules/@aws-sdk/client-s3": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", + "@aws-crypto/sha1-browser": "5.2.0", + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.693.0", + "@aws-sdk/client-sts": "3.693.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-node": "3.693.0", + "@aws-sdk/middleware-bucket-endpoint": "3.693.0", + "@aws-sdk/middleware-expect-continue": "3.693.0", + "@aws-sdk/middleware-flexible-checksums": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-location-constraint": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-sdk-s3": "3.693.0", + "@aws-sdk/middleware-ssec": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/signature-v4-multi-region": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@aws-sdk/xml-builder": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/eventstream-serde-browser": "^3.0.12", + "@smithy/eventstream-serde-config-resolver": "^3.0.9", + "@smithy/eventstream-serde-node": "^3.0.11", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-blob-browser": "^3.1.8", + "@smithy/hash-node": "^3.0.9", + "@smithy/hash-stream-node": "^3.1.8", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/md5-js": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-stream": "^3.3.0", + "@smithy/util-utf8": "^3.0.0", + "@smithy/util-waiter": "^3.1.8", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/node-config-provider": { - "version": "4.0.1", + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/client-sso": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/property-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/property-provider": { - "version": "4.0.1", + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/client-sso-oidc": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-node": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/protocol-http": { - "version": "5.0.1", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" + "node": ">=16.0.0" }, - "engines": { - "node": ">=18.0.0" + "peerDependencies": { + "@aws-sdk/client-sts": "^3.693.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/shared-ini-file-loader": { - "version": "4.0.1", + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/client-sts": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.693.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-node": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/signature-v4": { - "version": "5.0.1", + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/core": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/is-array-buffer": "^4.0.0", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-hex-encoding": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-uri-escape": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", + "@aws-sdk/types": "3.692.0", + "@smithy/core": "^2.5.2", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/property-provider": "^3.1.9", + "@smithy/protocol-http": "^4.1.6", + "@smithy/signature-v4": "^4.2.2", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/util-middleware": "^3.0.9", + "fast-xml-parser": "4.4.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/smithy-client": { - "version": "4.1.6", + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-http": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/core": "^3.1.5", - "@smithy/middleware-endpoint": "^4.0.6", - "@smithy/middleware-stack": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-stream": "^4.1.2", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/util-stream": "^3.3.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/types": { - "version": "4.1.0", + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-env": "3.693.0", + "@aws-sdk/credential-provider-http": "3.693.0", + "@aws-sdk/credential-provider-process": "3.693.0", + "@aws-sdk/credential-provider-sso": "3.693.0", + "@aws-sdk/credential-provider-web-identity": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/credential-provider-imds": "^3.2.6", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/url-parser": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@smithy/querystring-parser": "^4.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" + "node": ">=16.0.0" }, - "engines": { - "node": ">=18.0.0" + "peerDependencies": { + "@aws-sdk/client-sts": "^3.693.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/util-body-length-browser": { - "version": "4.0.0", + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-node": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { + "@aws-sdk/credential-provider-env": "3.693.0", + "@aws-sdk/credential-provider-http": "3.693.0", + "@aws-sdk/credential-provider-ini": "3.693.0", + "@aws-sdk/credential-provider-process": "3.693.0", + "@aws-sdk/credential-provider-sso": "3.693.0", + "@aws-sdk/credential-provider-web-identity": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/credential-provider-imds": "^3.2.6", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/util-middleware": { - "version": "4.0.1", + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", + "@aws-sdk/client-sso": "3.693.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/token-providers": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/util-utf8": { - "version": "4.0.0", + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/util-buffer-from": "^4.0.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.693.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/middleware-host-header": { + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-host-header": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -5082,7 +8906,7 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/middleware-logger": { + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-logger": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -5094,7 +8918,7 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/middleware-recursion-detection": { + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-recursion-detection": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -5107,7 +8931,7 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/middleware-user-agent": { + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-user-agent": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -5123,7 +8947,7 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/region-config-resolver": { + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/region-config-resolver": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -5138,7 +8962,7 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/token-providers": { + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/token-providers": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -5155,7 +8979,7 @@ "@aws-sdk/client-sso-oidc": "^3.693.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/util-endpoints": { + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/util-endpoints": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -5168,7 +8992,7 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/util-user-agent-browser": { + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/util-user-agent-browser": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -5178,7 +9002,7 @@ "tslib": "^2.6.2" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@aws-sdk/util-user-agent-node": { + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/util-user-agent-node": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -5200,422 +9024,529 @@ } } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/abort-controller": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/abort-controller/node_modules/@smithy/types": { - "version": "4.1.0", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/credential-provider-imds": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@smithy/node-config-provider": "^4.0.1", - "@smithy/property-provider": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/url-parser": "^4.0.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/credential-provider-imds/node_modules/@smithy/node-config-provider": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@smithy/property-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/credential-provider-imds/node_modules/@smithy/property-provider": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/credential-provider-imds/node_modules/@smithy/shared-ini-file-loader": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/credential-provider-imds/node_modules/@smithy/types": { - "version": "4.1.0", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/credential-provider-imds/node_modules/@smithy/url-parser": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@smithy/querystring-parser": "^4.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/is-array-buffer": { - "version": "4.0.0", + "node_modules/@aws-sdk/client-s3/node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", "license": "Apache-2.0", - "peer": true, "dependencies": { "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/querystring-builder": { - "version": "4.0.1", + "node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", - "@smithy/util-uri-escape": "^4.0.0", + "@smithy/is-array-buffer": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/querystring-builder/node_modules/@smithy/types": { - "version": "4.1.0", + "node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-utf8": { + "version": "3.0.0", "license": "Apache-2.0", - "peer": true, "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/querystring-parser": { - "version": "4.0.1", + "node_modules/@aws-sdk/client-sagemaker": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sagemaker/-/client-sagemaker-3.693.0.tgz", + "integrity": "sha512-iInrrb7V9f0CRBiVCaaxCbpoBRQ5BqxX4elRYI6gE/pSDD2tPqmRfm4reahMtTUcKg1jaSGuvqJLfOpp0HTozQ==", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.693.0", + "@aws-sdk/client-sts": "3.693.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-node": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", + "@smithy/util-waiter": "^3.1.8", + "@types/uuid": "^9.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/querystring-parser/node_modules/@smithy/types": { - "version": "4.1.0", + "node_modules/@aws-sdk/client-sagemaker/node_modules/@aws-sdk/client-sso": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.693.0.tgz", + "integrity": "sha512-QEynrBC26x6TG9ZMzApR/kZ3lmt4lEIs2D+cHuDxt6fDGzahBUsQFBwJqhizzsM97JJI5YvmJhmihoYjdSSaXA==", "license": "Apache-2.0", - "peer": true, "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/service-error-classification": { - "version": "4.0.1", + "node_modules/@aws-sdk/client-sagemaker/node_modules/@aws-sdk/client-sso-oidc": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.693.0.tgz", + "integrity": "sha512-UEDbYlYtK/e86OOMyFR4zEPyenIxDzO2DRdz3fwVW7RzZ94wfmSwBh/8skzPTuY1G7sI064cjHW0b0QG01Sdtg==", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0" + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-node": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.693.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/service-error-classification/node_modules/@smithy/types": { - "version": "4.1.0", + "node_modules/@aws-sdk/client-sagemaker/node_modules/@aws-sdk/client-sts": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.693.0.tgz", + "integrity": "sha512-4S2y7VEtvdnjJX4JPl4kDQlslxXEZFnC50/UXVUYSt/AMc5A/GgspFNA5FVz4E3Gwpfobbf23hR2NBF8AGvYoQ==", "license": "Apache-2.0", - "peer": true, "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.693.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-node": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/util-buffer-from": { - "version": "4.0.0", + "node_modules/@aws-sdk/client-sagemaker/node_modules/@aws-sdk/core": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.693.0.tgz", + "integrity": "sha512-v6Z/kWmLFqRLDPEwl9hJGhtTgIFHjZugSfF1Yqffdxf4n1AWgtHS7qSegakuMyN5pP4K2tvUD8qHJ+gGe2Bw2A==", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/is-array-buffer": "^4.0.0", + "@aws-sdk/types": "3.692.0", + "@smithy/core": "^2.5.2", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/property-provider": "^3.1.9", + "@smithy/protocol-http": "^4.1.6", + "@smithy/signature-v4": "^4.2.2", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/util-middleware": "^3.0.9", + "fast-xml-parser": "4.4.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/util-hex-encoding": { - "version": "4.0.0", + "node_modules/@aws-sdk/client-sagemaker/node_modules/@aws-sdk/credential-provider-http": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.693.0.tgz", + "integrity": "sha512-sL8MvwNJU7ZpD7/d2VVb3by1GknIJUxzTIgYtVkDVA/ojo+KRQSSHxcj0EWWXF5DTSh2Tm+LrEug3y1ZyKHsDA==", "license": "Apache-2.0", - "peer": true, "dependencies": { + "@aws-sdk/core": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/util-stream": "^3.3.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/util-stream": { - "version": "4.1.2", + "node_modules/@aws-sdk/client-sagemaker/node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.693.0.tgz", + "integrity": "sha512-kvaa4mXhCCOuW7UQnBhYqYfgWmwy7WSBSDClutwSLPZvgrhYj2l16SD2lN4IfYdxARYMJJ1lFYp3/jJG/9Yk4Q==", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/fetch-http-handler": "^5.0.1", - "@smithy/node-http-handler": "^4.0.3", - "@smithy/types": "^4.1.0", - "@smithy/util-base64": "^4.0.0", - "@smithy/util-buffer-from": "^4.0.0", - "@smithy/util-hex-encoding": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-env": "3.693.0", + "@aws-sdk/credential-provider-http": "3.693.0", + "@aws-sdk/credential-provider-process": "3.693.0", + "@aws-sdk/credential-provider-sso": "3.693.0", + "@aws-sdk/credential-provider-web-identity": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/credential-provider-imds": "^3.2.6", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.693.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/util-stream/node_modules/@smithy/fetch-http-handler": { - "version": "5.0.1", + "node_modules/@aws-sdk/client-sagemaker/node_modules/@aws-sdk/credential-provider-node": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.693.0.tgz", + "integrity": "sha512-42WMsBjTNnjYxYuM3qD/Nq+8b7UdMopUq5OduMDxoM3mFTV6PXMMnfI4Z1TNnR4tYRvPXAnuNltF6xmjKbSJRA==", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/protocol-http": "^5.0.1", - "@smithy/querystring-builder": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-base64": "^4.0.0", + "@aws-sdk/credential-provider-env": "3.693.0", + "@aws-sdk/credential-provider-http": "3.693.0", + "@aws-sdk/credential-provider-ini": "3.693.0", + "@aws-sdk/credential-provider-process": "3.693.0", + "@aws-sdk/credential-provider-sso": "3.693.0", + "@aws-sdk/credential-provider-web-identity": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/credential-provider-imds": "^3.2.6", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/util-stream/node_modules/@smithy/node-http-handler": { - "version": "4.0.3", + "node_modules/@aws-sdk/client-sagemaker/node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.693.0.tgz", + "integrity": "sha512-479UlJxY+BFjj3pJFYUNC0DCMrykuG7wBAXfsvZqQxKUa83DnH5Q1ID/N2hZLkxjGd4ZW0AC3lTOMxFelGzzpQ==", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/abort-controller": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/querystring-builder": "^4.0.1", - "@smithy/types": "^4.1.0", + "@aws-sdk/client-sso": "3.693.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/token-providers": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/util-stream/node_modules/@smithy/protocol-http": { - "version": "5.0.1", + "node_modules/@aws-sdk/client-sagemaker/node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.693.0.tgz", + "integrity": "sha512-8LB210Pr6VeCiSb2hIra+sAH4KUBLyGaN50axHtIgufVK8jbKIctTZcVY5TO9Se+1107TsruzeXS7VeqVdJfFA==", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/util-stream/node_modules/@smithy/types": { - "version": "4.1.0", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "tslib": "^2.6.2" + "node": ">=16.0.0" }, - "engines": { - "node": ">=18.0.0" + "peerDependencies": { + "@aws-sdk/client-sts": "^3.693.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/util-stream/node_modules/@smithy/util-base64": { - "version": "4.0.0", + "node_modules/@aws-sdk/client-sagemaker/node_modules/@aws-sdk/middleware-host-header": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.693.0.tgz", + "integrity": "sha512-BCki6sAZ5jYwIN/t3ElCiwerHad69ipHwPsDCxJQyeiOnJ8HG+lEpnVIfrnI8A0fLQNSF3Gtx6ahfBpKiv1Oug==", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/util-buffer-from": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", + "@aws-sdk/types": "3.692.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/util-stream/node_modules/@smithy/util-utf8": { - "version": "4.0.0", + "node_modules/@aws-sdk/client-sagemaker/node_modules/@aws-sdk/middleware-logger": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.693.0.tgz", + "integrity": "sha512-dXnXDPr+wIiJ1TLADACI1g9pkSB21KkMIko2u4CJ2JCBoxi5IqeTnVoa6YcC8GdFNVRl+PorZ3Zqfmf1EOTC6w==", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/util-buffer-from": "^4.0.0", + "@aws-sdk/types": "3.692.0", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/util-uri-escape": { - "version": "4.0.0", + "node_modules/@aws-sdk/client-sagemaker/node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.693.0.tgz", + "integrity": "sha512-0LDmM+VxXp0u3rG0xQRWD/q6Ubi7G8I44tBPahevD5CaiDZTkmNTrVUf0VEJgVe0iCKBppACMBDkLB0/ETqkFw==", "license": "Apache-2.0", - "peer": true, "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/util-utf8": { - "version": "3.0.0", + "node_modules/@aws-sdk/client-sagemaker/node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.693.0.tgz", + "integrity": "sha512-/KUq/KEpFFbQmNmpp7SpAtFAdViquDfD2W0QcG07zYBfz9MwE2ig48ALynXm5sMpRmnG7sJXjdvPtTsSVPfkiw==", "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@smithy/core": "^2.5.2", + "@smithy/protocol-http": "^4.1.6", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/util-utf8/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", + "node_modules/@aws-sdk/client-sagemaker/node_modules/@aws-sdk/region-config-resolver": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.693.0.tgz", + "integrity": "sha512-YLUkMsUY0GLW/nfwlZ69cy1u07EZRmsv8Z9m0qW317/EZaVx59hcvmcvb+W4bFqj5E8YImTjoGfE4cZ0F9mkyw==", "license": "Apache-2.0", "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/types": "^3.7.0", + "@smithy/util-config-provider": "^3.0.0", + "@smithy/util-middleware": "^3.0.9", "tslib": "^2.6.2" }, "engines": { "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-codecatalyst/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", + "node_modules/@aws-sdk/client-sagemaker/node_modules/@aws-sdk/token-providers": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.693.0.tgz", + "integrity": "sha512-nDBTJMk1l/YmFULGfRbToOA2wjf+FkQT4dMgYCv+V9uSYsMzQj8A7Tha2dz9yv4vnQgYaEiErQ8d7HVyXcVEoA==", "license": "Apache-2.0", "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", + "@aws-sdk/types": "3.692.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sso-oidc": "^3.693.0" } }, - "node_modules/@aws-sdk/client-cognito-identity": { - "version": "3.637.0", + "node_modules/@aws-sdk/client-sagemaker/node_modules/@aws-sdk/util-endpoints": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.693.0.tgz", + "integrity": "sha512-eo4F6DRQ/kxS3gxJpLRv+aDNy76DxQJL5B3DPzpr9Vkq0ygVoi4GT5oIZLVaAVIJmi6k5qq9dLsYZfWLUxJJSg==", "license": "Apache-2.0", "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.637.0", - "@aws-sdk/client-sts": "3.637.0", - "@aws-sdk/core": "3.635.0", - "@aws-sdk/credential-provider-node": "3.637.0", - "@aws-sdk/middleware-host-header": "3.620.0", - "@aws-sdk/middleware-logger": "3.609.0", - "@aws-sdk/middleware-recursion-detection": "3.620.0", - "@aws-sdk/middleware-user-agent": "3.637.0", - "@aws-sdk/region-config-resolver": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@aws-sdk/util-user-agent-browser": "3.609.0", - "@aws-sdk/util-user-agent-node": "3.614.0", - "@smithy/config-resolver": "^3.0.5", - "@smithy/core": "^2.4.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/hash-node": "^3.0.3", - "@smithy/invalid-dependency": "^3.0.3", - "@smithy/middleware-content-length": "^3.0.5", - "@smithy/middleware-endpoint": "^3.1.0", - "@smithy/middleware-retry": "^3.0.15", - "@smithy/middleware-serde": "^3.0.3", - "@smithy/middleware-stack": "^3.0.3", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/url-parser": "^3.0.3", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.15", - "@smithy/util-defaults-mode-node": "^3.0.15", - "@smithy/util-endpoints": "^2.0.5", - "@smithy/util-middleware": "^3.0.3", - "@smithy/util-retry": "^3.0.3", - "@smithy/util-utf8": "^3.0.0", + "@aws-sdk/types": "3.692.0", + "@smithy/types": "^3.7.0", + "@smithy/util-endpoints": "^2.1.5", "tslib": "^2.6.2" }, "engines": { "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/types": { - "version": "3.609.0", + "node_modules/@aws-sdk/client-sagemaker/node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.693.0.tgz", + "integrity": "sha512-6EUfuKOujtddy18OLJUaXfKBgs+UcbZ6N/3QV4iOkubCUdeM1maIqs++B9bhCbWeaeF5ORizJw5FTwnyNjE/mw==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^3.3.0", + "@aws-sdk/types": "3.692.0", + "@smithy/types": "^3.7.0", + "bowser": "^2.11.0", "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/fetch-http-handler": { - "version": "3.2.4", + "node_modules/@aws-sdk/client-sagemaker/node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.693.0.tgz", + "integrity": "sha512-td0OVX8m5ZKiXtecIDuzY3Y3UZIzvxEr57Hp21NOwieqKCG2UeyQWWeGPv0FQaU7dpTkvFmVNI+tx9iB8V/Nhg==", "license": "Apache-2.0", "dependencies": { - "@smithy/protocol-http": "^4.1.0", - "@smithy/querystring-builder": "^3.0.3", - "@smithy/types": "^3.3.0", - "@smithy/util-base64": "^3.0.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } } }, - "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/is-array-buffer": { + "node_modules/@aws-sdk/client-sagemaker/node_modules/@smithy/is-array-buffer": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", + "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -5624,30 +9555,36 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/util-utf8": { + "node_modules/@aws-sdk/client-sagemaker/node_modules/@smithy/util-buffer-from": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", + "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", + "@smithy/is-array-buffer": "^3.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from": { + "node_modules/@aws-sdk/client-sagemaker/node_modules/@smithy/util-utf8": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", + "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", "license": "Apache-2.0", "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", + "@smithy/util-buffer-from": "^3.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-ec2": { - "version": "3.695.0", + "node_modules/@aws-sdk/client-sfn": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sfn/-/client-sfn-3.693.0.tgz", + "integrity": "sha512-B2K3aXGnP7eD1ITEIx4kO43l1N5OLqHdLW4AUbwoopwU5qzicc9jADrthXpGxymJI8AhJz9T2WtLmceBU2EpNg==", "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", @@ -5659,7 +9596,6 @@ "@aws-sdk/middleware-host-header": "3.693.0", "@aws-sdk/middleware-logger": "3.693.0", "@aws-sdk/middleware-recursion-detection": "3.693.0", - "@aws-sdk/middleware-sdk-ec2": "3.693.0", "@aws-sdk/middleware-user-agent": "3.693.0", "@aws-sdk/region-config-resolver": "3.693.0", "@aws-sdk/types": "3.692.0", @@ -5691,7 +9627,6 @@ "@smithy/util-middleware": "^3.0.9", "@smithy/util-retry": "^3.0.9", "@smithy/util-utf8": "^3.0.0", - "@smithy/util-waiter": "^3.1.8", "@types/uuid": "^9.0.1", "tslib": "^2.6.2", "uuid": "^9.0.1" @@ -5700,8 +9635,10 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/client-sso": { + "node_modules/@aws-sdk/client-sfn/node_modules/@aws-sdk/client-sso": { "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.693.0.tgz", + "integrity": "sha512-QEynrBC26x6TG9ZMzApR/kZ3lmt4lEIs2D+cHuDxt6fDGzahBUsQFBwJqhizzsM97JJI5YvmJhmihoYjdSSaXA==", "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", @@ -5747,8 +9684,10 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/client-sso-oidc": { + "node_modules/@aws-sdk/client-sfn/node_modules/@aws-sdk/client-sso-oidc": { "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.693.0.tgz", + "integrity": "sha512-UEDbYlYtK/e86OOMyFR4zEPyenIxDzO2DRdz3fwVW7RzZ94wfmSwBh/8skzPTuY1G7sI064cjHW0b0QG01Sdtg==", "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", @@ -5798,8 +9737,10 @@ "@aws-sdk/client-sts": "^3.693.0" } }, - "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/client-sts": { + "node_modules/@aws-sdk/client-sfn/node_modules/@aws-sdk/client-sts": { "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.693.0.tgz", + "integrity": "sha512-4S2y7VEtvdnjJX4JPl4kDQlslxXEZFnC50/UXVUYSt/AMc5A/GgspFNA5FVz4E3Gwpfobbf23hR2NBF8AGvYoQ==", "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", @@ -5847,8 +9788,10 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/core": { + "node_modules/@aws-sdk/client-sfn/node_modules/@aws-sdk/core": { "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.693.0.tgz", + "integrity": "sha512-v6Z/kWmLFqRLDPEwl9hJGhtTgIFHjZugSfF1Yqffdxf4n1AWgtHS7qSegakuMyN5pP4K2tvUD8qHJ+gGe2Bw2A==", "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.692.0", @@ -5867,8 +9810,10 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/credential-provider-http": { + "node_modules/@aws-sdk/client-sfn/node_modules/@aws-sdk/credential-provider-http": { "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.693.0.tgz", + "integrity": "sha512-sL8MvwNJU7ZpD7/d2VVb3by1GknIJUxzTIgYtVkDVA/ojo+KRQSSHxcj0EWWXF5DTSh2Tm+LrEug3y1ZyKHsDA==", "license": "Apache-2.0", "dependencies": { "@aws-sdk/core": "3.693.0", @@ -5886,8 +9831,10 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/credential-provider-ini": { + "node_modules/@aws-sdk/client-sfn/node_modules/@aws-sdk/credential-provider-ini": { "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.693.0.tgz", + "integrity": "sha512-kvaa4mXhCCOuW7UQnBhYqYfgWmwy7WSBSDClutwSLPZvgrhYj2l16SD2lN4IfYdxARYMJJ1lFYp3/jJG/9Yk4Q==", "license": "Apache-2.0", "dependencies": { "@aws-sdk/core": "3.693.0", @@ -5910,8 +9857,10 @@ "@aws-sdk/client-sts": "^3.693.0" } }, - "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/credential-provider-node": { + "node_modules/@aws-sdk/client-sfn/node_modules/@aws-sdk/credential-provider-node": { "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.693.0.tgz", + "integrity": "sha512-42WMsBjTNnjYxYuM3qD/Nq+8b7UdMopUq5OduMDxoM3mFTV6PXMMnfI4Z1TNnR4tYRvPXAnuNltF6xmjKbSJRA==", "license": "Apache-2.0", "dependencies": { "@aws-sdk/credential-provider-env": "3.693.0", @@ -5931,8 +9880,10 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/credential-provider-sso": { + "node_modules/@aws-sdk/client-sfn/node_modules/@aws-sdk/credential-provider-sso": { "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.693.0.tgz", + "integrity": "sha512-479UlJxY+BFjj3pJFYUNC0DCMrykuG7wBAXfsvZqQxKUa83DnH5Q1ID/N2hZLkxjGd4ZW0AC3lTOMxFelGzzpQ==", "license": "Apache-2.0", "dependencies": { "@aws-sdk/client-sso": "3.693.0", @@ -5948,8 +9899,10 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/credential-provider-web-identity": { + "node_modules/@aws-sdk/client-sfn/node_modules/@aws-sdk/credential-provider-web-identity": { "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.693.0.tgz", + "integrity": "sha512-8LB210Pr6VeCiSb2hIra+sAH4KUBLyGaN50axHtIgufVK8jbKIctTZcVY5TO9Se+1107TsruzeXS7VeqVdJfFA==", "license": "Apache-2.0", "dependencies": { "@aws-sdk/core": "3.693.0", @@ -5965,8 +9918,10 @@ "@aws-sdk/client-sts": "^3.693.0" } }, - "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/middleware-host-header": { + "node_modules/@aws-sdk/client-sfn/node_modules/@aws-sdk/middleware-host-header": { "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.693.0.tgz", + "integrity": "sha512-BCki6sAZ5jYwIN/t3ElCiwerHad69ipHwPsDCxJQyeiOnJ8HG+lEpnVIfrnI8A0fLQNSF3Gtx6ahfBpKiv1Oug==", "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.692.0", @@ -5978,8 +9933,10 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/middleware-logger": { + "node_modules/@aws-sdk/client-sfn/node_modules/@aws-sdk/middleware-logger": { "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.693.0.tgz", + "integrity": "sha512-dXnXDPr+wIiJ1TLADACI1g9pkSB21KkMIko2u4CJ2JCBoxi5IqeTnVoa6YcC8GdFNVRl+PorZ3Zqfmf1EOTC6w==", "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.692.0", @@ -5990,8 +9947,10 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/middleware-recursion-detection": { + "node_modules/@aws-sdk/client-sfn/node_modules/@aws-sdk/middleware-recursion-detection": { "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.693.0.tgz", + "integrity": "sha512-0LDmM+VxXp0u3rG0xQRWD/q6Ubi7G8I44tBPahevD5CaiDZTkmNTrVUf0VEJgVe0iCKBppACMBDkLB0/ETqkFw==", "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.692.0", @@ -6003,8 +9962,10 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/middleware-user-agent": { + "node_modules/@aws-sdk/client-sfn/node_modules/@aws-sdk/middleware-user-agent": { "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.693.0.tgz", + "integrity": "sha512-/KUq/KEpFFbQmNmpp7SpAtFAdViquDfD2W0QcG07zYBfz9MwE2ig48ALynXm5sMpRmnG7sJXjdvPtTsSVPfkiw==", "license": "Apache-2.0", "dependencies": { "@aws-sdk/core": "3.693.0", @@ -6019,8 +9980,10 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/region-config-resolver": { + "node_modules/@aws-sdk/client-sfn/node_modules/@aws-sdk/region-config-resolver": { "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.693.0.tgz", + "integrity": "sha512-YLUkMsUY0GLW/nfwlZ69cy1u07EZRmsv8Z9m0qW317/EZaVx59hcvmcvb+W4bFqj5E8YImTjoGfE4cZ0F9mkyw==", "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.692.0", @@ -6034,8 +9997,10 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/token-providers": { + "node_modules/@aws-sdk/client-sfn/node_modules/@aws-sdk/token-providers": { "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.693.0.tgz", + "integrity": "sha512-nDBTJMk1l/YmFULGfRbToOA2wjf+FkQT4dMgYCv+V9uSYsMzQj8A7Tha2dz9yv4vnQgYaEiErQ8d7HVyXcVEoA==", "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.692.0", @@ -6051,8 +10016,10 @@ "@aws-sdk/client-sso-oidc": "^3.693.0" } }, - "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/util-endpoints": { + "node_modules/@aws-sdk/client-sfn/node_modules/@aws-sdk/util-endpoints": { "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.693.0.tgz", + "integrity": "sha512-eo4F6DRQ/kxS3gxJpLRv+aDNy76DxQJL5B3DPzpr9Vkq0ygVoi4GT5oIZLVaAVIJmi6k5qq9dLsYZfWLUxJJSg==", "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.692.0", @@ -6064,8 +10031,10 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/util-user-agent-browser": { + "node_modules/@aws-sdk/client-sfn/node_modules/@aws-sdk/util-user-agent-browser": { "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.693.0.tgz", + "integrity": "sha512-6EUfuKOujtddy18OLJUaXfKBgs+UcbZ6N/3QV4iOkubCUdeM1maIqs++B9bhCbWeaeF5ORizJw5FTwnyNjE/mw==", "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.692.0", @@ -6074,8 +10043,10 @@ "tslib": "^2.6.2" } }, - "node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/util-user-agent-node": { + "node_modules/@aws-sdk/client-sfn/node_modules/@aws-sdk/util-user-agent-node": { "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.693.0.tgz", + "integrity": "sha512-td0OVX8m5ZKiXtecIDuzY3Y3UZIzvxEr57Hp21NOwieqKCG2UeyQWWeGPv0FQaU7dpTkvFmVNI+tx9iB8V/Nhg==", "license": "Apache-2.0", "dependencies": { "@aws-sdk/middleware-user-agent": "3.693.0", @@ -6096,8 +10067,10 @@ } } }, - "node_modules/@aws-sdk/client-ec2/node_modules/@smithy/is-array-buffer": { + "node_modules/@aws-sdk/client-sfn/node_modules/@smithy/is-array-buffer": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", + "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -6106,8 +10079,10 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-ec2/node_modules/@smithy/util-buffer-from": { + "node_modules/@aws-sdk/client-sfn/node_modules/@smithy/util-buffer-from": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", + "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", "license": "Apache-2.0", "dependencies": { "@smithy/is-array-buffer": "^3.0.0", @@ -6117,8 +10092,10 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-ec2/node_modules/@smithy/util-utf8": { + "node_modules/@aws-sdk/client-sfn/node_modules/@smithy/util-utf8": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", + "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", "license": "Apache-2.0", "dependencies": { "@smithy/util-buffer-from": "^3.0.0", @@ -6128,7 +10105,7 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-iam": { + "node_modules/@aws-sdk/client-ssm": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -6173,13 +10150,15 @@ "@smithy/util-retry": "^3.0.9", "@smithy/util-utf8": "^3.0.0", "@smithy/util-waiter": "^3.1.8", - "tslib": "^2.6.2" + "@types/uuid": "^9.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" }, "engines": { "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/client-sso": { + "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/client-sso": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -6226,7 +10205,7 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/client-sso-oidc": { + "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/client-sso-oidc": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -6277,7 +10256,7 @@ "@aws-sdk/client-sts": "^3.693.0" } }, - "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/client-sts": { + "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/client-sts": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -6326,7 +10305,7 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/core": { + "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/core": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -6346,7 +10325,7 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/credential-provider-http": { + "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/credential-provider-http": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -6365,7 +10344,7 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/credential-provider-ini": { + "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/credential-provider-ini": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -6389,7 +10368,7 @@ "@aws-sdk/client-sts": "^3.693.0" } }, - "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/credential-provider-node": { + "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/credential-provider-node": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -6410,7 +10389,7 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/credential-provider-sso": { + "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/credential-provider-sso": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -6427,7 +10406,7 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/credential-provider-web-identity": { + "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/credential-provider-web-identity": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -6444,7 +10423,7 @@ "@aws-sdk/client-sts": "^3.693.0" } }, - "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/middleware-host-header": { + "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/middleware-host-header": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -6457,7 +10436,7 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/middleware-logger": { + "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/middleware-logger": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -6469,7 +10448,7 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/middleware-recursion-detection": { + "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/middleware-recursion-detection": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -6482,7 +10461,7 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/middleware-user-agent": { + "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/middleware-user-agent": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -6498,7 +10477,7 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/region-config-resolver": { + "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/region-config-resolver": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -6513,7 +10492,7 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/token-providers": { + "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/token-providers": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -6530,7 +10509,7 @@ "@aws-sdk/client-sso-oidc": "^3.693.0" } }, - "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/util-endpoints": { + "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/util-endpoints": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -6543,7 +10522,7 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/util-user-agent-browser": { + "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/util-user-agent-browser": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -6553,7 +10532,7 @@ "tslib": "^2.6.2" } }, - "node_modules/@aws-sdk/client-iam/node_modules/@aws-sdk/util-user-agent-node": { + "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/util-user-agent-node": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { @@ -6575,7 +10554,7 @@ } } }, - "node_modules/@aws-sdk/client-iam/node_modules/@smithy/is-array-buffer": { + "node_modules/@aws-sdk/client-ssm/node_modules/@smithy/is-array-buffer": { "version": "3.0.0", "license": "Apache-2.0", "dependencies": { @@ -6585,7 +10564,7 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-iam/node_modules/@smithy/util-buffer-from": { + "node_modules/@aws-sdk/client-ssm/node_modules/@smithy/util-buffer-from": { "version": "3.0.0", "license": "Apache-2.0", "dependencies": { @@ -6596,7 +10575,7 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-iam/node_modules/@smithy/util-utf8": { + "node_modules/@aws-sdk/client-ssm/node_modules/@smithy/util-utf8": { "version": "3.0.0", "license": "Apache-2.0", "dependencies": { @@ -6607,14 +10586,59 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-lambda": { + "node_modules/@aws-sdk/client-sso": { + "version": "3.637.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.635.0", + "@aws-sdk/middleware-host-header": "3.620.0", + "@aws-sdk/middleware-logger": "3.609.0", + "@aws-sdk/middleware-recursion-detection": "3.620.0", + "@aws-sdk/middleware-user-agent": "3.637.0", + "@aws-sdk/region-config-resolver": "3.614.0", + "@aws-sdk/types": "3.609.0", + "@aws-sdk/util-endpoints": "3.637.0", + "@aws-sdk/util-user-agent-browser": "3.609.0", + "@aws-sdk/util-user-agent-node": "3.614.0", + "@smithy/config-resolver": "^3.0.5", + "@smithy/core": "^2.4.0", + "@smithy/fetch-http-handler": "^3.2.4", + "@smithy/hash-node": "^3.0.3", + "@smithy/invalid-dependency": "^3.0.3", + "@smithy/middleware-content-length": "^3.0.5", + "@smithy/middleware-endpoint": "^3.1.0", + "@smithy/middleware-retry": "^3.0.15", + "@smithy/middleware-serde": "^3.0.3", + "@smithy/middleware-stack": "^3.0.3", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/node-http-handler": "^3.1.4", + "@smithy/protocol-http": "^4.1.0", + "@smithy/smithy-client": "^3.2.0", + "@smithy/types": "^3.3.0", + "@smithy/url-parser": "^3.0.3", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.15", + "@smithy/util-defaults-mode-node": "^3.0.15", + "@smithy/util-endpoints": "^2.0.5", + "@smithy/util-middleware": "^3.0.3", + "@smithy/util-retry": "^3.0.3", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sso-oidc": { "version": "3.637.0", "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.637.0", - "@aws-sdk/client-sts": "3.637.0", "@aws-sdk/core": "3.635.0", "@aws-sdk/credential-provider-node": "3.637.0", "@aws-sdk/middleware-host-header": "3.620.0", @@ -6628,9 +10652,6 @@ "@aws-sdk/util-user-agent-node": "3.614.0", "@smithy/config-resolver": "^3.0.5", "@smithy/core": "^2.4.0", - "@smithy/eventstream-serde-browser": "^3.0.6", - "@smithy/eventstream-serde-config-resolver": "^3.0.3", - "@smithy/eventstream-serde-node": "^3.0.5", "@smithy/fetch-http-handler": "^3.2.4", "@smithy/hash-node": "^3.0.3", "@smithy/invalid-dependency": "^3.0.3", @@ -6653,16 +10674,17 @@ "@smithy/util-endpoints": "^2.0.5", "@smithy/util-middleware": "^3.0.3", "@smithy/util-retry": "^3.0.3", - "@smithy/util-stream": "^3.1.3", "@smithy/util-utf8": "^3.0.0", - "@smithy/util-waiter": "^3.1.2", "tslib": "^2.6.2" }, "engines": { "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.637.0" } }, - "node_modules/@aws-sdk/client-lambda/node_modules/@aws-sdk/types": { + "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/types": { "version": "3.609.0", "license": "Apache-2.0", "dependencies": { @@ -6673,7 +10695,7 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-lambda/node_modules/@smithy/fetch-http-handler": { + "node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/fetch-http-handler": { "version": "3.2.4", "license": "Apache-2.0", "dependencies": { @@ -6684,7 +10706,7 @@ "tslib": "^2.6.2" } }, - "node_modules/@aws-sdk/client-lambda/node_modules/@smithy/is-array-buffer": { + "node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/is-array-buffer": { "version": "3.0.0", "license": "Apache-2.0", "dependencies": { @@ -6694,7 +10716,7 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-lambda/node_modules/@smithy/util-utf8": { + "node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-utf8": { "version": "3.0.0", "license": "Apache-2.0", "dependencies": { @@ -6705,951 +10727,618 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-lambda/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "license": "Apache-2.0", - "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-s3": { - "version": "3.693.0", - "license": "Apache-2.0", - "dependencies": { - "@aws-crypto/sha1-browser": "5.2.0", - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.693.0", - "@aws-sdk/client-sts": "3.693.0", - "@aws-sdk/core": "3.693.0", - "@aws-sdk/credential-provider-node": "3.693.0", - "@aws-sdk/middleware-bucket-endpoint": "3.693.0", - "@aws-sdk/middleware-expect-continue": "3.693.0", - "@aws-sdk/middleware-flexible-checksums": "3.693.0", - "@aws-sdk/middleware-host-header": "3.693.0", - "@aws-sdk/middleware-location-constraint": "3.693.0", - "@aws-sdk/middleware-logger": "3.693.0", - "@aws-sdk/middleware-recursion-detection": "3.693.0", - "@aws-sdk/middleware-sdk-s3": "3.693.0", - "@aws-sdk/middleware-ssec": "3.693.0", - "@aws-sdk/middleware-user-agent": "3.693.0", - "@aws-sdk/region-config-resolver": "3.693.0", - "@aws-sdk/signature-v4-multi-region": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@aws-sdk/util-endpoints": "3.693.0", - "@aws-sdk/util-user-agent-browser": "3.693.0", - "@aws-sdk/util-user-agent-node": "3.693.0", - "@aws-sdk/xml-builder": "3.693.0", - "@smithy/config-resolver": "^3.0.11", - "@smithy/core": "^2.5.2", - "@smithy/eventstream-serde-browser": "^3.0.12", - "@smithy/eventstream-serde-config-resolver": "^3.0.9", - "@smithy/eventstream-serde-node": "^3.0.11", - "@smithy/fetch-http-handler": "^4.1.0", - "@smithy/hash-blob-browser": "^3.1.8", - "@smithy/hash-node": "^3.0.9", - "@smithy/hash-stream-node": "^3.1.8", - "@smithy/invalid-dependency": "^3.0.9", - "@smithy/md5-js": "^3.0.9", - "@smithy/middleware-content-length": "^3.0.11", - "@smithy/middleware-endpoint": "^3.2.2", - "@smithy/middleware-retry": "^3.0.26", - "@smithy/middleware-serde": "^3.0.9", - "@smithy/middleware-stack": "^3.0.9", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/node-http-handler": "^3.3.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/url-parser": "^3.0.9", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.26", - "@smithy/util-defaults-mode-node": "^3.0.26", - "@smithy/util-endpoints": "^2.1.5", - "@smithy/util-middleware": "^3.0.9", - "@smithy/util-retry": "^3.0.9", - "@smithy/util-stream": "^3.3.0", - "@smithy/util-utf8": "^3.0.0", - "@smithy/util-waiter": "^3.1.8", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/client-sso": { - "version": "3.693.0", - "license": "Apache-2.0", - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.693.0", - "@aws-sdk/middleware-host-header": "3.693.0", - "@aws-sdk/middleware-logger": "3.693.0", - "@aws-sdk/middleware-recursion-detection": "3.693.0", - "@aws-sdk/middleware-user-agent": "3.693.0", - "@aws-sdk/region-config-resolver": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@aws-sdk/util-endpoints": "3.693.0", - "@aws-sdk/util-user-agent-browser": "3.693.0", - "@aws-sdk/util-user-agent-node": "3.693.0", - "@smithy/config-resolver": "^3.0.11", - "@smithy/core": "^2.5.2", - "@smithy/fetch-http-handler": "^4.1.0", - "@smithy/hash-node": "^3.0.9", - "@smithy/invalid-dependency": "^3.0.9", - "@smithy/middleware-content-length": "^3.0.11", - "@smithy/middleware-endpoint": "^3.2.2", - "@smithy/middleware-retry": "^3.0.26", - "@smithy/middleware-serde": "^3.0.9", - "@smithy/middleware-stack": "^3.0.9", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/node-http-handler": "^3.3.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/url-parser": "^3.0.9", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.26", - "@smithy/util-defaults-mode-node": "^3.0.26", - "@smithy/util-endpoints": "^2.1.5", - "@smithy/util-middleware": "^3.0.9", - "@smithy/util-retry": "^3.0.9", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/client-sso-oidc": { - "version": "3.693.0", - "license": "Apache-2.0", - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.693.0", - "@aws-sdk/credential-provider-node": "3.693.0", - "@aws-sdk/middleware-host-header": "3.693.0", - "@aws-sdk/middleware-logger": "3.693.0", - "@aws-sdk/middleware-recursion-detection": "3.693.0", - "@aws-sdk/middleware-user-agent": "3.693.0", - "@aws-sdk/region-config-resolver": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@aws-sdk/util-endpoints": "3.693.0", - "@aws-sdk/util-user-agent-browser": "3.693.0", - "@aws-sdk/util-user-agent-node": "3.693.0", - "@smithy/config-resolver": "^3.0.11", - "@smithy/core": "^2.5.2", - "@smithy/fetch-http-handler": "^4.1.0", - "@smithy/hash-node": "^3.0.9", - "@smithy/invalid-dependency": "^3.0.9", - "@smithy/middleware-content-length": "^3.0.11", - "@smithy/middleware-endpoint": "^3.2.2", - "@smithy/middleware-retry": "^3.0.26", - "@smithy/middleware-serde": "^3.0.9", - "@smithy/middleware-stack": "^3.0.9", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/node-http-handler": "^3.3.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/url-parser": "^3.0.9", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.26", - "@smithy/util-defaults-mode-node": "^3.0.26", - "@smithy/util-endpoints": "^2.1.5", - "@smithy/util-middleware": "^3.0.9", - "@smithy/util-retry": "^3.0.9", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.693.0" - } - }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/client-sts": { - "version": "3.693.0", - "license": "Apache-2.0", - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.693.0", - "@aws-sdk/core": "3.693.0", - "@aws-sdk/credential-provider-node": "3.693.0", - "@aws-sdk/middleware-host-header": "3.693.0", - "@aws-sdk/middleware-logger": "3.693.0", - "@aws-sdk/middleware-recursion-detection": "3.693.0", - "@aws-sdk/middleware-user-agent": "3.693.0", - "@aws-sdk/region-config-resolver": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@aws-sdk/util-endpoints": "3.693.0", - "@aws-sdk/util-user-agent-browser": "3.693.0", - "@aws-sdk/util-user-agent-node": "3.693.0", - "@smithy/config-resolver": "^3.0.11", - "@smithy/core": "^2.5.2", - "@smithy/fetch-http-handler": "^4.1.0", - "@smithy/hash-node": "^3.0.9", - "@smithy/invalid-dependency": "^3.0.9", - "@smithy/middleware-content-length": "^3.0.11", - "@smithy/middleware-endpoint": "^3.2.2", - "@smithy/middleware-retry": "^3.0.26", - "@smithy/middleware-serde": "^3.0.9", - "@smithy/middleware-stack": "^3.0.9", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/node-http-handler": "^3.3.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/url-parser": "^3.0.9", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.26", - "@smithy/util-defaults-mode-node": "^3.0.26", - "@smithy/util-endpoints": "^2.1.5", - "@smithy/util-middleware": "^3.0.9", - "@smithy/util-retry": "^3.0.9", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/core": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/core": "^2.5.2", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/property-provider": "^3.1.9", - "@smithy/protocol-http": "^4.1.6", - "@smithy/signature-v4": "^4.2.2", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/util-middleware": "^3.0.9", - "fast-xml-parser": "4.4.1", + "@smithy/is-array-buffer": "^3.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-http": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/types": { + "version": "3.609.0", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/fetch-http-handler": "^4.1.0", - "@smithy/node-http-handler": "^3.3.0", - "@smithy/property-provider": "^3.1.9", - "@smithy/protocol-http": "^4.1.6", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/util-stream": "^3.3.0", + "@smithy/types": "^3.3.0", "tslib": "^2.6.2" }, "engines": { "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-sso/node_modules/@smithy/fetch-http-handler": { + "version": "3.2.4", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.693.0", - "@aws-sdk/credential-provider-env": "3.693.0", - "@aws-sdk/credential-provider-http": "3.693.0", - "@aws-sdk/credential-provider-process": "3.693.0", - "@aws-sdk/credential-provider-sso": "3.693.0", - "@aws-sdk/credential-provider-web-identity": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/credential-provider-imds": "^3.2.6", - "@smithy/property-provider": "^3.1.9", - "@smithy/shared-ini-file-loader": "^3.1.10", - "@smithy/types": "^3.7.0", + "@smithy/protocol-http": "^4.1.0", + "@smithy/querystring-builder": "^3.0.3", + "@smithy/types": "^3.3.0", + "@smithy/util-base64": "^3.0.0", "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.693.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-node": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-sso/node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/credential-provider-env": "3.693.0", - "@aws-sdk/credential-provider-http": "3.693.0", - "@aws-sdk/credential-provider-ini": "3.693.0", - "@aws-sdk/credential-provider-process": "3.693.0", - "@aws-sdk/credential-provider-sso": "3.693.0", - "@aws-sdk/credential-provider-web-identity": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/credential-provider-imds": "^3.2.6", - "@smithy/property-provider": "^3.1.9", - "@smithy/shared-ini-file-loader": "^3.1.10", - "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-utf8": { + "version": "3.0.0", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/client-sso": "3.693.0", - "@aws-sdk/core": "3.693.0", - "@aws-sdk/token-providers": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/property-provider": "^3.1.9", - "@smithy/shared-ini-file-loader": "^3.1.10", - "@smithy/types": "^3.7.0", + "@smithy/util-buffer-from": "^3.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/property-provider": "^3.1.9", - "@smithy/types": "^3.7.0", + "@smithy/is-array-buffer": "^3.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.693.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-host-header": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-sts": { + "version": "3.637.0", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/types": "^3.7.0", + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.637.0", + "@aws-sdk/core": "3.635.0", + "@aws-sdk/credential-provider-node": "3.637.0", + "@aws-sdk/middleware-host-header": "3.620.0", + "@aws-sdk/middleware-logger": "3.609.0", + "@aws-sdk/middleware-recursion-detection": "3.620.0", + "@aws-sdk/middleware-user-agent": "3.637.0", + "@aws-sdk/region-config-resolver": "3.614.0", + "@aws-sdk/types": "3.609.0", + "@aws-sdk/util-endpoints": "3.637.0", + "@aws-sdk/util-user-agent-browser": "3.609.0", + "@aws-sdk/util-user-agent-node": "3.614.0", + "@smithy/config-resolver": "^3.0.5", + "@smithy/core": "^2.4.0", + "@smithy/fetch-http-handler": "^3.2.4", + "@smithy/hash-node": "^3.0.3", + "@smithy/invalid-dependency": "^3.0.3", + "@smithy/middleware-content-length": "^3.0.5", + "@smithy/middleware-endpoint": "^3.1.0", + "@smithy/middleware-retry": "^3.0.15", + "@smithy/middleware-serde": "^3.0.3", + "@smithy/middleware-stack": "^3.0.3", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/node-http-handler": "^3.1.4", + "@smithy/protocol-http": "^4.1.0", + "@smithy/smithy-client": "^3.2.0", + "@smithy/types": "^3.3.0", + "@smithy/url-parser": "^3.0.3", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.15", + "@smithy/util-defaults-mode-node": "^3.0.15", + "@smithy/util-endpoints": "^2.0.5", + "@smithy/util-middleware": "^3.0.3", + "@smithy/util-retry": "^3.0.3", + "@smithy/util-utf8": "^3.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-logger": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/types": { + "version": "3.609.0", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/types": "^3.7.0", + "@smithy/types": "^3.3.0", "tslib": "^2.6.2" }, "engines": { "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-sts/node_modules/@smithy/fetch-http-handler": { + "version": "3.2.4", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/types": "^3.7.0", + "@smithy/protocol-http": "^4.1.0", + "@smithy/querystring-builder": "^3.0.3", + "@smithy/types": "^3.3.0", + "@smithy/util-base64": "^3.0.0", "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-sts/node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@aws-sdk/util-endpoints": "3.693.0", - "@smithy/core": "^2.5.2", - "@smithy/protocol-http": "^4.1.6", - "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/region-config-resolver": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-sts/node_modules/@smithy/util-utf8": { + "version": "3.0.0", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/types": "^3.7.0", - "@smithy/util-config-provider": "^3.0.0", - "@smithy/util-middleware": "^3.0.9", + "@smithy/util-buffer-from": "^3.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/token-providers": { - "version": "3.693.0", + "node_modules/@aws-sdk/client-sts/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/property-provider": "^3.1.9", - "@smithy/shared-ini-file-loader": "^3.1.10", - "@smithy/types": "^3.7.0", + "@smithy/is-array-buffer": "^3.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sso-oidc": "^3.693.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/util-endpoints": { - "version": "3.693.0", + "node_modules/@aws-sdk/core": { + "version": "3.635.0", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/types": "^3.7.0", - "@smithy/util-endpoints": "^2.1.5", + "@smithy/core": "^2.4.0", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/property-provider": "^3.1.3", + "@smithy/protocol-http": "^4.1.0", + "@smithy/signature-v4": "^4.1.0", + "@smithy/smithy-client": "^3.2.0", + "@smithy/types": "^3.3.0", + "@smithy/util-middleware": "^3.0.3", + "fast-xml-parser": "4.4.1", "tslib": "^2.6.2" }, "engines": { "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.693.0", - "license": "Apache-2.0", + "node_modules/@aws-sdk/credential-provider-cognito-identity": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.730.0.tgz", + "integrity": "sha512-Ynp67VkpaaFubqPrqGxLbg5XuS+QTjR7JVhZvjNO6Su4tQVKBFSfQpDIXTyggD9UVixXy4NB9cqg30uvebDeiw==", "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/types": "^3.7.0", - "bowser": "^2.11.0", + "@aws-sdk/client-cognito-identity": "3.730.0", + "@aws-sdk/types": "3.723.0", + "@smithy/property-provider": "^4.0.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.693.0", - "license": "Apache-2.0", + "node_modules/@aws-sdk/credential-provider-cognito-identity/node_modules/@aws-sdk/types": { + "version": "3.723.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.723.0.tgz", + "integrity": "sha512-LmK3kwiMZG1y5g3LGihT9mNkeNOmwEyPk6HGcJqh0wOSV4QpWoKu2epyKE4MLQNUUlz2kOVbVbOrwmI6ZcteuA==", "dependencies": { - "@aws-sdk/middleware-user-agent": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/types": "^3.7.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "aws-crt": ">=1.0.0" - }, - "peerDependenciesMeta": { - "aws-crt": { - "optional": true - } + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "license": "Apache-2.0", + "node_modules/@aws-sdk/credential-provider-cognito-identity/node_modules/@smithy/property-provider": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.0.4.tgz", + "integrity": "sha512-qHJ2sSgu4FqF4U/5UUp4DhXNmdTrgmoAai6oQiM+c5RZ/sbDwJ12qxB1M6FnP+Tn/ggkPZf9ccn4jqKSINaquw==", "dependencies": { + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "license": "Apache-2.0", + "node_modules/@aws-sdk/credential-provider-cognito-identity/node_modules/@smithy/types": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.3.1.tgz", + "integrity": "sha512-UqKOQBL2x6+HWl3P+3QqFD4ncKq0I8Nuz9QItGv5WuKuMHuuwlhvqcZCoXGfc+P1QmfJE7VieykoYYmrOoFJxA==", "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-utf8": { - "version": "3.0.0", + "node_modules/@aws-sdk/credential-provider-env": { + "version": "3.693.0", "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-ssm": { + "node_modules/@aws-sdk/credential-provider-env/node_modules/@aws-sdk/core": { "version": "3.693.0", "license": "Apache-2.0", "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.693.0", - "@aws-sdk/client-sts": "3.693.0", - "@aws-sdk/core": "3.693.0", - "@aws-sdk/credential-provider-node": "3.693.0", - "@aws-sdk/middleware-host-header": "3.693.0", - "@aws-sdk/middleware-logger": "3.693.0", - "@aws-sdk/middleware-recursion-detection": "3.693.0", - "@aws-sdk/middleware-user-agent": "3.693.0", - "@aws-sdk/region-config-resolver": "3.693.0", "@aws-sdk/types": "3.692.0", - "@aws-sdk/util-endpoints": "3.693.0", - "@aws-sdk/util-user-agent-browser": "3.693.0", - "@aws-sdk/util-user-agent-node": "3.693.0", - "@smithy/config-resolver": "^3.0.11", "@smithy/core": "^2.5.2", - "@smithy/fetch-http-handler": "^4.1.0", - "@smithy/hash-node": "^3.0.9", - "@smithy/invalid-dependency": "^3.0.9", - "@smithy/middleware-content-length": "^3.0.11", - "@smithy/middleware-endpoint": "^3.2.2", - "@smithy/middleware-retry": "^3.0.26", - "@smithy/middleware-serde": "^3.0.9", - "@smithy/middleware-stack": "^3.0.9", "@smithy/node-config-provider": "^3.1.10", - "@smithy/node-http-handler": "^3.3.0", + "@smithy/property-provider": "^3.1.9", "@smithy/protocol-http": "^4.1.6", + "@smithy/signature-v4": "^4.2.2", "@smithy/smithy-client": "^3.4.3", "@smithy/types": "^3.7.0", - "@smithy/url-parser": "^3.0.9", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.26", - "@smithy/util-defaults-mode-node": "^3.0.26", - "@smithy/util-endpoints": "^2.1.5", "@smithy/util-middleware": "^3.0.9", - "@smithy/util-retry": "^3.0.9", - "@smithy/util-utf8": "^3.0.0", - "@smithy/util-waiter": "^3.1.8", - "@types/uuid": "^9.0.1", - "tslib": "^2.6.2", - "uuid": "^9.0.1" + "fast-xml-parser": "4.4.1", + "tslib": "^2.6.2" }, "engines": { "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/client-sso": { - "version": "3.693.0", + "node_modules/@aws-sdk/credential-provider-http": { + "version": "3.635.0", "license": "Apache-2.0", "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.693.0", - "@aws-sdk/middleware-host-header": "3.693.0", - "@aws-sdk/middleware-logger": "3.693.0", - "@aws-sdk/middleware-recursion-detection": "3.693.0", - "@aws-sdk/middleware-user-agent": "3.693.0", - "@aws-sdk/region-config-resolver": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@aws-sdk/util-endpoints": "3.693.0", - "@aws-sdk/util-user-agent-browser": "3.693.0", - "@aws-sdk/util-user-agent-node": "3.693.0", - "@smithy/config-resolver": "^3.0.11", - "@smithy/core": "^2.5.2", - "@smithy/fetch-http-handler": "^4.1.0", - "@smithy/hash-node": "^3.0.9", - "@smithy/invalid-dependency": "^3.0.9", - "@smithy/middleware-content-length": "^3.0.11", - "@smithy/middleware-endpoint": "^3.2.2", - "@smithy/middleware-retry": "^3.0.26", - "@smithy/middleware-serde": "^3.0.9", - "@smithy/middleware-stack": "^3.0.9", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/node-http-handler": "^3.3.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/url-parser": "^3.0.9", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.26", - "@smithy/util-defaults-mode-node": "^3.0.26", - "@smithy/util-endpoints": "^2.1.5", - "@smithy/util-middleware": "^3.0.9", - "@smithy/util-retry": "^3.0.9", - "@smithy/util-utf8": "^3.0.0", + "@aws-sdk/types": "3.609.0", + "@smithy/fetch-http-handler": "^3.2.4", + "@smithy/node-http-handler": "^3.1.4", + "@smithy/property-provider": "^3.1.3", + "@smithy/protocol-http": "^4.1.0", + "@smithy/smithy-client": "^3.2.0", + "@smithy/types": "^3.3.0", + "@smithy/util-stream": "^3.1.3", "tslib": "^2.6.2" }, "engines": { "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/client-sso-oidc": { - "version": "3.693.0", + "node_modules/@aws-sdk/credential-provider-http/node_modules/@aws-sdk/types": { + "version": "3.609.0", "license": "Apache-2.0", "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.693.0", - "@aws-sdk/credential-provider-node": "3.693.0", - "@aws-sdk/middleware-host-header": "3.693.0", - "@aws-sdk/middleware-logger": "3.693.0", - "@aws-sdk/middleware-recursion-detection": "3.693.0", - "@aws-sdk/middleware-user-agent": "3.693.0", - "@aws-sdk/region-config-resolver": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@aws-sdk/util-endpoints": "3.693.0", - "@aws-sdk/util-user-agent-browser": "3.693.0", - "@aws-sdk/util-user-agent-node": "3.693.0", - "@smithy/config-resolver": "^3.0.11", - "@smithy/core": "^2.5.2", - "@smithy/fetch-http-handler": "^4.1.0", - "@smithy/hash-node": "^3.0.9", - "@smithy/invalid-dependency": "^3.0.9", - "@smithy/middleware-content-length": "^3.0.11", - "@smithy/middleware-endpoint": "^3.2.2", - "@smithy/middleware-retry": "^3.0.26", - "@smithy/middleware-serde": "^3.0.9", - "@smithy/middleware-stack": "^3.0.9", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/node-http-handler": "^3.3.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/url-parser": "^3.0.9", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.26", - "@smithy/util-defaults-mode-node": "^3.0.26", - "@smithy/util-endpoints": "^2.1.5", - "@smithy/util-middleware": "^3.0.9", - "@smithy/util-retry": "^3.0.9", - "@smithy/util-utf8": "^3.0.0", + "@smithy/types": "^3.3.0", "tslib": "^2.6.2" }, "engines": { "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/fetch-http-handler": { + "version": "3.2.4", + "license": "Apache-2.0", + "dependencies": { + "@smithy/protocol-http": "^4.1.0", + "@smithy/querystring-builder": "^3.0.3", + "@smithy/types": "^3.3.0", + "@smithy/util-base64": "^3.0.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.758.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/core": "3.758.0", + "@aws-sdk/credential-provider-env": "3.758.0", + "@aws-sdk/credential-provider-http": "3.758.0", + "@aws-sdk/credential-provider-process": "3.758.0", + "@aws-sdk/credential-provider-sso": "3.758.0", + "@aws-sdk/credential-provider-web-identity": "3.758.0", + "@aws-sdk/nested-clients": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/credential-provider-imds": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.693.0" + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/client-sts": { - "version": "3.693.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/client-sso": { + "version": "3.758.0", "license": "Apache-2.0", + "peer": true, "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.693.0", - "@aws-sdk/core": "3.693.0", - "@aws-sdk/credential-provider-node": "3.693.0", - "@aws-sdk/middleware-host-header": "3.693.0", - "@aws-sdk/middleware-logger": "3.693.0", - "@aws-sdk/middleware-recursion-detection": "3.693.0", - "@aws-sdk/middleware-user-agent": "3.693.0", - "@aws-sdk/region-config-resolver": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@aws-sdk/util-endpoints": "3.693.0", - "@aws-sdk/util-user-agent-browser": "3.693.0", - "@aws-sdk/util-user-agent-node": "3.693.0", - "@smithy/config-resolver": "^3.0.11", - "@smithy/core": "^2.5.2", - "@smithy/fetch-http-handler": "^4.1.0", - "@smithy/hash-node": "^3.0.9", - "@smithy/invalid-dependency": "^3.0.9", - "@smithy/middleware-content-length": "^3.0.11", - "@smithy/middleware-endpoint": "^3.2.2", - "@smithy/middleware-retry": "^3.0.26", - "@smithy/middleware-serde": "^3.0.9", - "@smithy/middleware-stack": "^3.0.9", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/node-http-handler": "^3.3.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/url-parser": "^3.0.9", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.26", - "@smithy/util-defaults-mode-node": "^3.0.26", - "@smithy/util-endpoints": "^2.1.5", - "@smithy/util-middleware": "^3.0.9", - "@smithy/util-retry": "^3.0.9", - "@smithy/util-utf8": "^3.0.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/middleware-host-header": "3.734.0", + "@aws-sdk/middleware-logger": "3.734.0", + "@aws-sdk/middleware-recursion-detection": "3.734.0", + "@aws-sdk/middleware-user-agent": "3.758.0", + "@aws-sdk/region-config-resolver": "3.734.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-endpoints": "3.743.0", + "@aws-sdk/util-user-agent-browser": "3.734.0", + "@aws-sdk/util-user-agent-node": "3.758.0", + "@smithy/config-resolver": "^4.0.1", + "@smithy/core": "^3.1.5", + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/hash-node": "^4.0.1", + "@smithy/invalid-dependency": "^4.0.1", + "@smithy/middleware-content-length": "^4.0.1", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-retry": "^4.0.7", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/node-http-handler": "^4.0.3", + "@smithy/protocol-http": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.7", + "@smithy/util-defaults-mode-node": "^4.0.7", + "@smithy/util-endpoints": "^3.0.1", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-retry": "^4.0.1", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } - }, - "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/core": { - "version": "3.693.0", + }, + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/core": { + "version": "3.758.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/core": "^2.5.2", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/property-provider": "^3.1.9", - "@smithy/protocol-http": "^4.1.6", - "@smithy/signature-v4": "^4.2.2", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/util-middleware": "^3.0.9", + "@aws-sdk/types": "3.734.0", + "@smithy/core": "^3.1.5", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/signature-v4": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/util-middleware": "^4.0.1", "fast-xml-parser": "4.4.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/credential-provider-http": { - "version": "3.693.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/credential-provider-env": { + "version": "3.758.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/core": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/fetch-http-handler": "^4.1.0", - "@smithy/node-http-handler": "^3.3.0", - "@smithy/property-provider": "^3.1.9", - "@smithy/protocol-http": "^4.1.6", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/util-stream": "^3.3.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.693.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/credential-provider-http": { + "version": "3.758.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/core": "3.693.0", - "@aws-sdk/credential-provider-env": "3.693.0", - "@aws-sdk/credential-provider-http": "3.693.0", - "@aws-sdk/credential-provider-process": "3.693.0", - "@aws-sdk/credential-provider-sso": "3.693.0", - "@aws-sdk/credential-provider-web-identity": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/credential-provider-imds": "^3.2.6", - "@smithy/property-provider": "^3.1.9", - "@smithy/shared-ini-file-loader": "^3.1.10", - "@smithy/types": "^3.7.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/node-http-handler": "^4.0.3", + "@smithy/property-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/util-stream": "^4.1.2", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.693.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/credential-provider-node": { - "version": "3.693.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/credential-provider-process": { + "version": "3.758.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/credential-provider-env": "3.693.0", - "@aws-sdk/credential-provider-http": "3.693.0", - "@aws-sdk/credential-provider-ini": "3.693.0", - "@aws-sdk/credential-provider-process": "3.693.0", - "@aws-sdk/credential-provider-sso": "3.693.0", - "@aws-sdk/credential-provider-web-identity": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/credential-provider-imds": "^3.2.6", - "@smithy/property-provider": "^3.1.9", - "@smithy/shared-ini-file-loader": "^3.1.10", - "@smithy/types": "^3.7.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.693.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.758.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/client-sso": "3.693.0", - "@aws-sdk/core": "3.693.0", - "@aws-sdk/token-providers": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/property-provider": "^3.1.9", - "@smithy/shared-ini-file-loader": "^3.1.10", - "@smithy/types": "^3.7.0", + "@aws-sdk/client-sso": "3.758.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/token-providers": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.693.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/middleware-host-header": { + "version": "3.734.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/core": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/property-provider": "^3.1.9", - "@smithy/types": "^3.7.0", + "@aws-sdk/types": "3.734.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.693.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/middleware-host-header": { - "version": "3.693.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/middleware-logger": { + "version": "3.734.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/types": "^3.7.0", + "@aws-sdk/types": "3.734.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/middleware-logger": { - "version": "3.693.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.734.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/types": "^3.7.0", + "@aws-sdk/types": "3.734.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.693.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.758.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/protocol-http": "^4.1.6", - "@smithy/types": "^3.7.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-endpoints": "3.743.0", + "@smithy/core": "^3.1.5", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.693.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/region-config-resolver": { + "version": "3.734.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/core": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@aws-sdk/util-endpoints": "3.693.0", - "@smithy/core": "^2.5.2", - "@smithy/protocol-http": "^4.1.6", - "@smithy/types": "^3.7.0", + "@aws-sdk/types": "3.734.0", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-config-provider": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/region-config-resolver": { - "version": "3.693.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/token-providers": { + "version": "3.758.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/types": "^3.7.0", - "@smithy/util-config-provider": "^3.0.0", - "@smithy/util-middleware": "^3.0.9", + "@aws-sdk/nested-clients": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/token-providers": { - "version": "3.693.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/types": { + "version": "3.734.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/property-provider": "^3.1.9", - "@smithy/shared-ini-file-loader": "^3.1.10", - "@smithy/types": "^3.7.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sso-oidc": "^3.693.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/util-endpoints": { - "version": "3.693.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/util-endpoints": { + "version": "3.743.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/types": "^3.7.0", - "@smithy/util-endpoints": "^2.1.5", + "@aws-sdk/types": "3.734.0", + "@smithy/types": "^4.1.0", + "@smithy/util-endpoints": "^3.0.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.693.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.734.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/types": "^3.7.0", + "@aws-sdk/types": "3.734.0", + "@smithy/types": "^4.1.0", "bowser": "^2.11.0", "tslib": "^2.6.2" } }, - "node_modules/@aws-sdk/client-ssm/node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.693.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.758.0", "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/middleware-user-agent": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/types": "^3.7.0", + "peer": true, + "dependencies": { + "@aws-sdk/middleware-user-agent": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "peerDependencies": { "aws-crt": ">=1.0.0" @@ -7660,576 +11349,448 @@ } } }, - "node_modules/@aws-sdk/client-ssm/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/abort-controller": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-ssm/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/config-resolver": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-config-provider": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-ssm/node_modules/@smithy/util-utf8": { - "version": "3.0.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/core": { + "version": "3.1.5", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-stream": "^4.1.2", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-sso": { - "version": "3.637.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/credential-provider-imds": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.635.0", - "@aws-sdk/middleware-host-header": "3.620.0", - "@aws-sdk/middleware-logger": "3.609.0", - "@aws-sdk/middleware-recursion-detection": "3.620.0", - "@aws-sdk/middleware-user-agent": "3.637.0", - "@aws-sdk/region-config-resolver": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@aws-sdk/util-user-agent-browser": "3.609.0", - "@aws-sdk/util-user-agent-node": "3.614.0", - "@smithy/config-resolver": "^3.0.5", - "@smithy/core": "^2.4.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/hash-node": "^3.0.3", - "@smithy/invalid-dependency": "^3.0.3", - "@smithy/middleware-content-length": "^3.0.5", - "@smithy/middleware-endpoint": "^3.1.0", - "@smithy/middleware-retry": "^3.0.15", - "@smithy/middleware-serde": "^3.0.3", - "@smithy/middleware-stack": "^3.0.3", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/url-parser": "^3.0.3", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.15", - "@smithy/util-defaults-mode-node": "^3.0.15", - "@smithy/util-endpoints": "^2.0.5", - "@smithy/util-middleware": "^3.0.3", - "@smithy/util-retry": "^3.0.3", - "@smithy/util-utf8": "^3.0.0", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-sso-oidc": { - "version": "3.637.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/fetch-http-handler": { + "version": "5.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.635.0", - "@aws-sdk/credential-provider-node": "3.637.0", - "@aws-sdk/middleware-host-header": "3.620.0", - "@aws-sdk/middleware-logger": "3.609.0", - "@aws-sdk/middleware-recursion-detection": "3.620.0", - "@aws-sdk/middleware-user-agent": "3.637.0", - "@aws-sdk/region-config-resolver": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@aws-sdk/util-user-agent-browser": "3.609.0", - "@aws-sdk/util-user-agent-node": "3.614.0", - "@smithy/config-resolver": "^3.0.5", - "@smithy/core": "^2.4.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/hash-node": "^3.0.3", - "@smithy/invalid-dependency": "^3.0.3", - "@smithy/middleware-content-length": "^3.0.5", - "@smithy/middleware-endpoint": "^3.1.0", - "@smithy/middleware-retry": "^3.0.15", - "@smithy/middleware-serde": "^3.0.3", - "@smithy/middleware-stack": "^3.0.3", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/url-parser": "^3.0.3", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.15", - "@smithy/util-defaults-mode-node": "^3.0.15", - "@smithy/util-endpoints": "^2.0.5", - "@smithy/util-middleware": "^3.0.3", - "@smithy/util-retry": "^3.0.3", - "@smithy/util-utf8": "^3.0.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/querystring-builder": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-base64": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.637.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/types": { - "version": "3.609.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/hash-node": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/types": "^3.3.0", + "@smithy/types": "^4.1.0", + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/fetch-http-handler": { - "version": "3.2.4", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/invalid-dependency": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/protocol-http": "^4.1.0", - "@smithy/querystring-builder": "^3.0.3", - "@smithy/types": "^3.3.0", - "@smithy/util-base64": "^3.0.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/is-array-buffer": { + "version": "4.0.0", "license": "Apache-2.0", + "peer": true, "dependencies": { "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-utf8": { - "version": "3.0.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/middleware-content-length": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/middleware-endpoint": { + "version": "4.0.6", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", + "@smithy/core": "^3.1.5", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-middleware": "^4.0.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/types": { - "version": "3.609.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/middleware-retry": { + "version": "4.0.7", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" + "@smithy/node-config-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/service-error-classification": "^4.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-retry": "^4.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-sso/node_modules/@smithy/fetch-http-handler": { - "version": "3.2.4", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/middleware-serde": { + "version": "4.0.2", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/protocol-http": "^4.1.0", - "@smithy/querystring-builder": "^3.0.3", - "@smithy/types": "^3.3.0", - "@smithy/util-base64": "^3.0.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-sso/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/middleware-stack": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-utf8": { - "version": "3.0.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/node-config-provider": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/node-http-handler": { + "version": "4.0.3", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", + "@smithy/abort-controller": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/querystring-builder": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-sts": { - "version": "3.637.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/property-provider": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.637.0", - "@aws-sdk/core": "3.635.0", - "@aws-sdk/credential-provider-node": "3.637.0", - "@aws-sdk/middleware-host-header": "3.620.0", - "@aws-sdk/middleware-logger": "3.609.0", - "@aws-sdk/middleware-recursion-detection": "3.620.0", - "@aws-sdk/middleware-user-agent": "3.637.0", - "@aws-sdk/region-config-resolver": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@aws-sdk/util-user-agent-browser": "3.609.0", - "@aws-sdk/util-user-agent-node": "3.614.0", - "@smithy/config-resolver": "^3.0.5", - "@smithy/core": "^2.4.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/hash-node": "^3.0.3", - "@smithy/invalid-dependency": "^3.0.3", - "@smithy/middleware-content-length": "^3.0.5", - "@smithy/middleware-endpoint": "^3.1.0", - "@smithy/middleware-retry": "^3.0.15", - "@smithy/middleware-serde": "^3.0.3", - "@smithy/middleware-stack": "^3.0.3", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/url-parser": "^3.0.3", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.15", - "@smithy/util-defaults-mode-node": "^3.0.15", - "@smithy/util-endpoints": "^2.0.5", - "@smithy/util-middleware": "^3.0.3", - "@smithy/util-retry": "^3.0.3", - "@smithy/util-utf8": "^3.0.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/types": { - "version": "3.609.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/protocol-http": { + "version": "5.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/types": "^3.3.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-sts/node_modules/@smithy/fetch-http-handler": { - "version": "3.2.4", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/querystring-builder": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/protocol-http": "^4.1.0", - "@smithy/querystring-builder": "^3.0.3", - "@smithy/types": "^3.3.0", - "@smithy/util-base64": "^3.0.0", + "@smithy/types": "^4.1.0", + "@smithy/util-uri-escape": "^4.0.0", "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-sts/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/querystring-parser": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-sts/node_modules/@smithy/util-utf8": { - "version": "3.0.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/service-error-classification": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", - "tslib": "^2.6.2" + "@smithy/types": "^4.1.0" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-sts/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/shared-ini-file-loader": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/core": { - "version": "3.635.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/signature-v4": { + "version": "5.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/core": "^2.4.0", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/property-provider": "^3.1.3", - "@smithy/protocol-http": "^4.1.0", - "@smithy/signature-v4": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/util-middleware": "^3.0.3", - "fast-xml-parser": "4.4.1", + "@smithy/is-array-buffer": "^4.0.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-hex-encoding": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-uri-escape": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-env": { - "version": "3.693.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/smithy-client": { + "version": "4.1.6", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/core": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/property-provider": "^3.1.9", - "@smithy/types": "^3.7.0", + "@smithy/core": "^3.1.5", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-stream": "^4.1.2", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-env/node_modules/@aws-sdk/core": { - "version": "3.693.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/types": { + "version": "4.1.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/core": "^2.5.2", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/property-provider": "^3.1.9", - "@smithy/protocol-http": "^4.1.6", - "@smithy/signature-v4": "^4.2.2", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/util-middleware": "^3.0.9", - "fast-xml-parser": "4.4.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-http": { - "version": "3.635.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/url-parser": { + "version": "4.0.1", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/property-provider": "^3.1.3", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/util-stream": "^3.1.3", + "@smithy/querystring-parser": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-http/node_modules/@aws-sdk/types": { - "version": "3.609.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-base64": { + "version": "4.0.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/types": "^3.3.0", + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/fetch-http-handler": { - "version": "3.2.4", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-body-length-browser": { + "version": "4.0.0", "license": "Apache-2.0", + "peer": true, "dependencies": { - "@smithy/protocol-http": "^4.1.0", - "@smithy/querystring-builder": "^3.0.3", - "@smithy/types": "^3.3.0", - "@smithy/util-base64": "^3.0.0", "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.758.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-body-length-node": { + "version": "4.0.0", "license": "Apache-2.0", "peer": true, "dependencies": { - "@aws-sdk/core": "3.758.0", - "@aws-sdk/credential-provider-env": "3.758.0", - "@aws-sdk/credential-provider-http": "3.758.0", - "@aws-sdk/credential-provider-process": "3.758.0", - "@aws-sdk/credential-provider-sso": "3.758.0", - "@aws-sdk/credential-provider-web-identity": "3.758.0", - "@aws-sdk/nested-clients": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@smithy/credential-provider-imds": "^4.0.1", - "@smithy/property-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/client-sso": { - "version": "3.758.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-buffer-from": { + "version": "4.0.0", "license": "Apache-2.0", "peer": true, "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.758.0", - "@aws-sdk/middleware-host-header": "3.734.0", - "@aws-sdk/middleware-logger": "3.734.0", - "@aws-sdk/middleware-recursion-detection": "3.734.0", - "@aws-sdk/middleware-user-agent": "3.758.0", - "@aws-sdk/region-config-resolver": "3.734.0", - "@aws-sdk/types": "3.734.0", - "@aws-sdk/util-endpoints": "3.743.0", - "@aws-sdk/util-user-agent-browser": "3.734.0", - "@aws-sdk/util-user-agent-node": "3.758.0", - "@smithy/config-resolver": "^4.0.1", - "@smithy/core": "^3.1.5", - "@smithy/fetch-http-handler": "^5.0.1", - "@smithy/hash-node": "^4.0.1", - "@smithy/invalid-dependency": "^4.0.1", - "@smithy/middleware-content-length": "^4.0.1", - "@smithy/middleware-endpoint": "^4.0.6", - "@smithy/middleware-retry": "^4.0.7", - "@smithy/middleware-serde": "^4.0.2", - "@smithy/middleware-stack": "^4.0.1", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/node-http-handler": "^4.0.3", - "@smithy/protocol-http": "^5.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", - "@smithy/url-parser": "^4.0.1", - "@smithy/util-base64": "^4.0.0", - "@smithy/util-body-length-browser": "^4.0.0", - "@smithy/util-body-length-node": "^4.0.0", - "@smithy/util-defaults-mode-browser": "^4.0.7", - "@smithy/util-defaults-mode-node": "^4.0.7", - "@smithy/util-endpoints": "^3.0.1", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-retry": "^4.0.1", - "@smithy/util-utf8": "^4.0.0", + "@smithy/is-array-buffer": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/core": { - "version": "3.758.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-config-provider": { + "version": "4.0.0", "license": "Apache-2.0", "peer": true, "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/core": "^3.1.5", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/property-provider": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/signature-v4": "^5.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", - "@smithy/util-middleware": "^4.0.1", - "fast-xml-parser": "4.4.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/credential-provider-env": { - "version": "3.758.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-defaults-mode-browser": { + "version": "4.0.7", "license": "Apache-2.0", "peer": true, "dependencies": { - "@aws-sdk/core": "3.758.0", - "@aws-sdk/types": "3.734.0", "@smithy/property-provider": "^4.0.1", + "@smithy/smithy-client": "^4.1.6", "@smithy/types": "^4.1.0", + "bowser": "^2.11.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/credential-provider-http": { - "version": "3.758.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-defaults-mode-node": { + "version": "4.0.7", "license": "Apache-2.0", "peer": true, "dependencies": { - "@aws-sdk/core": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@smithy/fetch-http-handler": "^5.0.1", - "@smithy/node-http-handler": "^4.0.3", + "@smithy/config-resolver": "^4.0.1", + "@smithy/credential-provider-imds": "^4.0.1", + "@smithy/node-config-provider": "^4.0.1", "@smithy/property-provider": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", "@smithy/smithy-client": "^4.1.6", "@smithy/types": "^4.1.0", - "@smithy/util-stream": "^4.1.2", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/credential-provider-process": { - "version": "3.758.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-endpoints": { + "version": "3.0.1", "license": "Apache-2.0", "peer": true, "dependencies": { - "@aws-sdk/core": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@smithy/property-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/node-config-provider": "^4.0.1", "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, @@ -8237,31 +11798,22 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.758.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-hex-encoding": { + "version": "4.0.0", "license": "Apache-2.0", "peer": true, "dependencies": { - "@aws-sdk/client-sso": "3.758.0", - "@aws-sdk/core": "3.758.0", - "@aws-sdk/token-providers": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@smithy/property-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/middleware-host-header": { - "version": "3.734.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-middleware": { + "version": "4.0.1", "license": "Apache-2.0", "peer": true, "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/protocol-http": "^5.0.1", "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, @@ -8269,12 +11821,12 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/middleware-logger": { - "version": "3.734.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-retry": { + "version": "4.0.1", "license": "Apache-2.0", "peer": true, "dependencies": { - "@aws-sdk/types": "3.734.0", + "@smithy/service-error-classification": "^4.0.1", "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, @@ -8282,255 +11834,313 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.734.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-stream": { + "version": "4.1.2", "license": "Apache-2.0", "peer": true, "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/protocol-http": "^5.0.1", + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/node-http-handler": "^4.0.3", "@smithy/types": "^4.1.0", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-hex-encoding": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.758.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-uri-escape": { + "version": "4.0.0", "license": "Apache-2.0", "peer": true, "dependencies": { - "@aws-sdk/core": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@aws-sdk/util-endpoints": "3.743.0", - "@smithy/core": "^3.1.5", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/region-config-resolver": { - "version": "3.734.0", + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-utf8": { + "version": "4.0.0", "license": "Apache-2.0", "peer": true, "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-config-provider": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", + "@smithy/util-buffer-from": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/token-providers": { - "version": "3.758.0", + "node_modules/@aws-sdk/credential-provider-node": { + "version": "3.637.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@aws-sdk/nested-clients": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@smithy/property-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", + "@aws-sdk/credential-provider-env": "3.620.1", + "@aws-sdk/credential-provider-http": "3.635.0", + "@aws-sdk/credential-provider-ini": "3.637.0", + "@aws-sdk/credential-provider-process": "3.620.1", + "@aws-sdk/credential-provider-sso": "3.637.0", + "@aws-sdk/credential-provider-web-identity": "3.621.0", + "@aws-sdk/types": "3.609.0", + "@smithy/credential-provider-imds": "^3.2.0", + "@smithy/property-provider": "^3.1.3", + "@smithy/shared-ini-file-loader": "^3.1.4", + "@smithy/types": "^3.3.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/types": { - "version": "3.734.0", + "node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/credential-provider-env": { + "version": "3.620.1", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", + "@aws-sdk/types": "3.609.0", + "@smithy/property-provider": "^3.1.3", + "@smithy/types": "^3.3.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/util-endpoints": { - "version": "3.743.0", + "node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.637.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/types": "^4.1.0", - "@smithy/util-endpoints": "^3.0.1", + "@aws-sdk/credential-provider-env": "3.620.1", + "@aws-sdk/credential-provider-http": "3.635.0", + "@aws-sdk/credential-provider-process": "3.620.1", + "@aws-sdk/credential-provider-sso": "3.637.0", + "@aws-sdk/credential-provider-web-identity": "3.621.0", + "@aws-sdk/types": "3.609.0", + "@smithy/credential-provider-imds": "^3.2.0", + "@smithy/property-provider": "^3.1.3", + "@smithy/shared-ini-file-loader": "^3.1.4", + "@smithy/types": "^3.3.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.637.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.734.0", + "node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/credential-provider-process": { + "version": "3.620.1", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/types": "^4.1.0", - "bowser": "^2.11.0", + "@aws-sdk/types": "3.609.0", + "@smithy/property-provider": "^3.1.3", + "@smithy/shared-ini-file-loader": "^3.1.4", + "@smithy/types": "^3.3.0", "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.758.0", + "node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.621.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@aws-sdk/middleware-user-agent": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/types": "^4.1.0", + "@aws-sdk/types": "3.609.0", + "@smithy/property-provider": "^3.1.3", + "@smithy/types": "^3.3.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" }, "peerDependencies": { - "aws-crt": ">=1.0.0" + "@aws-sdk/client-sts": "^3.621.0" + } + }, + "node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" }, - "peerDependenciesMeta": { - "aws-crt": { - "optional": true - } + "engines": { + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/abort-controller": { - "version": "4.0.1", + "node_modules/@aws-sdk/credential-provider-process": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/types": "^4.1.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/config-resolver": { - "version": "4.0.1", + "node_modules/@aws-sdk/credential-provider-process/node_modules/@aws-sdk/core": { + "version": "3.693.0", "license": "Apache-2.0", - "peer": true, "dependencies": { - "@smithy/node-config-provider": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-config-provider": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", + "@aws-sdk/types": "3.692.0", + "@smithy/core": "^2.5.2", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/property-provider": "^3.1.9", + "@smithy/protocol-http": "^4.1.6", + "@smithy/signature-v4": "^4.2.2", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/util-middleware": "^3.0.9", + "fast-xml-parser": "4.4.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.637.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/client-sso": "3.637.0", + "@aws-sdk/token-providers": "3.614.0", + "@aws-sdk/types": "3.609.0", + "@smithy/property-provider": "^3.1.3", + "@smithy/shared-ini-file-loader": "^3.1.4", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/core": { - "version": "3.1.5", + "node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.758.0", "license": "Apache-2.0", "peer": true, "dependencies": { - "@smithy/middleware-serde": "^4.0.2", - "@smithy/protocol-http": "^5.0.1", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/nested-clients": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/property-provider": "^4.0.1", "@smithy/types": "^4.1.0", - "@smithy/util-body-length-browser": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-stream": "^4.1.2", - "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/credential-provider-imds": { - "version": "4.0.1", + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@aws-sdk/core": { + "version": "3.758.0", "license": "Apache-2.0", "peer": true, "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/core": "^3.1.5", "@smithy/node-config-provider": "^4.0.1", "@smithy/property-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/signature-v4": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", "@smithy/types": "^4.1.0", - "@smithy/url-parser": "^4.0.1", + "@smithy/util-middleware": "^4.0.1", + "fast-xml-parser": "4.4.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/fetch-http-handler": { - "version": "5.0.1", + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@aws-sdk/types": { + "version": "3.734.0", "license": "Apache-2.0", "peer": true, "dependencies": { - "@smithy/protocol-http": "^5.0.1", - "@smithy/querystring-builder": "^4.0.1", "@smithy/types": "^4.1.0", - "@smithy/util-base64": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/hash-node": { + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/abort-controller": { "version": "4.0.1", "license": "Apache-2.0", "peer": true, "dependencies": { "@smithy/types": "^4.1.0", - "@smithy/util-buffer-from": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/invalid-dependency": { - "version": "4.0.1", + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/core": { + "version": "3.1.5", "license": "Apache-2.0", "peer": true, "dependencies": { + "@smithy/middleware-serde": "^4.0.2", + "@smithy/protocol-http": "^5.0.1", "@smithy/types": "^4.1.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-stream": "^4.1.2", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/is-array-buffer": { - "version": "4.0.0", + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/fetch-http-handler": { + "version": "5.0.1", "license": "Apache-2.0", "peer": true, "dependencies": { + "@smithy/protocol-http": "^5.0.1", + "@smithy/querystring-builder": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-base64": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/middleware-content-length": { - "version": "4.0.1", + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/is-array-buffer": { + "version": "4.0.0", "license": "Apache-2.0", "peer": true, "dependencies": { - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/middleware-endpoint": { + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/middleware-endpoint": { "version": "4.0.6", "license": "Apache-2.0", "peer": true, @@ -8548,26 +12158,7 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/middleware-retry": { - "version": "4.0.7", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@smithy/node-config-provider": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/service-error-classification": "^4.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-retry": "^4.0.1", - "tslib": "^2.6.2", - "uuid": "^9.0.1" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/middleware-serde": { + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/middleware-serde": { "version": "4.0.2", "license": "Apache-2.0", "peer": true, @@ -8579,7 +12170,7 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/middleware-stack": { + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/middleware-stack": { "version": "4.0.1", "license": "Apache-2.0", "peer": true, @@ -8591,7 +12182,7 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/node-config-provider": { + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/node-config-provider": { "version": "4.0.1", "license": "Apache-2.0", "peer": true, @@ -8605,7 +12196,7 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/node-http-handler": { + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/node-http-handler": { "version": "4.0.3", "license": "Apache-2.0", "peer": true, @@ -8620,7 +12211,7 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/property-provider": { + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/property-provider": { "version": "4.0.1", "license": "Apache-2.0", "peer": true, @@ -8632,7 +12223,7 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/protocol-http": { + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/protocol-http": { "version": "5.0.1", "license": "Apache-2.0", "peer": true, @@ -8644,7 +12235,7 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/querystring-builder": { + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/querystring-builder": { "version": "4.0.1", "license": "Apache-2.0", "peer": true, @@ -8657,7 +12248,7 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/querystring-parser": { + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/querystring-parser": { "version": "4.0.1", "license": "Apache-2.0", "peer": true, @@ -8669,18 +12260,7 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/service-error-classification": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@smithy/types": "^4.1.0" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/shared-ini-file-loader": { + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/shared-ini-file-loader": { "version": "4.0.1", "license": "Apache-2.0", "peer": true, @@ -8692,7 +12272,7 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/signature-v4": { + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/signature-v4": { "version": "5.0.1", "license": "Apache-2.0", "peer": true, @@ -8710,7 +12290,7 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/smithy-client": { + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/smithy-client": { "version": "4.1.6", "license": "Apache-2.0", "peer": true, @@ -8727,7 +12307,7 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/types": { + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/types": { "version": "4.1.0", "license": "Apache-2.0", "peer": true, @@ -8738,7 +12318,7 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/url-parser": { + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/url-parser": { "version": "4.0.1", "license": "Apache-2.0", "peer": true, @@ -8751,7 +12331,7 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-base64": { + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/util-base64": { "version": "4.0.0", "license": "Apache-2.0", "peer": true, @@ -8764,7 +12344,7 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-body-length-browser": { + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/util-body-length-browser": { "version": "4.0.0", "license": "Apache-2.0", "peer": true, @@ -8775,528 +12355,752 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-body-length-node": { + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/util-buffer-from": { "version": "4.0.0", "license": "Apache-2.0", "peer": true, "dependencies": { + "@smithy/is-array-buffer": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-buffer-from": { + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/util-hex-encoding": { "version": "4.0.0", "license": "Apache-2.0", "peer": true, "dependencies": { - "@smithy/is-array-buffer": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-config-provider": { - "version": "4.0.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/util-middleware": { + "version": "4.0.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/util-stream": { + "version": "4.1.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/node-http-handler": "^4.0.3", + "@smithy/types": "^4.1.0", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-hex-encoding": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/util-uri-escape": { + "version": "4.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/util-utf8": { + "version": "4.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/util-buffer-from": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-providers": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-providers/-/credential-providers-3.730.0.tgz", + "integrity": "sha512-Z25yfmHOehgIDVyY8h7GmAEbodHD2iLgNmrBBkkJXCE6d4GwDet3Qeyw4bQPPyuycBtYOUiz5Oco03+YGOEhYA==", + "dependencies": { + "@aws-sdk/client-cognito-identity": "3.730.0", + "@aws-sdk/core": "3.730.0", + "@aws-sdk/credential-provider-cognito-identity": "3.730.0", + "@aws-sdk/credential-provider-env": "3.730.0", + "@aws-sdk/credential-provider-http": "3.730.0", + "@aws-sdk/credential-provider-ini": "3.730.0", + "@aws-sdk/credential-provider-node": "3.730.0", + "@aws-sdk/credential-provider-process": "3.730.0", + "@aws-sdk/credential-provider-sso": "3.730.0", + "@aws-sdk/credential-provider-web-identity": "3.730.0", + "@aws-sdk/nested-clients": "3.730.0", + "@aws-sdk/types": "3.723.0", + "@smithy/credential-provider-imds": "^4.0.0", + "@smithy/property-provider": "^4.0.0", + "@smithy/types": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/client-sso": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.730.0.tgz", + "integrity": "sha512-mI8kqkSuVlZklewEmN7jcbBMyVODBld3MsTjCKSl5ztduuPX69JD7nXLnWWPkw1PX4aGTO24AEoRMGNxntoXUg==", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.730.0", + "@aws-sdk/middleware-host-header": "3.723.0", + "@aws-sdk/middleware-logger": "3.723.0", + "@aws-sdk/middleware-recursion-detection": "3.723.0", + "@aws-sdk/middleware-user-agent": "3.730.0", + "@aws-sdk/region-config-resolver": "3.723.0", + "@aws-sdk/types": "3.723.0", + "@aws-sdk/util-endpoints": "3.730.0", + "@aws-sdk/util-user-agent-browser": "3.723.0", + "@aws-sdk/util-user-agent-node": "3.730.0", + "@smithy/config-resolver": "^4.0.0", + "@smithy/core": "^3.0.0", + "@smithy/fetch-http-handler": "^5.0.0", + "@smithy/hash-node": "^4.0.0", + "@smithy/invalid-dependency": "^4.0.0", + "@smithy/middleware-content-length": "^4.0.0", + "@smithy/middleware-endpoint": "^4.0.0", + "@smithy/middleware-retry": "^4.0.0", + "@smithy/middleware-serde": "^4.0.0", + "@smithy/middleware-stack": "^4.0.0", + "@smithy/node-config-provider": "^4.0.0", + "@smithy/node-http-handler": "^4.0.0", + "@smithy/protocol-http": "^5.0.0", + "@smithy/smithy-client": "^4.0.0", + "@smithy/types": "^4.0.0", + "@smithy/url-parser": "^4.0.0", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.0", + "@smithy/util-defaults-mode-node": "^4.0.0", + "@smithy/util-endpoints": "^3.0.0", + "@smithy/util-middleware": "^4.0.0", + "@smithy/util-retry": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/core": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.730.0.tgz", + "integrity": "sha512-jonKyR+2GcqbZj2WDICZS0c633keLc9qwXnePu83DfAoFXMMIMyoR/7FOGf8F3OrIdGh8KzE9VvST+nZCK9EJA==", + "dependencies": { + "@aws-sdk/types": "3.723.0", + "@smithy/core": "^3.0.0", + "@smithy/node-config-provider": "^4.0.0", + "@smithy/property-provider": "^4.0.0", + "@smithy/protocol-http": "^5.0.0", + "@smithy/signature-v4": "^5.0.0", + "@smithy/smithy-client": "^4.0.0", + "@smithy/types": "^4.0.0", + "@smithy/util-middleware": "^4.0.0", + "fast-xml-parser": "4.4.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/credential-provider-env": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.730.0.tgz", + "integrity": "sha512-fFXgo3jBXLWqu8I07Hd96mS7RjrtpDgm3bZShm0F3lKtqDQF+hObFWq9A013SOE+RjMLVfbABhToXAYct3FcBw==", + "dependencies": { + "@aws-sdk/core": "3.730.0", + "@aws-sdk/types": "3.723.0", + "@smithy/property-provider": "^4.0.0", + "@smithy/types": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/credential-provider-http": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.730.0.tgz", + "integrity": "sha512-1aF3elbCzpVhWLAuV63iFElfLOqLGGTp4fkf2VAFIDO3hjshpXUQssTgIWiBwwtJYJdOSxaFrCU7u8frjr/5aQ==", "dependencies": { + "@aws-sdk/core": "3.730.0", + "@aws-sdk/types": "3.723.0", + "@smithy/fetch-http-handler": "^5.0.0", + "@smithy/node-http-handler": "^4.0.0", + "@smithy/property-provider": "^4.0.0", + "@smithy/protocol-http": "^5.0.0", + "@smithy/smithy-client": "^4.0.0", + "@smithy/types": "^4.0.0", + "@smithy/util-stream": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-defaults-mode-browser": { - "version": "4.0.7", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.730.0.tgz", + "integrity": "sha512-zwsxkBuQuPp06o45ATAnznHzj3+ibop/EaTytNzSv0O87Q59K/jnS/bdtv1n6bhe99XCieRNTihvtS7YklzK7A==", "dependencies": { - "@smithy/property-provider": "^4.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", - "bowser": "^2.11.0", + "@aws-sdk/core": "3.730.0", + "@aws-sdk/credential-provider-env": "3.730.0", + "@aws-sdk/credential-provider-http": "3.730.0", + "@aws-sdk/credential-provider-process": "3.730.0", + "@aws-sdk/credential-provider-sso": "3.730.0", + "@aws-sdk/credential-provider-web-identity": "3.730.0", + "@aws-sdk/nested-clients": "3.730.0", + "@aws-sdk/types": "3.723.0", + "@smithy/credential-provider-imds": "^4.0.0", + "@smithy/property-provider": "^4.0.0", + "@smithy/shared-ini-file-loader": "^4.0.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-defaults-mode-node": { - "version": "4.0.7", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/credential-provider-node": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.730.0.tgz", + "integrity": "sha512-ztRjh1edY7ut2wwrj1XqHtqPY/NXEYIk5fYf04KKsp8zBi81ScVqP7C+Cst6PFKixjgLSG6RsqMx9GSAalVv0Q==", "dependencies": { - "@smithy/config-resolver": "^4.0.1", - "@smithy/credential-provider-imds": "^4.0.1", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/property-provider": "^4.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", + "@aws-sdk/credential-provider-env": "3.730.0", + "@aws-sdk/credential-provider-http": "3.730.0", + "@aws-sdk/credential-provider-ini": "3.730.0", + "@aws-sdk/credential-provider-process": "3.730.0", + "@aws-sdk/credential-provider-sso": "3.730.0", + "@aws-sdk/credential-provider-web-identity": "3.730.0", + "@aws-sdk/types": "3.723.0", + "@smithy/credential-provider-imds": "^4.0.0", + "@smithy/property-provider": "^4.0.0", + "@smithy/shared-ini-file-loader": "^4.0.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-endpoints": { - "version": "3.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/credential-provider-process": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.730.0.tgz", + "integrity": "sha512-cNKUQ81eptfZN8MlSqwUq3+5ln8u/PcY57UmLZ+npxUHanqO1akpgcpNsLpmsIkoXGbtSQrLuDUgH86lS/SWOw==", "dependencies": { - "@smithy/node-config-provider": "^4.0.1", - "@smithy/types": "^4.1.0", + "@aws-sdk/core": "3.730.0", + "@aws-sdk/types": "3.723.0", + "@smithy/property-provider": "^4.0.0", + "@smithy/shared-ini-file-loader": "^4.0.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-hex-encoding": { - "version": "4.0.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.730.0.tgz", + "integrity": "sha512-SdI2xrTbquJLMxUh5LpSwB8zfiKq3/jso53xWRgrVfeDlrSzZuyV6QghaMs3KEEjcNzwEnTfSIjGQyRXG9VrEw==", "dependencies": { + "@aws-sdk/client-sso": "3.730.0", + "@aws-sdk/core": "3.730.0", + "@aws-sdk/token-providers": "3.730.0", + "@aws-sdk/types": "3.723.0", + "@smithy/property-provider": "^4.0.0", + "@smithy/shared-ini-file-loader": "^4.0.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-middleware": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.730.0.tgz", + "integrity": "sha512-l5vdPmvF/d890pbvv5g1GZrdjaSQkyPH/Bc8dO/ZqkWxkIP8JNgl48S2zgf4DkP3ik9K2axWO828L5RsMDQzdA==", "dependencies": { - "@smithy/types": "^4.1.0", + "@aws-sdk/core": "3.730.0", + "@aws-sdk/nested-clients": "3.730.0", + "@aws-sdk/types": "3.723.0", + "@smithy/property-provider": "^4.0.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-retry": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/middleware-host-header": { + "version": "3.723.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.723.0.tgz", + "integrity": "sha512-LLVzLvk299pd7v4jN9yOSaWDZDfH0SnBPb6q+FDPaOCMGBY8kuwQso7e/ozIKSmZHRMGO3IZrflasHM+rI+2YQ==", "dependencies": { - "@smithy/service-error-classification": "^4.0.1", - "@smithy/types": "^4.1.0", + "@aws-sdk/types": "3.723.0", + "@smithy/protocol-http": "^5.0.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-stream": { - "version": "4.1.2", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/middleware-logger": { + "version": "3.723.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.723.0.tgz", + "integrity": "sha512-chASQfDG5NJ8s5smydOEnNK7N0gDMyuPbx7dYYcm1t/PKtnVfvWF+DHCTrRC2Ej76gLJVCVizlAJKM8v8Kg3cg==", "dependencies": { - "@smithy/fetch-http-handler": "^5.0.1", - "@smithy/node-http-handler": "^4.0.3", - "@smithy/types": "^4.1.0", - "@smithy/util-base64": "^4.0.0", - "@smithy/util-buffer-from": "^4.0.0", - "@smithy/util-hex-encoding": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", + "@aws-sdk/types": "3.723.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-uri-escape": { - "version": "4.0.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.723.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.723.0.tgz", + "integrity": "sha512-7usZMtoynT9/jxL/rkuDOFQ0C2mhXl4yCm67Rg7GNTstl67u7w5WN1aIRImMeztaKlw8ExjoTyo6WTs1Kceh7A==", "dependencies": { + "@aws-sdk/types": "3.723.0", + "@smithy/protocol-http": "^5.0.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/util-utf8": { - "version": "4.0.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.730.0.tgz", + "integrity": "sha512-aPMZvNmf2a42B41au3bA3ODU4HfHka2nYT/SAIhhVXH1ENYfAmZo7FraFPxetKepFMCtL7j4QE6/LDucK6liIw==", "dependencies": { - "@smithy/util-buffer-from": "^4.0.0", + "@aws-sdk/core": "3.730.0", + "@aws-sdk/types": "3.723.0", + "@aws-sdk/util-endpoints": "3.730.0", + "@smithy/core": "^3.0.0", + "@smithy/protocol-http": "^5.0.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-node": { - "version": "3.637.0", - "license": "Apache-2.0", + "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/nested-clients": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.730.0.tgz", + "integrity": "sha512-vilIgf1/7kre8DdE5zAQkDOwHFb/TahMn/6j2RZwFLlK7cDk91r19deSiVYnKQkupDMtOfNceNqnorM4I3PDzw==", "dependencies": { - "@aws-sdk/credential-provider-env": "3.620.1", - "@aws-sdk/credential-provider-http": "3.635.0", - "@aws-sdk/credential-provider-ini": "3.637.0", - "@aws-sdk/credential-provider-process": "3.620.1", - "@aws-sdk/credential-provider-sso": "3.637.0", - "@aws-sdk/credential-provider-web-identity": "3.621.0", - "@aws-sdk/types": "3.609.0", - "@smithy/credential-provider-imds": "^3.2.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.730.0", + "@aws-sdk/middleware-host-header": "3.723.0", + "@aws-sdk/middleware-logger": "3.723.0", + "@aws-sdk/middleware-recursion-detection": "3.723.0", + "@aws-sdk/middleware-user-agent": "3.730.0", + "@aws-sdk/region-config-resolver": "3.723.0", + "@aws-sdk/types": "3.723.0", + "@aws-sdk/util-endpoints": "3.730.0", + "@aws-sdk/util-user-agent-browser": "3.723.0", + "@aws-sdk/util-user-agent-node": "3.730.0", + "@smithy/config-resolver": "^4.0.0", + "@smithy/core": "^3.0.0", + "@smithy/fetch-http-handler": "^5.0.0", + "@smithy/hash-node": "^4.0.0", + "@smithy/invalid-dependency": "^4.0.0", + "@smithy/middleware-content-length": "^4.0.0", + "@smithy/middleware-endpoint": "^4.0.0", + "@smithy/middleware-retry": "^4.0.0", + "@smithy/middleware-serde": "^4.0.0", + "@smithy/middleware-stack": "^4.0.0", + "@smithy/node-config-provider": "^4.0.0", + "@smithy/node-http-handler": "^4.0.0", + "@smithy/protocol-http": "^5.0.0", + "@smithy/smithy-client": "^4.0.0", + "@smithy/types": "^4.0.0", + "@smithy/url-parser": "^4.0.0", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.0", + "@smithy/util-defaults-mode-node": "^4.0.0", + "@smithy/util-endpoints": "^3.0.0", + "@smithy/util-middleware": "^4.0.0", + "@smithy/util-retry": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/credential-provider-env": { - "version": "3.620.1", - "license": "Apache-2.0", + "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/region-config-resolver": { + "version": "3.723.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.723.0.tgz", + "integrity": "sha512-tGF/Cvch3uQjZIj34LY2mg8M2Dr4kYG8VU8Yd0dFnB1ybOEOveIK/9ypUo9ycZpB9oO6q01KRe5ijBaxNueUQg==", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/types": "^3.3.0", + "@aws-sdk/types": "3.723.0", + "@smithy/node-config-provider": "^4.0.0", + "@smithy/types": "^4.0.0", + "@smithy/util-config-provider": "^4.0.0", + "@smithy/util-middleware": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.637.0", - "license": "Apache-2.0", + "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/token-providers": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.730.0.tgz", + "integrity": "sha512-BSPssGj54B/AABWXARIPOT/1ybFahM1ldlfmXy9gRmZi/afe9geWJGlFYCCt3PmqR+1Ny5XIjSfue+kMd//drQ==", "dependencies": { - "@aws-sdk/credential-provider-env": "3.620.1", - "@aws-sdk/credential-provider-http": "3.635.0", - "@aws-sdk/credential-provider-process": "3.620.1", - "@aws-sdk/credential-provider-sso": "3.637.0", - "@aws-sdk/credential-provider-web-identity": "3.621.0", - "@aws-sdk/types": "3.609.0", - "@smithy/credential-provider-imds": "^3.2.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", + "@aws-sdk/nested-clients": "3.730.0", + "@aws-sdk/types": "3.723.0", + "@smithy/property-provider": "^4.0.0", + "@smithy/shared-ini-file-loader": "^4.0.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.637.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/credential-provider-process": { - "version": "3.620.1", - "license": "Apache-2.0", + "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/types": { + "version": "3.723.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.723.0.tgz", + "integrity": "sha512-LmK3kwiMZG1y5g3LGihT9mNkeNOmwEyPk6HGcJqh0wOSV4QpWoKu2epyKE4MLQNUUlz2kOVbVbOrwmI6ZcteuA==", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.621.0", - "license": "Apache-2.0", + "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/util-endpoints": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.730.0.tgz", + "integrity": "sha512-1KTFuVnk+YtLgWr6TwDiggcDqtPpOY2Cszt3r2lkXfaEAX6kHyOZi1vdvxXjPU5LsOBJem8HZ7KlkmrEi+xowg==", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/types": "^3.3.0", + "@aws-sdk/types": "3.723.0", + "@smithy/types": "^4.0.0", + "@smithy/util-endpoints": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.621.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "license": "Apache-2.0", + "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.723.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.723.0.tgz", + "integrity": "sha512-Wh9I6j2jLhNFq6fmXydIpqD1WyQLyTfSxjW9B+PXSnPyk3jtQW8AKQur7p97rO8LAUzVI0bv8kb3ZzDEVbquIg==", "dependencies": { - "@smithy/types": "^3.3.0", + "@aws-sdk/types": "3.723.0", + "@smithy/types": "^4.0.0", + "bowser": "^2.11.0", "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/credential-provider-process": { - "version": "3.693.0", - "license": "Apache-2.0", + "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.730.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.730.0.tgz", + "integrity": "sha512-yBvkOAjqsDEl1va4eHNOhnFBk0iCY/DBFNyhvtTMqPF4NO+MITWpFs3J9JtZKzJlQ6x0Yb9TLQ8NhDjEISz5Ug==", "dependencies": { - "@aws-sdk/core": "3.693.0", - "@aws-sdk/types": "3.692.0", - "@smithy/property-provider": "^3.1.9", - "@smithy/shared-ini-file-loader": "^3.1.10", - "@smithy/types": "^3.7.0", + "@aws-sdk/middleware-user-agent": "3.730.0", + "@aws-sdk/types": "3.723.0", + "@smithy/node-config-provider": "^4.0.0", + "@smithy/types": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } } }, - "node_modules/@aws-sdk/credential-provider-process/node_modules/@aws-sdk/core": { - "version": "3.693.0", - "license": "Apache-2.0", + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/abort-controller": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-4.0.4.tgz", + "integrity": "sha512-gJnEjZMvigPDQWHrW3oPrFhQtkrgqBkyjj3pCIdF3A5M6vsZODG93KNlfJprv6bp4245bdT32fsHK4kkH3KYDA==", "dependencies": { - "@aws-sdk/types": "3.692.0", - "@smithy/core": "^2.5.2", - "@smithy/node-config-provider": "^3.1.10", - "@smithy/property-provider": "^3.1.9", - "@smithy/protocol-http": "^4.1.6", - "@smithy/signature-v4": "^4.2.2", - "@smithy/smithy-client": "^3.4.3", - "@smithy/types": "^3.7.0", - "@smithy/util-middleware": "^3.0.9", - "fast-xml-parser": "4.4.1", + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.637.0", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/client-sso": "3.637.0", - "@aws-sdk/token-providers": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/config-resolver": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-4.1.4.tgz", + "integrity": "sha512-prmU+rDddxHOH0oNcwemL+SwnzcG65sBF2yXRO7aeXIn/xTlq2pX7JLVbkBnVLowHLg4/OL4+jBmv9hVrVGS+w==", + "dependencies": { + "@smithy/node-config-provider": "^4.1.3", + "@smithy/types": "^4.3.1", + "@smithy/util-config-provider": "^4.0.0", + "@smithy/util-middleware": "^4.0.4", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "license": "Apache-2.0", + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/core": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.5.3.tgz", + "integrity": "sha512-xa5byV9fEguZNofCclv6v9ra0FYh5FATQW/da7FQUVTic94DfrN/NvmKZjrMyzbpqfot9ZjBaO8U1UeTbmSLuA==", "dependencies": { - "@smithy/types": "^3.3.0", + "@smithy/middleware-serde": "^4.0.8", + "@smithy/protocol-http": "^5.1.2", + "@smithy/types": "^4.3.1", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-middleware": "^4.0.4", + "@smithy/util-stream": "^4.2.2", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.758.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/credential-provider-imds": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.0.6.tgz", + "integrity": "sha512-hKMWcANhUiNbCJouYkZ9V3+/Qf9pteR1dnwgdyzR09R4ODEYx8BbUysHwRSyex4rZ9zapddZhLFTnT4ZijR4pw==", "dependencies": { - "@aws-sdk/core": "3.758.0", - "@aws-sdk/nested-clients": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@smithy/property-provider": "^4.0.1", - "@smithy/types": "^4.1.0", + "@smithy/node-config-provider": "^4.1.3", + "@smithy/property-provider": "^4.0.4", + "@smithy/types": "^4.3.1", + "@smithy/url-parser": "^4.0.4", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@aws-sdk/core": { - "version": "3.758.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/fetch-http-handler": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.0.4.tgz", + "integrity": "sha512-AMtBR5pHppYMVD7z7G+OlHHAcgAN7v0kVKEpHuTO4Gb199Gowh0taYi9oDStFeUhetkeP55JLSVlTW1n9rFtUw==", "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/core": "^3.1.5", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/property-provider": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/signature-v4": "^5.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", - "@smithy/util-middleware": "^4.0.1", - "fast-xml-parser": "4.4.1", + "@smithy/protocol-http": "^5.1.2", + "@smithy/querystring-builder": "^4.0.4", + "@smithy/types": "^4.3.1", + "@smithy/util-base64": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@aws-sdk/types": { - "version": "3.734.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/hash-node": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-4.0.4.tgz", + "integrity": "sha512-qnbTPUhCVnCgBp4z4BUJUhOEkVwxiEi1cyFM+Zj6o+aY8OFGxUQleKWq8ltgp3dujuhXojIvJWdoqpm6dVO3lQ==", "dependencies": { - "@smithy/types": "^4.1.0", + "@smithy/types": "^4.3.1", + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/abort-controller": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/invalid-dependency": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-4.0.4.tgz", + "integrity": "sha512-bNYMi7WKTJHu0gn26wg8OscncTt1t2b8KcsZxvOv56XA6cyXtOAAAaNP7+m45xfppXfOatXF3Sb1MNsLUgVLTw==", "dependencies": { - "@smithy/types": "^4.1.0", + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/core": { - "version": "3.1.5", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/is-array-buffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-4.0.0.tgz", + "integrity": "sha512-saYhF8ZZNoJDTvJBEWgeBccCg+yvp1CX+ed12yORU3NilJScfc6gfch2oVb4QgxZrGUx3/ZJlb+c/dJbyupxlw==", "dependencies": { - "@smithy/middleware-serde": "^4.0.2", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-body-length-browser": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-stream": "^4.1.2", - "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/fetch-http-handler": { - "version": "5.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/middleware-content-length": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-4.0.4.tgz", + "integrity": "sha512-F7gDyfI2BB1Kc+4M6rpuOLne5LOcEknH1n6UQB69qv+HucXBR1rkzXBnQTB2q46sFy1PM/zuSJOB532yc8bg3w==", "dependencies": { - "@smithy/protocol-http": "^5.0.1", - "@smithy/querystring-builder": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-base64": "^4.0.0", + "@smithy/protocol-http": "^5.1.2", + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/is-array-buffer": { - "version": "4.0.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/middleware-endpoint": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.1.11.tgz", + "integrity": "sha512-zDogwtRLzKl58lVS8wPcARevFZNBOOqnmzWWxVe9XiaXU2CADFjvJ9XfNibgkOWs08sxLuSr81NrpY4mgp9OwQ==", "dependencies": { + "@smithy/core": "^3.5.3", + "@smithy/middleware-serde": "^4.0.8", + "@smithy/node-config-provider": "^4.1.3", + "@smithy/shared-ini-file-loader": "^4.0.4", + "@smithy/types": "^4.3.1", + "@smithy/url-parser": "^4.0.4", + "@smithy/util-middleware": "^4.0.4", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/middleware-endpoint": { - "version": "4.0.6", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/middleware-retry": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.1.12.tgz", + "integrity": "sha512-wvIH70c4e91NtRxdaLZF+mbLZ/HcC6yg7ySKUiufL6ESp6zJUSnJucZ309AvG9nqCFHSRB5I6T3Ez1Q9wCh0Ww==", "dependencies": { - "@smithy/core": "^3.1.5", - "@smithy/middleware-serde": "^4.0.2", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/url-parser": "^4.0.1", - "@smithy/util-middleware": "^4.0.1", - "tslib": "^2.6.2" + "@smithy/node-config-provider": "^4.1.3", + "@smithy/protocol-http": "^5.1.2", + "@smithy/service-error-classification": "^4.0.5", + "@smithy/smithy-client": "^4.4.3", + "@smithy/types": "^4.3.1", + "@smithy/util-middleware": "^4.0.4", + "@smithy/util-retry": "^4.0.5", + "tslib": "^2.6.2", + "uuid": "^9.0.1" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/middleware-serde": { - "version": "4.0.2", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/middleware-serde": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.0.8.tgz", + "integrity": "sha512-iSSl7HJoJaGyMIoNn2B7czghOVwJ9nD7TMvLhMWeSB5vt0TnEYyRRqPJu/TqW76WScaNvYYB8nRoiBHR9S1Ddw==", "dependencies": { - "@smithy/types": "^4.1.0", + "@smithy/protocol-http": "^5.1.2", + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/middleware-stack": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/middleware-stack": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-4.0.4.tgz", + "integrity": "sha512-kagK5ggDrBUCCzI93ft6DjteNSfY8Ulr83UtySog/h09lTIOAJ/xUSObutanlPT0nhoHAkpmW9V5K8oPyLh+QA==", "dependencies": { - "@smithy/types": "^4.1.0", + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/node-config-provider": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/node-config-provider": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-4.1.3.tgz", + "integrity": "sha512-HGHQr2s59qaU1lrVH6MbLlmOBxadtzTsoO4c+bF5asdgVik3I8o7JIOzoeqWc5MjVa+vD36/LWE0iXKpNqooRw==", "dependencies": { - "@smithy/property-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", + "@smithy/property-provider": "^4.0.4", + "@smithy/shared-ini-file-loader": "^4.0.4", + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/node-http-handler": { - "version": "4.0.3", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/node-http-handler": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.0.6.tgz", + "integrity": "sha512-NqbmSz7AW2rvw4kXhKGrYTiJVDHnMsFnX4i+/FzcZAfbOBauPYs2ekuECkSbtqaxETLLTu9Rl/ex6+I2BKErPA==", "dependencies": { - "@smithy/abort-controller": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/querystring-builder": "^4.0.1", - "@smithy/types": "^4.1.0", + "@smithy/abort-controller": "^4.0.4", + "@smithy/protocol-http": "^5.1.2", + "@smithy/querystring-builder": "^4.0.4", + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/property-provider": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/property-provider": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.0.4.tgz", + "integrity": "sha512-qHJ2sSgu4FqF4U/5UUp4DhXNmdTrgmoAai6oQiM+c5RZ/sbDwJ12qxB1M6FnP+Tn/ggkPZf9ccn4jqKSINaquw==", "dependencies": { - "@smithy/types": "^4.1.0", + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/protocol-http": { - "version": "5.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/protocol-http": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-5.1.2.tgz", + "integrity": "sha512-rOG5cNLBXovxIrICSBm95dLqzfvxjEmuZx4KK3hWwPFHGdW3lxY0fZNXfv2zebfRO7sJZ5pKJYHScsqopeIWtQ==", "dependencies": { - "@smithy/types": "^4.1.0", + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/querystring-builder": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/querystring-builder": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-4.0.4.tgz", + "integrity": "sha512-SwREZcDnEYoh9tLNgMbpop+UTGq44Hl9tdj3rf+yeLcfH7+J8OXEBaMc2kDxtyRHu8BhSg9ADEx0gFHvpJgU8w==", "dependencies": { - "@smithy/types": "^4.1.0", + "@smithy/types": "^4.3.1", "@smithy/util-uri-escape": "^4.0.0", "tslib": "^2.6.2" }, @@ -9304,40 +13108,51 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/querystring-parser": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/querystring-parser": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-4.0.4.tgz", + "integrity": "sha512-6yZf53i/qB8gRHH/l2ZwUG5xgkPgQF15/KxH0DdXMDHjesA9MeZje/853ifkSY0x4m5S+dfDZ+c4x439PF0M2w==", "dependencies": { - "@smithy/types": "^4.1.0", + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/shared-ini-file-loader": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/service-error-classification": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.0.5.tgz", + "integrity": "sha512-LvcfhrnCBvCmTee81pRlh1F39yTS/+kYleVeLCwNtkY8wtGg8V/ca9rbZZvYIl8OjlMtL6KIjaiL/lgVqHD2nA==", "dependencies": { - "@smithy/types": "^4.1.0", + "@smithy/types": "^4.3.1" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/shared-ini-file-loader": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.0.4.tgz", + "integrity": "sha512-63X0260LoFBjrHifPDs+nM9tV0VMkOTl4JRMYNuKh/f5PauSjowTfvF3LogfkWdcPoxsA9UjqEOgjeYIbhb7Nw==", + "dependencies": { + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/signature-v4": { - "version": "5.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/signature-v4": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.1.2.tgz", + "integrity": "sha512-d3+U/VpX7a60seHziWnVZOHuEgJlclufjkS6zhXvxcJgkJq4UWdH5eOBLzHRMx6gXjsdT9h6lfpmLzbrdupHgQ==", "dependencies": { "@smithy/is-array-buffer": "^4.0.0", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", + "@smithy/protocol-http": "^5.1.2", + "@smithy/types": "^4.3.1", "@smithy/util-hex-encoding": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", + "@smithy/util-middleware": "^4.0.4", "@smithy/util-uri-escape": "^4.0.0", "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" @@ -9346,27 +13161,27 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/smithy-client": { - "version": "4.1.6", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/smithy-client": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.4.3.tgz", + "integrity": "sha512-xxzNYgA0HD6ETCe5QJubsxP0hQH3QK3kbpJz3QrosBCuIWyEXLR/CO5hFb2OeawEKUxMNhz3a1nuJNN2np2RMA==", "dependencies": { - "@smithy/core": "^3.1.5", - "@smithy/middleware-endpoint": "^4.0.6", - "@smithy/middleware-stack": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-stream": "^4.1.2", + "@smithy/core": "^3.5.3", + "@smithy/middleware-endpoint": "^4.1.11", + "@smithy/middleware-stack": "^4.0.4", + "@smithy/protocol-http": "^5.1.2", + "@smithy/types": "^4.3.1", + "@smithy/util-stream": "^4.2.2", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/types": { - "version": "4.1.0", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/types": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.3.1.tgz", + "integrity": "sha512-UqKOQBL2x6+HWl3P+3QqFD4ncKq0I8Nuz9QItGv5WuKuMHuuwlhvqcZCoXGfc+P1QmfJE7VieykoYYmrOoFJxA==", "dependencies": { "tslib": "^2.6.2" }, @@ -9374,23 +13189,23 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/url-parser": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/url-parser": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-4.0.4.tgz", + "integrity": "sha512-eMkc144MuN7B0TDA4U2fKs+BqczVbk3W+qIvcoCY6D1JY3hnAdCuhCZODC+GAeaxj0p6Jroz4+XMUn3PCxQQeQ==", "dependencies": { - "@smithy/querystring-parser": "^4.0.1", - "@smithy/types": "^4.1.0", + "@smithy/querystring-parser": "^4.0.4", + "@smithy/types": "^4.3.1", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/util-base64": { + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/util-base64": { "version": "4.0.0", - "license": "Apache-2.0", - "peer": true, + "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-4.0.0.tgz", + "integrity": "sha512-CvHfCmO2mchox9kjrtzoHkWHxjHZzaFojLc8quxXY7WAAMAg43nuxwv95tATVgQFNDwd4M9S1qFzj40Ul41Kmg==", "dependencies": { "@smithy/util-buffer-from": "^4.0.0", "@smithy/util-utf8": "^4.0.0", @@ -9400,10 +13215,10 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/util-body-length-browser": { + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/util-body-length-browser": { "version": "4.0.0", - "license": "Apache-2.0", - "peer": true, + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-4.0.0.tgz", + "integrity": "sha512-sNi3DL0/k64/LO3A256M+m3CDdG6V7WKWHdAiBBMUN8S3hK3aMPhwnPik2A/a2ONN+9doY9UxaLfgqsIRg69QA==", "dependencies": { "tslib": "^2.6.2" }, @@ -9411,10 +13226,21 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/util-buffer-from": { + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/util-body-length-node": { "version": "4.0.0", - "license": "Apache-2.0", - "peer": true, + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-4.0.0.tgz", + "integrity": "sha512-q0iDP3VsZzqJyje8xJWEJCNIu3lktUGVoSy1KB0UWym2CL1siV3artm+u1DFYTLejpsrdGyCSWBdGNjJzfDPjg==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/util-buffer-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-4.0.0.tgz", + "integrity": "sha512-9TOQ7781sZvddgO8nxueKi3+yGvkY35kotA0Y6BWRajAv8jjmigQ1sBwz0UX47pQMYXJPahSKEKYFgt+rXdcug==", "dependencies": { "@smithy/is-array-buffer": "^4.0.0", "tslib": "^2.6.2" @@ -9423,10 +13249,10 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/util-hex-encoding": { + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/util-config-provider": { "version": "4.0.0", - "license": "Apache-2.0", - "peer": true, + "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-4.0.0.tgz", + "integrity": "sha512-L1RBVzLyfE8OXH+1hsJ8p+acNUSirQnWQ6/EgpchV88G6zGBTDPdXiiExei6Z1wR2RxYvxY/XLw6AMNCCt8H3w==", "dependencies": { "tslib": "^2.6.2" }, @@ -9434,26 +13260,95 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/util-middleware": { - "version": "4.0.1", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/util-defaults-mode-browser": { + "version": "4.0.19", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.0.19.tgz", + "integrity": "sha512-mvLMh87xSmQrV5XqnUYEPoiFFeEGYeAKIDDKdhE2ahqitm8OHM3aSvhqL6rrK6wm1brIk90JhxDf5lf2hbrLbQ==", "dependencies": { - "@smithy/types": "^4.1.0", + "@smithy/property-provider": "^4.0.4", + "@smithy/smithy-client": "^4.4.3", + "@smithy/types": "^4.3.1", + "bowser": "^2.11.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/util-stream": { - "version": "4.1.2", - "license": "Apache-2.0", - "peer": true, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/util-defaults-mode-node": { + "version": "4.0.19", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.0.19.tgz", + "integrity": "sha512-8tYnx+LUfj6m+zkUUIrIQJxPM1xVxfRBvoGHua7R/i6qAxOMjqR6CpEpDwKoIs1o0+hOjGvkKE23CafKL0vJ9w==", + "dependencies": { + "@smithy/config-resolver": "^4.1.4", + "@smithy/credential-provider-imds": "^4.0.6", + "@smithy/node-config-provider": "^4.1.3", + "@smithy/property-provider": "^4.0.4", + "@smithy/smithy-client": "^4.4.3", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/util-endpoints": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-3.0.6.tgz", + "integrity": "sha512-YARl3tFL3WgPuLzljRUnrS2ngLiUtkwhQtj8PAL13XZSyUiNLQxwG3fBBq3QXFqGFUXepIN73pINp3y8c2nBmA==", + "dependencies": { + "@smithy/node-config-provider": "^4.1.3", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/util-hex-encoding": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-4.0.0.tgz", + "integrity": "sha512-Yk5mLhHtfIgW2W2WQZWSg5kuMZCVbvhFmC7rV4IO2QqnZdbEFPmQnCcGMAX2z/8Qj3B9hYYNjZOhWym+RwhePw==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/util-middleware": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-4.0.4.tgz", + "integrity": "sha512-9MLKmkBmf4PRb0ONJikCbCwORACcil6gUWojwARCClT7RmLzF04hUR4WdRprIXal7XVyrddadYNfp2eF3nrvtQ==", + "dependencies": { + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/util-retry": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.0.5.tgz", + "integrity": "sha512-V7MSjVDTlEt/plmOFBn1762Dyu5uqMrV2Pl2X0dYk4XvWfdWJNe9Bs5Bzb56wkCuiWjSfClVMGcsuKrGj7S/yg==", + "dependencies": { + "@smithy/service-error-classification": "^4.0.5", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/util-stream": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.2.2.tgz", + "integrity": "sha512-aI+GLi7MJoVxg24/3J1ipwLoYzgkB4kUfogZfnslcYlynj3xsQ0e7vk4TnTro9hhsS5PvX1mwmkRqqHQjwcU7w==", "dependencies": { - "@smithy/fetch-http-handler": "^5.0.1", - "@smithy/node-http-handler": "^4.0.3", - "@smithy/types": "^4.1.0", + "@smithy/fetch-http-handler": "^5.0.4", + "@smithy/node-http-handler": "^4.0.6", + "@smithy/types": "^4.3.1", "@smithy/util-base64": "^4.0.0", "@smithy/util-buffer-from": "^4.0.0", "@smithy/util-hex-encoding": "^4.0.0", @@ -9464,10 +13359,10 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/util-uri-escape": { + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/util-uri-escape": { "version": "4.0.0", - "license": "Apache-2.0", - "peer": true, + "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-4.0.0.tgz", + "integrity": "sha512-77yfbCbQMtgtTylO9itEAdpPXSog3ZxMe09AEhm0dU0NLTalV70ghDZFR+Nfi1C60jnJoh/Re4090/DuZh2Omg==", "dependencies": { "tslib": "^2.6.2" }, @@ -9475,10 +13370,10 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/util-utf8": { + "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/util-utf8": { "version": "4.0.0", - "license": "Apache-2.0", - "peer": true, + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-4.0.0.tgz", + "integrity": "sha512-b+zebfKCfRdgNJDknHCob3O7FpeYQN6ZG6YLExMcasDHsCXlsXCEuiPZeLnJLpwa5dvPetGlnGCiMHuLwGvFow==", "dependencies": { "@smithy/util-buffer-from": "^4.0.0", "tslib": "^2.6.2" @@ -9812,6 +13707,232 @@ "node": ">=16.0.0" } }, + "node_modules/@aws-sdk/middleware-sdk-sts": { + "version": "3.363.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-sts/-/middleware-sdk-sts-3.363.0.tgz", + "integrity": "sha512-1yy2Ac50FO8BrODaw5bPWvVrRhaVLqXTFH6iHB+dJLPUkwtY5zLM3Mp+9Ilm7kME+r7oIB1wuO6ZB1Lf4ZszIw==", + "dependencies": { + "@aws-sdk/middleware-signing": "3.363.0", + "@aws-sdk/types": "3.357.0", + "@smithy/types": "^1.1.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-sdk-sts/node_modules/@aws-sdk/types": { + "version": "3.357.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.357.0.tgz", + "integrity": "sha512-/riCRaXg3p71BeWnShrai0y0QTdXcouPSM0Cn1olZbzTf7s71aLEewrc96qFrL70XhY4XvnxMpqQh+r43XIL3g==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-sdk-sts/node_modules/@smithy/types": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-1.2.0.tgz", + "integrity": "sha512-z1r00TvBqF3dh4aHhya7nz1HhvCg4TRmw51fjMrh5do3h+ngSstt/yKlNbHeb9QxJmFbmN8KEVSWgb1bRvfEoA==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-signing": { + "version": "3.363.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-signing/-/middleware-signing-3.363.0.tgz", + "integrity": "sha512-/7qia715pt9JKYIPDGu22WmdZxD8cfF/5xB+1kmILg7ZtjO0pPuTaCNJ7xiIuFd7Dn7JXp5lop08anX/GOhNRQ==", + "dependencies": { + "@aws-sdk/types": "3.357.0", + "@smithy/property-provider": "^1.0.1", + "@smithy/protocol-http": "^1.1.0", + "@smithy/signature-v4": "^1.0.1", + "@smithy/types": "^1.1.0", + "@smithy/util-middleware": "^1.0.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-signing/node_modules/@aws-crypto/crc32": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/crc32/-/crc32-3.0.0.tgz", + "integrity": "sha512-IzSgsrxUcsrejQbPVilIKy16kAT52EwB6zSaI+M3xxIhKh5+aldEyvI+z6erM7TCLB2BJsFrtHjp6/4/sr+3dA==", + "dependencies": { + "@aws-crypto/util": "^3.0.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-sdk/middleware-signing/node_modules/@aws-crypto/crc32/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@aws-sdk/middleware-signing/node_modules/@aws-crypto/util": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-3.0.0.tgz", + "integrity": "sha512-2OJlpeJpCR48CC8r+uKVChzs9Iungj9wkZrl8Z041DWEWvyIHILYKCPNzJghKsivj+S3mLo6BVc7mBNzdxA46w==", + "dependencies": { + "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-utf8-browser": "^3.0.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-sdk/middleware-signing/node_modules/@aws-crypto/util/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@aws-sdk/middleware-signing/node_modules/@aws-sdk/types": { + "version": "3.357.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.357.0.tgz", + "integrity": "sha512-/riCRaXg3p71BeWnShrai0y0QTdXcouPSM0Cn1olZbzTf7s71aLEewrc96qFrL70XhY4XvnxMpqQh+r43XIL3g==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-signing/node_modules/@smithy/eventstream-codec": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-codec/-/eventstream-codec-1.1.0.tgz", + "integrity": "sha512-3tEbUb8t8an226jKB6V/Q2XU/J53lCwCzULuBPEaF4JjSh+FlCMp7TmogE/Aij5J9DwlsZ4VAD/IRDuQ/0ZtMw==", + "dependencies": { + "@aws-crypto/crc32": "3.0.0", + "@smithy/types": "^1.2.0", + "@smithy/util-hex-encoding": "^1.1.0", + "tslib": "^2.5.0" + } + }, + "node_modules/@aws-sdk/middleware-signing/node_modules/@smithy/is-array-buffer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-1.1.0.tgz", + "integrity": "sha512-twpQ/n+3OWZJ7Z+xu43MJErmhB/WO/mMTnqR6PwWQShvSJ/emx5d1N59LQZk6ZpTAeuRWrc+eHhkzTp9NFjNRQ==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-signing/node_modules/@smithy/property-provider": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-1.2.0.tgz", + "integrity": "sha512-qlJd9gT751i4T0t/hJAyNGfESfi08Fek8QiLcysoKPgR05qHhG0OYhlaCJHhpXy4ECW0lHyjvFM1smrCLIXVfw==", + "dependencies": { + "@smithy/types": "^1.2.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-signing/node_modules/@smithy/protocol-http": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-1.2.0.tgz", + "integrity": "sha512-GfGfruksi3nXdFok5RhgtOnWe5f6BndzYfmEXISD+5gAGdayFGpjWu5pIqIweTudMtse20bGbc+7MFZXT1Tb8Q==", + "dependencies": { + "@smithy/types": "^1.2.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-signing/node_modules/@smithy/signature-v4": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-1.1.0.tgz", + "integrity": "sha512-fDo3m7YqXBs7neciOePPd/X9LPm5QLlDMdIC4m1H6dgNLnXfLMFNIxEfPyohGA8VW9Wn4X8lygnPSGxDZSmp0Q==", + "dependencies": { + "@smithy/eventstream-codec": "^1.1.0", + "@smithy/is-array-buffer": "^1.1.0", + "@smithy/types": "^1.2.0", + "@smithy/util-hex-encoding": "^1.1.0", + "@smithy/util-middleware": "^1.1.0", + "@smithy/util-uri-escape": "^1.1.0", + "@smithy/util-utf8": "^1.1.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-signing/node_modules/@smithy/types": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-1.2.0.tgz", + "integrity": "sha512-z1r00TvBqF3dh4aHhya7nz1HhvCg4TRmw51fjMrh5do3h+ngSstt/yKlNbHeb9QxJmFbmN8KEVSWgb1bRvfEoA==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-signing/node_modules/@smithy/util-buffer-from": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-1.1.0.tgz", + "integrity": "sha512-9m6NXE0ww+ra5HKHCHig20T+FAwxBAm7DIdwc/767uGWbRcY720ybgPacQNB96JMOI7xVr/CDa3oMzKmW4a+kw==", + "dependencies": { + "@smithy/is-array-buffer": "^1.1.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-signing/node_modules/@smithy/util-hex-encoding": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-1.1.0.tgz", + "integrity": "sha512-7UtIE9eH0u41zpB60Jzr0oNCQ3hMJUabMcKRUVjmyHTXiWDE4vjSqN6qlih7rCNeKGbioS7f/y2Jgym4QZcKFg==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-signing/node_modules/@smithy/util-middleware": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-1.1.0.tgz", + "integrity": "sha512-6hhckcBqVgjWAqLy2vqlPZ3rfxLDhFWEmM7oLh2POGvsi7j0tHkbN7w4DFhuBExVJAbJ/qqxqZdRY6Fu7/OezQ==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-signing/node_modules/@smithy/util-uri-escape": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-1.1.0.tgz", + "integrity": "sha512-/jL/V1xdVRt5XppwiaEU8Etp5WHZj609n0xMTuehmCqdoOFbId1M+aEeDWZsQ+8JbEB/BJ6ynY2SlYmOaKtt8w==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-signing/node_modules/@smithy/util-utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-1.1.0.tgz", + "integrity": "sha512-p/MYV+JmqmPyjdgyN2UxAeYDj9cBqCjp0C/NsTWnnjoZUVqoeZ6IrW915L9CAKWVECgv9lVQGc4u/yz26/bI1A==", + "dependencies": { + "@smithy/util-buffer-from": "^1.1.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@aws-sdk/middleware-ssec": { "version": "3.693.0", "license": "Apache-2.0", @@ -10867,6 +14988,14 @@ "node": ">=16.0.0" } }, + "node_modules/@aws-sdk/util-utf8-browser": { + "version": "3.259.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-utf8-browser/-/util-utf8-browser-3.259.0.tgz", + "integrity": "sha512-UvFa/vR+e19XookZF8RzFZBrw2EUkQWxiBW0yYQAhvk3C+QVGl0H3ouca8LDBlBfQKXwmW3huo/59H8rwb1wJw==", + "dependencies": { + "tslib": "^2.3.1" + } + }, "node_modules/@aws-sdk/xml-builder": { "version": "3.693.0", "license": "Apache-2.0", @@ -10879,9 +15008,9 @@ } }, "node_modules/@aws-toolkits/telemetry": { - "version": "1.0.324", - "resolved": "https://registry.npmjs.org/@aws-toolkits/telemetry/-/telemetry-1.0.324.tgz", - "integrity": "sha512-O4K9Ip3ge+EdTITOhMNcVxp+DPxK/1JHm9XcDwg/5N3q9SbwQ7/WeVtTHkvgq+IiQGKjnJ/4Vuyw3/3h29K7ww==", + "version": "1.0.329", + "resolved": "https://registry.npmjs.org/@aws-toolkits/telemetry/-/telemetry-1.0.329.tgz", + "integrity": "sha512-zMkljZDtIAxuZzPTLL5zIxn+zGmk767sbqGIc2ZYuv0sSU+UoYgB3tqwV5KVV2oDPKs5593nwJC97NVHJqzowQ==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -10905,20 +15034,23 @@ } }, "node_modules/@aws/chat-client-ui-types": { - "version": "0.1.26", + "version": "0.1.47", + "resolved": "https://registry.npmjs.org/@aws/chat-client-ui-types/-/chat-client-ui-types-0.1.47.tgz", + "integrity": "sha512-Pu6UnAImpweLMcAmhNdw/NrajB25Ymzp1Om1V9NEVQJRMO/KJCDiErmbOYTYBXvgNoR10kObqiL1P/Tk/Fpu3g==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws/language-server-runtimes-types": "^0.1.22" + "@aws/language-server-runtimes-types": "^0.1.41" } }, "node_modules/@aws/language-server-runtimes": { - "version": "0.2.97", - "resolved": "https://registry.npmjs.org/@aws/language-server-runtimes/-/language-server-runtimes-0.2.97.tgz", - "integrity": "sha512-Wzt09iC5YTVRJmmW6DwunBFSR0mV+cHjDwJ5iic1sEvXlI9CnrxlEjfn09crkVQ2XZj3dNJHoLQPptH+AEQfNg==", + "version": "0.2.119", + "resolved": "https://registry.npmjs.org/@aws/language-server-runtimes/-/language-server-runtimes-0.2.119.tgz", + "integrity": "sha512-zHonaOBuZ9K81/EQ1hg6ieu45YK7J5M6kiFD/dpdwJwsU36Ia4rbnN2W5ZIDPryZ9Hx9WYpw72YBl+q8+6BdGQ==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "@aws/language-server-runtimes-types": "^0.1.39", + "@aws/language-server-runtimes-types": "^0.1.51", "@opentelemetry/api": "^1.9.0", "@opentelemetry/api-logs": "^0.200.0", "@opentelemetry/core": "^2.0.0", @@ -10945,10 +15077,11 @@ } }, "node_modules/@aws/language-server-runtimes-types": { - "version": "0.1.39", - "resolved": "https://registry.npmjs.org/@aws/language-server-runtimes-types/-/language-server-runtimes-types-0.1.39.tgz", - "integrity": "sha512-HjZ9tYcs++vcSyNwCcGLC8k1nvdWTD7XRa6sI71OYwFzJvyMa4/BY7Womq/kmyuD/IB6MRVvuRdgYQxuU1mSGA==", + "version": "0.1.51", + "resolved": "https://registry.npmjs.org/@aws/language-server-runtimes-types/-/language-server-runtimes-types-0.1.51.tgz", + "integrity": "sha512-TuCA821MSRCpO/1thhHaBRpKzU/CiHM/Bvd6quJRUKwvSb8/gTG1mSBp2YoHYx4p7FUZYBko2DKDmpaB1WfvUw==", "dev": true, + "license": "Apache-2.0", "dependencies": { "vscode-languageserver-textdocument": "^1.0.12", "vscode-languageserver-types": "^3.17.5" @@ -11989,35 +16122,30 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", - "dev": true, "license": "BSD-3-Clause" }, "node_modules/@protobufjs/base64": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", - "dev": true, "license": "BSD-3-Clause" }, "node_modules/@protobufjs/codegen": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", - "dev": true, "license": "BSD-3-Clause" }, "node_modules/@protobufjs/eventemitter": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", - "dev": true, "license": "BSD-3-Clause" }, "node_modules/@protobufjs/fetch": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.1", @@ -12028,35 +16156,30 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", - "dev": true, "license": "BSD-3-Clause" }, "node_modules/@protobufjs/inquire": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", - "dev": true, "license": "BSD-3-Clause" }, "node_modules/@protobufjs/path": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", - "dev": true, "license": "BSD-3-Clause" }, "node_modules/@protobufjs/pool": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", - "dev": true, "license": "BSD-3-Clause" }, "node_modules/@protobufjs/utf8": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", - "dev": true, "license": "BSD-3-Clause" }, "node_modules/@sindresorhus/is": { @@ -13105,6 +17228,25 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/@svgdotjs/svg.js": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@svgdotjs/svg.js/-/svg.js-3.2.4.tgz", + "integrity": "sha512-BjJ/7vWNowlX3Z8O4ywT58DqbNRyYlkk6Yz/D13aB7hGmfQTvGX4Tkgtm/ApYlu9M7lCQi15xUEidqMUmdMYwg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Fuzzyma" + } + }, + "node_modules/@swc/helpers": { + "version": "0.5.17", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.17.tgz", + "integrity": "sha512-5IKx/Y13RsYd+sauPb2x+U/xZikHjolzfuDgTAl/Tdf3Q8rslRvC19NKDLgAJQ6wsqADk10ntlv08nPFw/gO/A==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.8.0" + } + }, "node_modules/@szmarczak/http-timer": { "version": "4.0.6", "license": "MIT", @@ -13347,6 +17489,13 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/jaro-winkler": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@types/jaro-winkler/-/jaro-winkler-0.2.4.tgz", + "integrity": "sha512-TNVu6vL0Z3h+hYcW78IRloINA0y0MTVJ1PFVtVpBSgk+ejmaH5aVfcVghzNXZ0fa6gXe4zapNMQtMGWOJKTLig==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/js-yaml": { "version": "4.0.5", "dev": true, @@ -13553,6 +17702,13 @@ "@types/node": "*" } }, + "node_modules/@types/svgdom": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@types/svgdom/-/svgdom-0.1.2.tgz", + "integrity": "sha512-ZFwX8cDhbz6jiv3JZdMVYq8SSWHOUchChPmRoMwdIu3lz89aCu/gVK9TdR1eeb0ARQ8+5rtjUKrk1UR8hh0dhQ==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/tcp-port-used": { "version": "1.0.1", "dev": true, @@ -15232,6 +19388,15 @@ "version": "1.1.0", "license": "MIT" }, + "node_modules/brotli": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/brotli/-/brotli-1.3.3.tgz", + "integrity": "sha512-oTKjJdShmDuGW94SyyaoQvAjf30dZaHnjJ8uAF+u2/vGJkJbJPJAT1gDiOJP5v1Zb6f9KEyW/1HpuaWIXtGHPg==", + "license": "MIT", + "dependencies": { + "base64-js": "^1.1.2" + } + }, "node_modules/browser-stdout": { "version": "1.3.1", "dev": true, @@ -16563,6 +20728,12 @@ "dev": true, "license": "MIT" }, + "node_modules/dfa": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/dfa/-/dfa-1.2.0.tgz", + "integrity": "sha512-ED3jP8saaweFTjeGX8HQPjeC1YYyZs98jGNZx6IiBvxW7JG5v492kamAQB3m2wop07CvU/RQmzcKr6bgcC5D/Q==", + "license": "MIT" + }, "node_modules/diff": { "version": "5.1.0", "license": "BSD-3-Clause", @@ -17634,7 +21805,6 @@ }, "node_modules/fast-deep-equal": { "version": "3.1.3", - "dev": true, "license": "MIT" }, "node_modules/fast-diff": { @@ -17897,6 +22067,23 @@ } } }, + "node_modules/fontkit": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/fontkit/-/fontkit-2.0.4.tgz", + "integrity": "sha512-syetQadaUEDNdxdugga9CpEYVaQIxOwk7GlwZWWZ19//qW4zE5bknOKeMBDYAASwnpaSHKJITRLMF9m1fp3s6g==", + "license": "MIT", + "dependencies": { + "@swc/helpers": "^0.5.12", + "brotli": "^1.3.2", + "clone": "^2.1.2", + "dfa": "^1.2.0", + "fast-deep-equal": "^3.1.3", + "restructure": "^3.0.0", + "tiny-inflate": "^1.0.3", + "unicode-properties": "^1.4.0", + "unicode-trie": "^2.0.0" + } + }, "node_modules/for-each": { "version": "0.3.3", "license": "MIT", @@ -18788,6 +22975,21 @@ "node": ">= 4" } }, + "node_modules/image-size": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-1.2.1.tgz", + "integrity": "sha512-rH+46sQJ2dlwfjfhCyNx5thzrv+dtmBIhPHk0zgRUukHzZ/kRueTJXoYYsclBaKcSMBWuGbOFXtioLpzTb5euw==", + "license": "MIT", + "dependencies": { + "queue": "6.0.2" + }, + "bin": { + "image-size": "bin/image-size.js" + }, + "engines": { + "node": ">=16.x" + } + }, "node_modules/immediate": { "version": "3.0.6", "dev": true, @@ -19363,6 +23565,12 @@ "@pkgjs/parseargs": "^0.11.0" } }, + "node_modules/jaro-winkler": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/jaro-winkler/-/jaro-winkler-0.2.8.tgz", + "integrity": "sha512-yr+mElb6dWxA1mzFu0+26njV5DWAQRNTi5pB6fFMm79zHrfAs3d0qjhe/IpZI4AHIUJkzvu5QXQRWOw2O0GQyw==", + "license": "MIT" + }, "node_modules/jest-worker": { "version": "27.5.1", "dev": true, @@ -20033,10 +24241,9 @@ "license": "MIT" }, "node_modules/long": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", - "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", - "dev": true, + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/long/-/long-5.3.1.tgz", + "integrity": "sha512-ka87Jz3gcx/I7Hal94xaN2tZEOPoUOEVftkQqZx2EeQRN7LGdfLlI3FvZ+7WDplm+vK2Urx9ULrvSowtdCieng==", "license": "Apache-2.0" }, "node_modules/lowercase-keys": { @@ -21807,10 +26014,9 @@ "license": "MIT" }, "node_modules/protobufjs": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.1.tgz", - "integrity": "sha512-3qx3IRjR9WPQKagdwrKjO3Gu8RgQR2qqw+1KnigWhoVjFqegIj1K3bP11sGqhxrO46/XL7lekuG4jmjL+4cLsw==", - "dev": true, + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.4.0.tgz", + "integrity": "sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw==", "hasInstallScript": true, "license": "BSD-3-Clause", "dependencies": { @@ -21931,6 +26137,15 @@ "dev": true, "license": "MIT" }, + "node_modules/queue": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/queue/-/queue-6.0.2.tgz", + "integrity": "sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==", + "license": "MIT", + "dependencies": { + "inherits": "~2.0.3" + } + }, "node_modules/queue-microtask": { "version": "1.2.3", "dev": true, @@ -22573,6 +26788,12 @@ "lowercase-keys": "^2.0.0" } }, + "node_modules/restructure": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/restructure/-/restructure-3.0.2.tgz", + "integrity": "sha512-gSfoiOEA0VPE6Tukkrr7I0RBdE0s7H1eFCDBk05l1KIQT1UIKNc5JZy6jdyW6eYH3aR3g5b3PuL77rq0hvwtAw==", + "license": "MIT" + }, "node_modules/retry": { "version": "0.13.1", "dev": true, @@ -23549,6 +27770,27 @@ "svg2ttf": "svg2ttf.js" } }, + "node_modules/svgdom": { + "version": "0.1.21", + "resolved": "https://registry.npmjs.org/svgdom/-/svgdom-0.1.21.tgz", + "integrity": "sha512-PrMx2aEzjRgyK9nbff6/NOzNmGcRnkjwO9p3JnHISmqPTMGtBPi4uFp59fVhI9PqRp8rVEWgmXFbkgYRsTnapg==", + "license": "MIT", + "dependencies": { + "fontkit": "^2.0.4", + "image-size": "^1.2.1", + "sax": "^1.4.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Fuzzyma" + } + }, + "node_modules/svgdom/node_modules/sax": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", + "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==", + "license": "ISC" + }, "node_modules/svgicons2svgfont": { "version": "10.0.6", "dev": true, @@ -23867,6 +28109,12 @@ "next-tick": "1" } }, + "node_modules/tiny-inflate": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tiny-inflate/-/tiny-inflate-1.0.3.tgz", + "integrity": "sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==", + "license": "MIT" + }, "node_modules/tmp": { "version": "0.2.1", "dev": true, @@ -24013,7 +28261,9 @@ } }, "node_modules/tslib": { - "version": "2.6.2", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "license": "0BSD" }, "node_modules/tsscmp": { @@ -24222,6 +28472,32 @@ "version": "1.1.0", "license": "MIT" }, + "node_modules/unicode-properties": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/unicode-properties/-/unicode-properties-1.4.1.tgz", + "integrity": "sha512-CLjCCLQ6UuMxWnbIylkisbRj31qxHPAurvena/0iwSVbQ2G1VY5/HjV0IRabOEbDHlzZlRdCrD4NhB0JtU40Pg==", + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.0", + "unicode-trie": "^2.0.0" + } + }, + "node_modules/unicode-trie": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-trie/-/unicode-trie-2.0.0.tgz", + "integrity": "sha512-x7bc76x0bm4prf1VLg79uhAzKw8DVboClSN5VxJuQ+LKDOVEW9CdH+VY7SP+vX7xCYQqzzgQpFqz15zeLvAtZQ==", + "license": "MIT", + "dependencies": { + "pako": "^0.2.5", + "tiny-inflate": "^1.0.0" + } + }, + "node_modules/unicode-trie/node_modules/pako": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "integrity": "sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA==", + "license": "MIT" + }, "node_modules/universalify": { "version": "2.0.1", "dev": true, @@ -25341,7 +29617,6 @@ }, "node_modules/ws": { "version": "8.17.1", - "dev": true, "license": "MIT", "engines": { "node": ">=10.0.0" @@ -25679,7 +29954,7 @@ }, "packages/amazonq": { "name": "amazon-q-vscode", - "version": "1.79.0-SNAPSHOT", + "version": "1.89.0-SNAPSHOT", "license": "Apache-2.0", "dependencies": { "aws-core-vscode": "file:../core/" @@ -25697,6 +29972,7 @@ "dependencies": { "@amzn/amazon-q-developer-streaming-client": "file:../../src.gen/@amzn/amazon-q-developer-streaming-client", "@amzn/codewhisperer-streaming": "file:../../src.gen/@amzn/codewhisperer-streaming", + "@amzn/sagemaker-client": "file:../../src.gen/@amzn/sagemaker-client/1.0.0.tgz", "@aws-sdk/client-api-gateway": "<3.731.0", "@aws-sdk/client-apprunner": "<3.731.0", "@aws-sdk/client-cloudcontrol": "<3.731.0", @@ -25710,12 +29986,15 @@ "@aws-sdk/client-iam": "<3.731.0", "@aws-sdk/client-lambda": "<3.731.0", "@aws-sdk/client-s3": "<3.731.0", + "@aws-sdk/client-sagemaker": "<3.696.0", + "@aws-sdk/client-sfn": "<3.731.0", "@aws-sdk/client-ssm": "<3.731.0", "@aws-sdk/client-sso": "<3.731.0", "@aws-sdk/client-sso-oidc": "<3.731.0", "@aws-sdk/credential-provider-env": "<3.731.0", "@aws-sdk/credential-provider-process": "<3.731.0", "@aws-sdk/credential-provider-sso": "<3.731.0", + "@aws-sdk/credential-providers": "<3.731.0", "@aws-sdk/lib-storage": "<3.731.0", "@aws-sdk/property-provider": "<3.731.0", "@aws-sdk/protocol-http": "<3.731.0", @@ -25732,6 +30011,7 @@ "@smithy/service-error-classification": "^4.0.1", "@smithy/shared-ini-file-loader": "^4.0.0", "@smithy/util-retry": "^4.0.1", + "@svgdotjs/svg.js": "^3.0.16", "@vscode/debugprotocol": "^1.57.0", "@zip.js/zip.js": "^2.7.41", "adm-zip": "^0.5.10", @@ -25750,6 +30030,7 @@ "http2": "^3.3.6", "i18n-ts": "^1.0.5", "immutable": "^4.3.0", + "jaro-winkler": "^0.2.8", "jose": "5.4.1", "js-yaml": "^4.1.0", "jsonc-parser": "^3.2.0", @@ -25759,9 +30040,11 @@ "mime-types": "^2.1.32", "node-fetch": "^2.7.0", "portfinder": "^1.0.32", + "protobufjs": "^7.2.6", "semver": "^7.5.4", "stream-buffers": "^3.0.2", "strip-ansi": "^5.2.0", + "svgdom": "^0.1.0", "tcp-port-used": "^1.0.1", "vscode-languageclient": "^6.1.4", "vscode-languageserver": "^6.1.1", @@ -25772,15 +30055,16 @@ "whatwg-url": "^14.0.0", "winston": "^3.11.0", "winston-transport": "^4.6.0", + "ws": "^8.16.0", "xml2js": "^0.6.1", "yaml-cfn": "^0.3.2" }, "devDependencies": { "@aws-sdk/types": "^3.13.1", "@aws/chat-client": "^0.1.4", - "@aws/chat-client-ui-types": "^0.1.24", - "@aws/language-server-runtimes": "^0.2.97", - "@aws/language-server-runtimes-types": "^0.1.39", + "@aws/chat-client-ui-types": "^0.1.47", + "@aws/language-server-runtimes": "^0.2.119", + "@aws/language-server-runtimes-types": "^0.1.47", "@cspotcode/source-map-support": "^0.8.1", "@sinonjs/fake-timers": "^10.0.2", "@types/adm-zip": "^0.4.34", @@ -25806,6 +30090,7 @@ "@types/sinon": "^10.0.5", "@types/sinonjs__fake-timers": "^8.1.2", "@types/stream-buffers": "^3.0.7", + "@types/svgdom": "^0.1.2", "@types/tcp-port-used": "^1.0.1", "@types/uuid": "^9.0.1", "@types/whatwg-url": "^11.0.4", @@ -27393,7 +31678,7 @@ }, "packages/toolkit": { "name": "aws-toolkit-vscode", - "version": "3.67.0-SNAPSHOT", + "version": "3.72.0-SNAPSHOT", "license": "Apache-2.0", "dependencies": { "aws-core-vscode": "file:../core/" @@ -29052,10 +33337,6 @@ "tree-kill": "cli.js" } }, - "src.gen/@amzn/amazon-q-developer-streaming-client/node_modules/tslib": { - "version": "2.8.1", - "license": "0BSD" - }, "src.gen/@amzn/amazon-q-developer-streaming-client/node_modules/typescript": { "version": "5.2.2", "dev": true, @@ -30606,10 +34887,6 @@ "tree-kill": "cli.js" } }, - "src.gen/@amzn/codewhisperer-streaming/node_modules/tslib": { - "version": "2.8.1", - "license": "0BSD" - }, "src.gen/@amzn/codewhisperer-streaming/node_modules/typescript": { "version": "5.2.2", "dev": true, diff --git a/package.json b/package.json index 5134b42aaa3..b84e4b8c361 100644 --- a/package.json +++ b/package.json @@ -41,10 +41,11 @@ "skippedTestReport": "ts-node ./scripts/skippedTestReport.ts ./packages/amazonq/test/e2e/" }, "devDependencies": { - "@aws-toolkits/telemetry": "^1.0.324", + "@aws-toolkits/telemetry": "^1.0.329", "@playwright/browser-chromium": "^1.43.1", "@stylistic/eslint-plugin": "^2.11.0", "@types/he": "^1.2.3", + "@types/jaro-winkler": "^0.2.4", "@types/vscode": "^1.68.0", "@types/vscode-webview": "^1.57.1", "@types/webpack-env": "^1.18.5", @@ -74,6 +75,7 @@ }, "dependencies": { "@types/node": "^22.7.5", + "jaro-winkler": "^0.2.8", "vscode-nls": "^5.2.0", "vscode-nls-dev": "^4.0.4" } diff --git a/packages/amazonq/.changes/1.79.0.json b/packages/amazonq/.changes/1.79.0.json new file mode 100644 index 00000000000..51d910cca2b --- /dev/null +++ b/packages/amazonq/.changes/1.79.0.json @@ -0,0 +1,18 @@ +{ + "date": "2025-06-25", + "version": "1.79.0", + "entries": [ + { + "type": "Bug Fix", + "description": "Added automatic system certificate detection and VSCode proxy settings support" + }, + { + "type": "Bug Fix", + "description": "Improved Amazon Linux 2 support with better SageMaker environment detection" + }, + { + "type": "Feature", + "description": "/transform: run all builds client-side" + } + ] +} \ No newline at end of file diff --git a/packages/amazonq/.changes/1.80.0.json b/packages/amazonq/.changes/1.80.0.json new file mode 100644 index 00000000000..20e948b69f2 --- /dev/null +++ b/packages/amazonq/.changes/1.80.0.json @@ -0,0 +1,5 @@ +{ + "date": "2025-07-01", + "version": "1.80.0", + "entries": [] +} \ No newline at end of file diff --git a/packages/amazonq/.changes/1.81.0.json b/packages/amazonq/.changes/1.81.0.json new file mode 100644 index 00000000000..b93c5693ad4 --- /dev/null +++ b/packages/amazonq/.changes/1.81.0.json @@ -0,0 +1,10 @@ +{ + "date": "2025-07-02", + "version": "1.81.0", + "entries": [ + { + "type": "Bug Fix", + "description": "Stop auto inline completion when deleting code" + } + ] +} \ No newline at end of file diff --git a/packages/amazonq/.changes/1.82.0.json b/packages/amazonq/.changes/1.82.0.json new file mode 100644 index 00000000000..816da045f4a --- /dev/null +++ b/packages/amazonq/.changes/1.82.0.json @@ -0,0 +1,10 @@ +{ + "date": "2025-07-07", + "version": "1.82.0", + "entries": [ + { + "type": "Bug Fix", + "description": "Prompt re-authenticate if auto trigger failed with expired token" + } + ] +} \ No newline at end of file diff --git a/packages/amazonq/.changes/1.83.0.json b/packages/amazonq/.changes/1.83.0.json new file mode 100644 index 00000000000..5997b2b1b95 --- /dev/null +++ b/packages/amazonq/.changes/1.83.0.json @@ -0,0 +1,18 @@ +{ + "date": "2025-07-09", + "version": "1.83.0", + "entries": [ + { + "type": "Feature", + "description": "Amazon Q /test, /doc, and /dev capabilities integrated into Agentic coding." + }, + { + "type": "Feature", + "description": "Added image support to Amazon Q chat, users can now upload images from their local file system" + }, + { + "type": "Removal", + "description": "Deprecate \"amazon q is generating...\" UI for inline suggestion" + } + ] +} \ No newline at end of file diff --git a/packages/amazonq/.changes/1.84.0.json b/packages/amazonq/.changes/1.84.0.json new file mode 100644 index 00000000000..e73a685e054 --- /dev/null +++ b/packages/amazonq/.changes/1.84.0.json @@ -0,0 +1,18 @@ +{ + "date": "2025-07-17", + "version": "1.84.0", + "entries": [ + { + "type": "Bug Fix", + "description": "Slightly delay rendering inline completion when user is typing" + }, + { + "type": "Bug Fix", + "description": "Render first response before receiving all paginated inline completion results" + }, + { + "type": "Feature", + "description": "Explain and Fix for any issue in Code Issues panel will pull the experience into chat. Also no more view details tab." + } + ] +} \ No newline at end of file diff --git a/packages/amazonq/.changes/1.85.0.json b/packages/amazonq/.changes/1.85.0.json new file mode 100644 index 00000000000..b0aba38025b --- /dev/null +++ b/packages/amazonq/.changes/1.85.0.json @@ -0,0 +1,5 @@ +{ + "date": "2025-07-19", + "version": "1.85.0", + "entries": [] +} \ No newline at end of file diff --git a/packages/amazonq/.changes/1.86.0.json b/packages/amazonq/.changes/1.86.0.json new file mode 100644 index 00000000000..abe84ce5b5f --- /dev/null +++ b/packages/amazonq/.changes/1.86.0.json @@ -0,0 +1,18 @@ +{ + "date": "2025-07-30", + "version": "1.86.0", + "entries": [ + { + "type": "Bug Fix", + "description": "Let Enter invoke auto completion more consistently" + }, + { + "type": "Bug Fix", + "description": "Faster and more responsive inline completion UX" + }, + { + "type": "Bug Fix", + "description": "Use documentChangeEvent as auto trigger condition" + } + ] +} \ No newline at end of file diff --git a/packages/amazonq/.changes/1.87.0.json b/packages/amazonq/.changes/1.87.0.json new file mode 100644 index 00000000000..d80e11a2bfa --- /dev/null +++ b/packages/amazonq/.changes/1.87.0.json @@ -0,0 +1,5 @@ +{ + "date": "2025-07-31", + "version": "1.87.0", + "entries": [] +} \ No newline at end of file diff --git a/packages/amazonq/.changes/1.88.0.json b/packages/amazonq/.changes/1.88.0.json new file mode 100644 index 00000000000..05e006954d8 --- /dev/null +++ b/packages/amazonq/.changes/1.88.0.json @@ -0,0 +1,14 @@ +{ + "date": "2025-08-06", + "version": "1.88.0", + "entries": [ + { + "type": "Feature", + "description": "Amazon Q Chat provides error explanations and fixes when hovering or right-clicking on error indicators and messages" + }, + { + "type": "Feature", + "description": "/transform: Show transformation history in Transformation Hub and allow users to resume jobs" + } + ] +} \ No newline at end of file diff --git a/packages/amazonq/CHANGELOG.md b/packages/amazonq/CHANGELOG.md index c3e17d8a77b..806a99a319e 100644 --- a/packages/amazonq/CHANGELOG.md +++ b/packages/amazonq/CHANGELOG.md @@ -1,3 +1,52 @@ +## 1.88.0 2025-08-06 + +- **Feature** Amazon Q Chat provides error explanations and fixes when hovering or right-clicking on error indicators and messages +- **Feature** /transform: Show transformation history in Transformation Hub and allow users to resume jobs + +## 1.87.0 2025-07-31 + +- Miscellaneous non-user-facing changes + +## 1.86.0 2025-07-30 + +- **Bug Fix** Let Enter invoke auto completion more consistently +- **Bug Fix** Faster and more responsive inline completion UX +- **Bug Fix** Use documentChangeEvent as auto trigger condition + +## 1.85.0 2025-07-19 + +- Miscellaneous non-user-facing changes + +## 1.84.0 2025-07-17 + +- **Bug Fix** Slightly delay rendering inline completion when user is typing +- **Bug Fix** Render first response before receiving all paginated inline completion results +- **Feature** Explain and Fix for any issue in Code Issues panel will pull the experience into chat. Also no more view details tab. + +## 1.83.0 2025-07-09 + +- **Feature** Amazon Q /test, /doc, and /dev capabilities integrated into Agentic coding. +- **Feature** Added image support to Amazon Q chat, users can now upload images from their local file system +- **Removal** Deprecate "amazon q is generating..." UI for inline suggestion + +## 1.82.0 2025-07-07 + +- **Bug Fix** Prompt re-authenticate if auto trigger failed with expired token + +## 1.81.0 2025-07-02 + +- **Bug Fix** Stop auto inline completion when deleting code + +## 1.80.0 2025-07-01 + +- Miscellaneous non-user-facing changes + +## 1.79.0 2025-06-25 + +- **Bug Fix** Added automatic system certificate detection and VSCode proxy settings support +- **Bug Fix** Improved Amazon Linux 2 support with better SageMaker environment detection +- **Feature** /transform: run all builds client-side + ## 1.78.0 2025-06-20 - **Bug Fix** Resolve missing chat options in Amazon Q chat interface. diff --git a/packages/amazonq/README.md b/packages/amazonq/README.md index 46091a98d10..e3ec16bb2ac 100644 --- a/packages/amazonq/README.md +++ b/packages/amazonq/README.md @@ -3,39 +3,33 @@ [![Youtube Channel Views](https://img.shields.io/youtube/channel/views/UCd6MoB9NC6uYN2grvUNT-Zg?style=flat-square&logo=youtube&label=Youtube)](https://www.youtube.com/@amazonwebservices) ![Marketplace Installs](https://img.shields.io/vscode-marketplace/i/AmazonWebServices.amazon-q-vscode.svg?label=Installs&style=flat-square) -# Agent capabilities +# Agentic coding experience + +Amazon Q Developer uses information across native and MCP server-based tools to intelligently perform actions beyond code suggestions, such as reading files, generating code diffs, and running commands based on your natural language instruction. Simply type your prompt in your preferred language and Q Developer will provide continuous status updates and iteratively apply changes based on your feedback, helping you accomplish tasks faster. ### Implement new features -`/dev` to task Amazon Q with generating new code across your entire project and implement features. +Generate new code across your entire project and implement features. ### Generate documentation -`/doc` to task Amazon Q with writing API, technical design, and onboarding documentation. +Write API, technical design, and onboarding documentation. ### Automate code reviews -`/review` to ask Amazon Q to perform code reviews, flagging suspicious code patterns and assessing deployment risk. +Perform code reviews, flagging suspicious code patterns and assessing deployment risk. ### Generate unit tests -`/test` to ask Amazon Q to generate unit tests and add them to your project, helping you improve code quality, fast. - -### Transform workloads - -`/transform` to upgrade your Java applications in minutes, not weeks. +Generate unit tests and add them to your project, helping you improve code quality, fast.
# Core features -### Inline chat - -Seamlessly initiate chat within the inline coding experience. Select a section of code that you need assistance with and initiate chat within the editor to request actions such as "Optimize this code", "Add comments", or "Write tests". - -### Chat +### MCP support -Generate code, explain code, and get answers about software development. +Add Model Context Protocol (MCP) servers to give Amazon Q Developer access to important context. ### Inline suggestions @@ -43,9 +37,13 @@ Receive real-time code suggestions ranging from snippets to full functions based [_15+ languages supported including Python, TypeScript, Rust, Terraform, AWS Cloudformation, and more_](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/q-language-ide-support.html) -### Code reference log +### Inline chat + +Seamlessly chat within the inline coding experience. Select a section of code that you need assistance with and initiate chat within the editor to request actions such as "Optimize this code", "Add comments", or "Write tests". -Attribute code from Amazon Q that is similar to training data. When code suggestions similar to training data are accepted, they will be added to the code reference log. +### Chat + +Generate code, explain code, and get answers about software development.
@@ -55,8 +53,6 @@ Attribute code from Amazon Q that is similar to training data. When code suggest **Pro Tier** - if your organization is on the Amazon Q Developer Pro tier, log in with single sign-on. -![Authentication gif](https://raw.githubusercontent.com/aws/aws-toolkit-vscode/HEAD/docs/marketplace/vscode/amazonq/auth-Q.gif) - # Troubleshooting & feedback [File a bug](https://github.com/aws/aws-toolkit-vscode/issues/new?assignees=&labels=bug&projects=&template=bug_report.md) or [submit a feature request](https://github.com/aws/aws-toolkit-vscode/issues/new?assignees=&labels=feature-request&projects=&template=feature_request.md) on our Github repository. diff --git a/packages/amazonq/package.json b/packages/amazonq/package.json index f52c8c1beb0..428b641263e 100644 --- a/packages/amazonq/package.json +++ b/packages/amazonq/package.json @@ -1,8 +1,8 @@ { "name": "amazon-q-vscode", "displayName": "Amazon Q", - "description": "The most capable generative AI-powered assistant for building, operating, and transforming software, with advanced capabilities for managing data and AI", - "version": "1.79.0-SNAPSHOT", + "description": "The most capable generative AI–powered assistant for software development.", + "version": "1.89.0-SNAPSHOT", "extensionKind": [ "workspace" ], @@ -408,6 +408,11 @@ "when": "(view == aws.amazonq.AmazonQChatView) && aws.codewhisperer.connected && !aws.isSageMakerUnifiedStudio", "group": "2_amazonQ@4" }, + { + "command": "aws.amazonq.showLogs", + "when": "!aws.isSageMakerUnifiedStudio", + "group": "1_amazonQ@5" + }, { "command": "aws.amazonq.reconnect", "when": "(view == aws.amazonq.AmazonQChatView) && aws.codewhisperer.connectionExpired", @@ -442,17 +447,22 @@ }, { "command": "aws.amazonq.openSecurityIssuePanel", + "when": "false && view == aws.amazonq.SecurityIssuesTree && (viewItem == issueWithoutFix || viewItem == issueWithFix || viewItem == issueWithFixDisabled)", + "group": "inline@4" + }, + { + "command": "aws.amazonq.security.explain", "when": "view == aws.amazonq.SecurityIssuesTree && (viewItem == issueWithoutFix || viewItem == issueWithFix || viewItem == issueWithFixDisabled)", "group": "inline@4" }, { - "command": "aws.amazonq.security.ignore", + "command": "aws.amazonq.security.generateFix", "when": "view == aws.amazonq.SecurityIssuesTree && (viewItem == issueWithoutFix || viewItem == issueWithFix || viewItem == issueWithFixDisabled)", "group": "inline@5" }, { - "command": "aws.amazonq.security.generateFix", - "when": "view == aws.amazonq.SecurityIssuesTree && viewItem == issueWithoutFix", + "command": "aws.amazonq.security.ignore", + "when": "view == aws.amazonq.SecurityIssuesTree && (viewItem == issueWithoutFix || viewItem == issueWithFix || viewItem == issueWithFixDisabled)", "group": "inline@6" }, { @@ -514,37 +524,33 @@ "command": "aws.amazonq.walkthrough.show", "group": "1_help@1" }, - { - "command": "aws.amazonq.exploreAgents", - "when": "!aws.isSageMaker", - "group": "1_help@2" - }, { "command": "aws.amazonq.github", - "group": "1_help@3" + "group": "1_help@2" }, { "command": "aws.amazonq.aboutExtension", - "group": "1_help@4" + "group": "1_help@3" }, { "command": "aws.amazonq.viewLogs", - "group": "1_help@5" + "group": "1_help@4" } ], "aws.amazonq.submenu.securityIssueMoreActions": [ { "command": "aws.amazonq.security.explain", + "when": "false", "group": "1_more@1" }, { "command": "aws.amazonq.applySecurityFix", - "when": "view == aws.amazonq.SecurityIssuesTree && viewItem == issueWithFix", + "when": "false && view == aws.amazonq.SecurityIssuesTree && viewItem == issueWithFix", "group": "1_more@3" }, { "command": "aws.amazonq.security.regenerateFix", - "when": "view == aws.amazonq.SecurityIssuesTree && viewItem == issueWithFix", + "when": "false && view == aws.amazonq.SecurityIssuesTree && viewItem == issueWithFix", "group": "1_more@4" }, { @@ -554,6 +560,21 @@ ] }, "commands": [ + { + "command": "aws.amazonq.stopCmdExecution", + "title": "Stop Amazon Q", + "category": "%AWS.amazonq.title%" + }, + { + "command": "aws.amazonq.runCmdExecution", + "title": "Run Amazon Q Tool", + "category": "%AWS.amazonq.title%" + }, + { + "command": "aws.amazonq.rejectCmdExecution", + "title": "Reject Amazon Q Tool", + "category": "%AWS.amazonq.title%" + }, { "command": "_aws.amazonq.notifications.dismiss", "title": "%AWS.generic.dismiss%", @@ -615,6 +636,11 @@ "category": "%AWS.amazonq.title%", "enablement": "aws.codewhisperer.connected" }, + { + "command": "aws.amazonq.showLogs", + "title": "%AWS.command.codewhisperer.showLogs%", + "category": "%AWS.amazonq.title%" + }, { "command": "aws.amazonq.selectRegionProfile", "title": "Change Profile", @@ -720,7 +746,7 @@ }, { "command": "aws.amazonq.showHistoryInHub", - "title": "%AWS.command.q.transform.viewJobStatus%" + "title": "%AWS.command.q.transform.viewJobHistory%" }, { "command": "aws.amazonq.selectCustomization", @@ -778,6 +804,7 @@ { "command": "aws.amazonq.security.explain", "title": "%AWS.command.amazonq.explainIssue%", + "icon": "$(search)", "enablement": "view == aws.amazonq.SecurityIssuesTree" }, { @@ -814,12 +841,6 @@ "title": "%AWS.amazonq.openChat%", "category": "%AWS.amazonq.title%" }, - { - "command": "aws.amazonq.exploreAgents", - "title": "%AWS.amazonq.exploreAgents%", - "category": "%AWS.amazonq.title%", - "enablement": "aws.codewhisperer.connected && !aws.isSageMaker" - }, { "command": "aws.amazonq.walkthrough.show", "title": "%AWS.amazonq.welcomeWalkthrough%" @@ -828,15 +849,63 @@ "command": "aws.amazonq.clearCache", "title": "%AWS.amazonq.clearCache%", "category": "%AWS.amazonq.title%" + }, + { + "command": "aws.amazonq.inline.acceptEdit", + "title": "%AWS.amazonq.inline.acceptEdit%", + "category": "%AWS.amazonq.title%", + "enablement": "aws.codewhisperer.connected" + }, + { + "command": "aws.amazonq.inline.rejectEdit", + "title": "%AWS.amazonq.inline.rejectEdit%", + "category": "%AWS.amazonq.title%", + "enablement": "aws.codewhisperer.connected" + }, + { + "command": "aws.amazonq.toggleNextEditPredictionPanel", + "title": "%AWS.amazonq.toggleNextEditPredictionPanel%", + "category": "%AWS.amazonq.title%", + "enablement": "aws.codewhisperer.connected" } ], "keybindings": [ + { + "command": "aws.amazonq.stopCmdExecution", + "key": "ctrl+shift+backspace", + "mac": "cmd+shift+backspace", + "when": "aws.amazonq.amazonqChatLSP.isFocus" + }, + { + "command": "aws.amazonq.runCmdExecution", + "key": "ctrl+shift+enter", + "mac": "cmd+shift+enter", + "when": "aws.amazonq.amazonqChatLSP.isFocus" + }, + { + "command": "aws.amazonq.rejectCmdExecution", + "key": "ctrl+shift+r", + "mac": "cmd+shift+r", + "when": "aws.amazonq.amazonqChatLSP.isFocus" + }, { "command": "_aws.amazonq.focusChat.keybinding", "win": "win+alt+i", "mac": "cmd+alt+i", "linux": "meta+alt+i" }, + { + "command": "aws.amazonq.inline.debugAcceptEdit", + "key": "ctrl+alt+a", + "mac": "cmd+alt+a", + "when": "editorTextFocus" + }, + { + "command": "aws.amazonq.inline.debugRejectEdit", + "key": "ctrl+alt+r", + "mac": "cmd+alt+r", + "when": "editorTextFocus" + }, { "command": "aws.amazonq.explainCode", "win": "win+alt+e", @@ -893,12 +962,16 @@ }, { "key": "right", - "command": "editor.action.inlineSuggest.showNext", + "command": "aws.amazonq.showNext", "when": "inlineSuggestionVisible && !editorReadonly && aws.codewhisperer.connected" }, { "key": "left", - "command": "editor.action.inlineSuggest.showPrevious", + "command": "aws.amazonq.showPrev", + "when": "inlineSuggestionVisible && !editorReadonly && aws.codewhisperer.connected" + }, + { + "command": "aws.amazonq.checkInlineSuggestionVisibility", "when": "inlineSuggestionVisible && !editorReadonly && aws.codewhisperer.connected" }, { @@ -917,6 +990,16 @@ "command": "aws.amazonq.inline.waitForUserDecisionRejectAll", "key": "escape", "when": "editorTextFocus && aws.codewhisperer.connected && amazonq.inline.codelensShortcutEnabled" + }, + { + "command": "aws.amazonq.inline.acceptEdit", + "key": "tab", + "when": "editorTextFocus && aws.amazonq.editSuggestionActive" + }, + { + "command": "aws.amazonq.inline.rejectEdit", + "key": "escape", + "when": "editorTextFocus && aws.amazonq.editSuggestionActive" } ], "icons": { @@ -1193,110 +1276,138 @@ "fontCharacter": "\\f1d0" } }, - "aws-lambda-function": { + "aws-lambda-create-stack": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1d1" } }, - "aws-mynah-MynahIconBlack": { + "aws-lambda-create-stack-light": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1d2" } }, - "aws-mynah-MynahIconWhite": { + "aws-lambda-function": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1d3" } }, - "aws-mynah-logo": { + "aws-mynah-MynahIconBlack": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1d4" } }, - "aws-redshift-cluster": { + "aws-mynah-MynahIconWhite": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1d5" } }, - "aws-redshift-cluster-connected": { + "aws-mynah-logo": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1d6" } }, - "aws-redshift-database": { + "aws-redshift-cluster": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1d7" } }, - "aws-redshift-redshift-cluster-connected": { + "aws-redshift-cluster-connected": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1d8" } }, - "aws-redshift-schema": { + "aws-redshift-database": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1d9" } }, - "aws-redshift-table": { + "aws-redshift-redshift-cluster-connected": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1da" } }, - "aws-s3-bucket": { + "aws-redshift-schema": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1db" } }, - "aws-s3-create-bucket": { + "aws-redshift-table": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1dc" } }, - "aws-schemas-registry": { + "aws-s3-bucket": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1dd" } }, - "aws-schemas-schema": { + "aws-s3-create-bucket": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1de" } }, - "aws-stepfunctions-preview": { + "aws-sagemaker-code-editor": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1df" } + }, + "aws-sagemaker-jupyter-lab": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1e0" + } + }, + "aws-schemas-registry": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1e1" + } + }, + "aws-schemas-schema": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1e2" + } + }, + "aws-stepfunctions-preview": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1e3" + } } }, "walkthroughs": [ diff --git a/packages/amazonq/src/app/amazonqScan/app.ts b/packages/amazonq/src/app/amazonqScan/app.ts index 21857163bd2..2b237ab534e 100644 --- a/packages/amazonq/src/app/amazonqScan/app.ts +++ b/packages/amazonq/src/app/amazonqScan/app.ts @@ -19,6 +19,7 @@ import { Messenger } from './chat/controller/messenger/messenger' import { UIMessageListener } from './chat/views/actions/uiMessageListener' import { debounce } from 'lodash' import { Commands, placeholder } from 'aws-core-vscode/shared' +import { codeReviewInChat } from './models/constants' export function init(appContext: AmazonQAppInitContext) { const scanChatControllerEventEmitters: ScanChatControllerEventEmitters = { @@ -74,17 +75,19 @@ export function init(appContext: AmazonQAppInitContext) { return debouncedEvent() }) - Commands.register('aws.amazonq.security.scan-statusbar', async () => { - if (AuthUtil.instance.isConnectionExpired()) { - await AuthUtil.instance.notifyReauthenticate() - } - return focusAmazonQPanel.execute(placeholder, 'amazonq.security.scan').then(() => { - DefaultAmazonQAppInitContext.instance.getAppsToWebViewMessagePublisher().publish({ - sender: 'amazonqCore', - command: 'review', + if (!codeReviewInChat) { + Commands.register('aws.amazonq.security.scan-statusbar', async () => { + if (AuthUtil.instance.isConnectionExpired()) { + await AuthUtil.instance.notifyReauthenticate() + } + return focusAmazonQPanel.execute(placeholder, 'amazonq.security.scan').then(() => { + DefaultAmazonQAppInitContext.instance.getAppsToWebViewMessagePublisher().publish({ + sender: 'amazonqCore', + command: 'review', + }) }) }) - }) + } codeScanState.setChatControllers(scanChatControllerEventEmitters) onDemandFileScanState.setChatControllers(scanChatControllerEventEmitters) diff --git a/packages/amazonq/src/app/amazonqScan/models/constants.ts b/packages/amazonq/src/app/amazonqScan/models/constants.ts index 93e815884e1..4180b130b78 100644 --- a/packages/amazonq/src/app/amazonqScan/models/constants.ts +++ b/packages/amazonq/src/app/amazonqScan/models/constants.ts @@ -97,3 +97,5 @@ const getIconForStep = (targetStep: number, currentStep: number) => { ? checkIcons.done : checkIcons.wait } + +export const codeReviewInChat = true diff --git a/packages/amazonq/src/app/chat/node/activateAgents.ts b/packages/amazonq/src/app/chat/node/activateAgents.ts index 954f2892eda..cd0309d7f2d 100644 --- a/packages/amazonq/src/app/chat/node/activateAgents.ts +++ b/packages/amazonq/src/app/chat/node/activateAgents.ts @@ -11,9 +11,6 @@ export function activateAgents() { const appInitContext = DefaultAmazonQAppInitContext.instance amazonqNode.cwChatAppInit(appInitContext) - amazonqNode.featureDevChatAppInit(appInitContext) amazonqNode.gumbyChatAppInit(appInitContext) - amazonqNode.testChatAppInit(appInitContext) - amazonqNode.docChatAppInit(appInitContext) scanChatAppInit(appInitContext) } diff --git a/packages/amazonq/src/app/inline/EditRendering/diffUtils.ts b/packages/amazonq/src/app/inline/EditRendering/diffUtils.ts new file mode 100644 index 00000000000..7f9ca54b6aa --- /dev/null +++ b/packages/amazonq/src/app/inline/EditRendering/diffUtils.ts @@ -0,0 +1,93 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ +// TODO: deprecate this file in favor of core/shared/utils/diffUtils +import { applyPatch } from 'diff' + +export type LineDiff = + | { type: 'added'; content: string } + | { type: 'removed'; content: string } + | { type: 'modified'; before: string; after: string } + +/** + * Apply a unified diff to original code to generate modified code + * @param originalCode The original code as a string + * @param unifiedDiff The unified diff content + * @returns The modified code after applying the diff + */ +export function applyUnifiedDiff(docText: string, unifiedDiff: string): string { + try { + // First try the standard diff package + try { + const result = applyPatch(docText, unifiedDiff) + if (result !== false) { + return result + } + } catch (error) {} + + // Parse the unified diff to extract the changes + const diffLines = unifiedDiff.split('\n') + let result = docText + + // Find all hunks in the diff + const hunkStarts = diffLines + .map((line, index) => (line.startsWith('@@ ') ? index : -1)) + .filter((index) => index !== -1) + + // Process each hunk + for (const hunkStart of hunkStarts) { + // Parse the hunk header + const hunkHeader = diffLines[hunkStart] + const match = hunkHeader.match(/@@ -(\d+),(\d+) \+(\d+),(\d+) @@/) + + if (!match) { + continue + } + + const oldStart = parseInt(match[1]) + const oldLines = parseInt(match[2]) + + // Extract the content lines for this hunk + let i = hunkStart + 1 + const contentLines = [] + while (i < diffLines.length && !diffLines[i].startsWith('@@')) { + contentLines.push(diffLines[i]) + i++ + } + + // Build the old and new text + let oldText = '' + let newText = '' + + for (const line of contentLines) { + if (line.startsWith('-')) { + oldText += line.substring(1) + '\n' + } else if (line.startsWith('+')) { + newText += line.substring(1) + '\n' + } else if (line.startsWith(' ')) { + oldText += line.substring(1) + '\n' + newText += line.substring(1) + '\n' + } + } + + // Remove trailing newline if it was added + oldText = oldText.replace(/\n$/, '') + newText = newText.replace(/\n$/, '') + + // Find the text to replace in the document + const docLines = docText.split('\n') + const startLine = oldStart - 1 // Convert to 0-based + const endLine = startLine + oldLines + + // Extract the text that should be replaced + const textToReplace = docLines.slice(startLine, endLine).join('\n') + + // Replace the text + result = result.replace(textToReplace, newText) + } + return result + } catch (error) { + return docText // Return original text if all methods fail + } +} diff --git a/packages/amazonq/src/app/inline/EditRendering/displayImage.ts b/packages/amazonq/src/app/inline/EditRendering/displayImage.ts new file mode 100644 index 00000000000..6509d2d744e --- /dev/null +++ b/packages/amazonq/src/app/inline/EditRendering/displayImage.ts @@ -0,0 +1,459 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import { getContext, getLogger, setContext } from 'aws-core-vscode/shared' +import * as vscode from 'vscode' +import { applyPatch, diffLines } from 'diff' +import { LanguageClient } from 'vscode-languageclient' +import { CodeWhispererSession } from '../sessionManager' +import { LogInlineCompletionSessionResultsParams } from '@aws/language-server-runtimes/protocol' +import { InlineCompletionItemWithReferences } from '@aws/language-server-runtimes/protocol' +import path from 'path' +import { imageVerticalOffset } from './svgGenerator' +import { EditSuggestionState } from '../editSuggestionState' +import type { AmazonQInlineCompletionItemProvider } from '../completion' +import { vsCodeState } from 'aws-core-vscode/codewhisperer' + +export class EditDecorationManager { + private imageDecorationType: vscode.TextEditorDecorationType + private removedCodeDecorationType: vscode.TextEditorDecorationType + private currentImageDecoration: vscode.DecorationOptions | undefined + private currentRemovedCodeDecorations: vscode.DecorationOptions[] = [] + private acceptHandler: (() => void) | undefined + private rejectHandler: (() => void) | undefined + + constructor() { + this.registerCommandHandlers() + this.imageDecorationType = vscode.window.createTextEditorDecorationType({ + isWholeLine: true, + }) + + this.removedCodeDecorationType = vscode.window.createTextEditorDecorationType({ + backgroundColor: 'rgba(255, 0, 0, 0.2)', + }) + } + + private imageToDecoration(image: vscode.Uri, range: vscode.Range) { + return { + range, + renderOptions: { + after: { + contentIconPath: image, + verticalAlign: 'text-top', + width: '100%', + height: 'auto', + margin: '1px 0', + }, + }, + hoverMessage: new vscode.MarkdownString('Edit suggestion. Press [Tab] to accept or [Esc] to reject.'), + } + } + + /** + * Highlights code that will be removed using the provided highlight ranges + * @param editor The active text editor + * @param startLine The line where the edit starts + * @param highlightRanges Array of ranges specifying which parts to highlight + * @returns Array of decoration options + */ + private highlightRemovedLines( + editor: vscode.TextEditor, + startLine: number, + highlightRanges: Array<{ line: number; start: number; end: number }> + ): vscode.DecorationOptions[] { + const decorations: vscode.DecorationOptions[] = [] + + // Group ranges by line for more efficient processing + const rangesByLine = new Map>() + + // Process each range and adjust line numbers relative to document + for (const range of highlightRanges) { + const documentLine = startLine + range.line + + // Skip if line is out of bounds + if (documentLine >= editor.document.lineCount) { + continue + } + + // Add to ranges map, grouped by line + if (!rangesByLine.has(documentLine)) { + rangesByLine.set(documentLine, []) + } + rangesByLine.get(documentLine)!.push({ + start: range.start, + end: range.end, + }) + } + + // Process each line with ranges + for (const [lineNumber, ranges] of rangesByLine.entries()) { + const lineLength = editor.document.lineAt(lineNumber).text.length + + if (ranges.length === 0) { + continue + } + + // Check if we should highlight the entire line + if (ranges.length === 1 && ranges[0].start === 0 && ranges[0].end >= lineLength) { + // Highlight entire line + const range = new vscode.Range( + new vscode.Position(lineNumber, 0), + new vscode.Position(lineNumber, lineLength) + ) + decorations.push({ range }) + } else { + // Create individual decorations for each range on this line + for (const range of ranges) { + const end = Math.min(range.end, lineLength) + if (range.start < end) { + const vsRange = new vscode.Range( + new vscode.Position(lineNumber, range.start), + new vscode.Position(lineNumber, end) + ) + decorations.push({ range: vsRange }) + } + } + } + } + + return decorations + } + + /** + * Displays an edit suggestion as an SVG image in the editor and highlights removed code + */ + public async displayEditSuggestion( + editor: vscode.TextEditor, + svgImage: vscode.Uri, + startLine: number, + onAccept: () => Promise, + onReject: () => Promise, + originalCode: string, + newCode: string, + originalCodeHighlightRanges: Array<{ line: number; start: number; end: number }> + ): Promise { + await this.clearDecorations(editor) + + await setContext('aws.amazonq.editSuggestionActive' as any, true) + EditSuggestionState.setEditSuggestionActive(true) + + this.acceptHandler = onAccept + this.rejectHandler = onReject + + // Get the line text to determine the end position + const lineText = editor.document.lineAt(Math.max(0, startLine - imageVerticalOffset)).text + const endPosition = new vscode.Position(Math.max(0, startLine - imageVerticalOffset), lineText.length) + const range = new vscode.Range(endPosition, endPosition) + + this.currentImageDecoration = this.imageToDecoration(svgImage, range) + + // Apply image decoration + editor.setDecorations(this.imageDecorationType, [this.currentImageDecoration]) + + // Highlight removed code with red background + this.currentRemovedCodeDecorations = this.highlightRemovedLines(editor, startLine, originalCodeHighlightRanges) + editor.setDecorations(this.removedCodeDecorationType, this.currentRemovedCodeDecorations) + } + + /** + * Clears all edit suggestion decorations + */ + public async clearDecorations(editor: vscode.TextEditor): Promise { + editor.setDecorations(this.imageDecorationType, []) + editor.setDecorations(this.removedCodeDecorationType, []) + this.currentImageDecoration = undefined + this.currentRemovedCodeDecorations = [] + this.acceptHandler = undefined + this.rejectHandler = undefined + await setContext('aws.amazonq.editSuggestionActive' as any, false) + EditSuggestionState.setEditSuggestionActive(false) + } + + /** + * Registers command handlers for accepting/rejecting suggestions + */ + public registerCommandHandlers(): void { + // Register Tab key handler for accepting suggestion + vscode.commands.registerCommand('aws.amazonq.inline.acceptEdit', () => { + if (this.acceptHandler) { + this.acceptHandler() + } + }) + + // Register Esc key handler for rejecting suggestion + vscode.commands.registerCommand('aws.amazonq.inline.rejectEdit', () => { + if (this.rejectHandler) { + this.rejectHandler() + } + }) + } + + /** + * Disposes resources + */ + public dispose(): void { + this.imageDecorationType.dispose() + this.removedCodeDecorationType.dispose() + } + + // Use process-wide singleton to prevent multiple instances on Windows + static readonly decorationManagerKey = Symbol.for('aws.amazonq.decorationManager') + + static getDecorationManager(): EditDecorationManager { + const globalObj = global as any + if (!globalObj[this.decorationManagerKey]) { + globalObj[this.decorationManagerKey] = new EditDecorationManager() + } + return globalObj[this.decorationManagerKey] + } +} + +export const decorationManager = EditDecorationManager.getDecorationManager() + +/** + * Function to replace editor's content with new code + */ +async function replaceEditorContent(editor: vscode.TextEditor, newCode: string): Promise { + const document = editor.document + const fullRange = new vscode.Range( + 0, + 0, + document.lineCount - 1, + document.lineAt(document.lineCount - 1).text.length + ) + + await editor.edit((editBuilder) => { + editBuilder.replace(fullRange, newCode) + }) +} + +/** + * Calculates the end position of the actual edited content by finding the last changed part + */ +function getEndOfEditPosition(originalCode: string, newCode: string): vscode.Position { + const changes = diffLines(originalCode, newCode) + let lineOffset = 0 + + // Track the end position of the last added chunk + let lastChangeEndLine = 0 + let lastChangeEndColumn = 0 + let foundAddedContent = false + + for (const part of changes) { + if (part.added) { + foundAddedContent = true + + // Calculate lines in this added part + const lines = part.value.split('\n') + const linesCount = lines.length + + // Update position to the end of this added chunk + lastChangeEndLine = lineOffset + linesCount - 1 + + // Get the length of the last line in this added chunk + lastChangeEndColumn = lines[linesCount - 1].length + } + + // Update line offset (skip removed parts) + if (!part.removed) { + const partLineCount = part.value.split('\n').length + lineOffset += partLineCount - 1 + } + } + + // If we found added content, return position at the end of the last addition + if (foundAddedContent) { + return new vscode.Position(lastChangeEndLine, lastChangeEndColumn) + } + + // Fallback to current cursor position if no changes were found + const editor = vscode.window.activeTextEditor + return editor ? editor.selection.active : new vscode.Position(0, 0) +} + +/** + * Helper function to create discard telemetry params + */ +function createDiscardTelemetryParams( + session: CodeWhispererSession, + item: InlineCompletionItemWithReferences +): LogInlineCompletionSessionResultsParams { + return { + sessionId: session.sessionId, + completionSessionResult: { + [item.itemId]: { + seen: false, + accepted: false, + discarded: true, + }, + }, + totalSessionDisplayTime: Date.now() - session.requestStartTime, + firstCompletionDisplayLatency: session.firstCompletionDisplayLatency, + isInlineEdit: true, + } +} + +/** + * Helper function to display SVG decorations + */ +export async function displaySvgDecoration( + editor: vscode.TextEditor, + svgImage: vscode.Uri, + startLine: number, + newCode: string, + originalCodeHighlightRanges: Array<{ line: number; start: number; end: number }>, + session: CodeWhispererSession, + languageClient: LanguageClient, + item: InlineCompletionItemWithReferences, + inlineCompletionProvider?: AmazonQInlineCompletionItemProvider +) { + const originalCode = editor.document.getText() + + // Check if a completion suggestion is currently active - if so, discard edit suggestion + if (inlineCompletionProvider && (await inlineCompletionProvider.isCompletionActive())) { + // Emit DISCARD telemetry for edit suggestion that can't be shown due to active completion + const params = createDiscardTelemetryParams(session, item) + languageClient.sendNotification('aws/logInlineCompletionSessionResults', params) + getLogger().info('Edit suggestion discarded due to active completion suggestion') + return + } + + const isPatchValid = applyPatch(editor.document.getText(), item.insertText as string) + if (!isPatchValid) { + const params = createDiscardTelemetryParams(session, item) + // TODO: this session is closed on flare side hence discarded is not emitted in flare + languageClient.sendNotification('aws/logInlineCompletionSessionResults', params) + return + } + const documentChangeListener = vscode.workspace.onDidChangeTextDocument((e) => { + if (e.contentChanges.length <= 0) { + return + } + if (e.document !== editor.document) { + return + } + if (vsCodeState.isCodeWhispererEditing) { + return + } + if (getContext('aws.amazonq.editSuggestionActive') === false) { + return + } + + const isPatchValid = applyPatch(e.document.getText(), item.insertText as string) + if (!isPatchValid) { + void vscode.commands.executeCommand('aws.amazonq.inline.rejectEdit') + } + }) + await decorationManager.displayEditSuggestion( + editor, + svgImage, + startLine, + async () => { + // Handle accept + getLogger().info('Edit suggestion accepted') + + // Replace content + try { + vsCodeState.isCodeWhispererEditing = true + await replaceEditorContent(editor, newCode) + } finally { + vsCodeState.isCodeWhispererEditing = false + } + + // Move cursor to end of the actual changed content + const endPosition = getEndOfEditPosition(originalCode, newCode) + editor.selection = new vscode.Selection(endPosition, endPosition) + + // Move cursor to end of the actual changed content + editor.selection = new vscode.Selection(endPosition, endPosition) + + await decorationManager.clearDecorations(editor) + documentChangeListener.dispose() + const params: LogInlineCompletionSessionResultsParams = { + sessionId: session.sessionId, + completionSessionResult: { + [item.itemId]: { + seen: true, + accepted: true, + discarded: false, + }, + }, + totalSessionDisplayTime: Date.now() - session.requestStartTime, + firstCompletionDisplayLatency: session.firstCompletionDisplayLatency, + isInlineEdit: true, + } + languageClient.sendNotification('aws/logInlineCompletionSessionResults', params) + session.triggerOnAcceptance = true + // VS Code triggers suggestion on every keystroke, temporarily disable trigger on acceptance + // if (inlineCompletionProvider && session.editsStreakPartialResultToken) { + // await inlineCompletionProvider.provideInlineCompletionItems( + // editor.document, + // endPosition, + // { + // triggerKind: vscode.InlineCompletionTriggerKind.Automatic, + // selectedCompletionInfo: undefined, + // }, + // new vscode.CancellationTokenSource().token, + // { emitTelemetry: false, showUi: false, editsStreakToken: session.editsStreakPartialResultToken } + // ) + // } + }, + async () => { + // Handle reject + getLogger().info('Edit suggestion rejected') + await decorationManager.clearDecorations(editor) + documentChangeListener.dispose() + const params: LogInlineCompletionSessionResultsParams = { + sessionId: session.sessionId, + completionSessionResult: { + [item.itemId]: { + seen: true, + accepted: false, + discarded: false, + }, + }, + totalSessionDisplayTime: Date.now() - session.requestStartTime, + firstCompletionDisplayLatency: session.firstCompletionDisplayLatency, + isInlineEdit: true, + } + languageClient.sendNotification('aws/logInlineCompletionSessionResults', params) + }, + originalCode, + newCode, + originalCodeHighlightRanges + ) +} + +export function deactivate() { + decorationManager.dispose() +} + +let decorationType: vscode.TextEditorDecorationType | undefined + +export function decorateLinesWithGutterIcon(lineNumbers: number[]) { + const editor = vscode.window.activeTextEditor + if (!editor) { + return + } + + // Dispose previous decoration if it exists + if (decorationType) { + decorationType.dispose() + } + + // Create a new gutter decoration with a small green dot + decorationType = vscode.window.createTextEditorDecorationType({ + gutterIconPath: vscode.Uri.file( + path.join(__dirname, 'media', 'green-dot.svg') // put your svg file in a `media` folder + ), + gutterIconSize: 'contain', + }) + + const decorations: vscode.DecorationOptions[] = lineNumbers.map((line) => ({ + range: new vscode.Range(new vscode.Position(line, 0), new vscode.Position(line, 0)), + })) + + editor.setDecorations(decorationType, decorations) +} diff --git a/packages/amazonq/src/app/inline/EditRendering/imageRenderer.ts b/packages/amazonq/src/app/inline/EditRendering/imageRenderer.ts new file mode 100644 index 00000000000..6c52dc2d6a0 --- /dev/null +++ b/packages/amazonq/src/app/inline/EditRendering/imageRenderer.ts @@ -0,0 +1,59 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' +import { displaySvgDecoration } from './displayImage' +import { SvgGenerationService } from './svgGenerator' +import { getLogger } from 'aws-core-vscode/shared' +import { LanguageClient } from 'vscode-languageclient' +import { InlineCompletionItemWithReferences } from '@aws/language-server-runtimes/protocol' +import { CodeWhispererSession } from '../sessionManager' +import type { AmazonQInlineCompletionItemProvider } from '../completion' + +export async function showEdits( + item: InlineCompletionItemWithReferences, + editor: vscode.TextEditor | undefined, + session: CodeWhispererSession, + languageClient: LanguageClient, + inlineCompletionProvider?: AmazonQInlineCompletionItemProvider +) { + if (!editor) { + return + } + try { + const svgGenerationService = new SvgGenerationService() + // Generate your SVG image with the file contents + const currentFile = editor.document.uri.fsPath + const { svgImage, startLine, newCode, originalCodeHighlightRange } = await svgGenerationService.generateDiffSvg( + currentFile, + item.insertText as string + ) + + // TODO: To investigate why it fails and patch [generateDiffSvg] + if (newCode.length === 0) { + getLogger('nextEditPrediction').warn('not able to apply provided edit suggestion, skip rendering') + return + } + + if (svgImage) { + // display the SVG image + await displaySvgDecoration( + editor, + svgImage, + startLine, + newCode, + originalCodeHighlightRange, + session, + languageClient, + item, + inlineCompletionProvider + ) + } else { + getLogger('nextEditPrediction').error('SVG image generation returned an empty result.') + } + } catch (error) { + getLogger('nextEditPrediction').error(`Error generating SVG image: ${error}`) + } +} diff --git a/packages/amazonq/src/app/inline/EditRendering/svgGenerator.ts b/packages/amazonq/src/app/inline/EditRendering/svgGenerator.ts new file mode 100644 index 00000000000..6958be47f36 --- /dev/null +++ b/packages/amazonq/src/app/inline/EditRendering/svgGenerator.ts @@ -0,0 +1,508 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import { diffWordsWithSpace, diffLines } from 'diff' +import * as vscode from 'vscode' +import { ToolkitError, getLogger } from 'aws-core-vscode/shared' +import { diffUtilities } from 'aws-core-vscode/shared' +type Range = { line: number; start: number; end: number } + +const logger = getLogger('nextEditPrediction') +export const imageVerticalOffset = 1 +export const emptyDiffSvg = { + svgImage: vscode.Uri.parse(''), + startLine: 0, + newCode: '', + originalCodeHighlightRange: [], +} + +export class SvgGenerationService { + /** + * Generates an SVG image representing a code diff + * @param originalCode The original code + * @param newCode The new code with editsss + * @param theme The editor theme information + * @param offSet The margin to add to the left of the image + */ + public async generateDiffSvg( + filePath: string, + udiff: string + ): Promise<{ + svgImage: vscode.Uri + startLine: number + newCode: string + originalCodeHighlightRange: Range[] + }> { + const textDoc = await vscode.workspace.openTextDocument(filePath) + const originalCode = textDoc.getText().replaceAll('\r\n', '\n') + if (originalCode === '') { + logger.error(`udiff format error`) + throw new ToolkitError('udiff format error') + } + const newCode = await diffUtilities.getPatchedCode(filePath, udiff) + + const { createSVGWindow } = await import('svgdom') + + const svgjs = await import('@svgdotjs/svg.js') + const SVG = svgjs.SVG + const registerWindow = svgjs.registerWindow + + // Get editor theme info + const currentTheme = this.getEditorTheme() + + // Get edit diffs with highlight + const { addedLines, removedLines } = this.getEditedLinesFromCode(originalCode, newCode) + + const modifiedLines = diffUtilities.getModifiedLinesFromCode(addedLines, removedLines) + // TODO remove + // eslint-disable-next-line aws-toolkits/no-json-stringify-in-log + logger.info(`Line mapping: ${JSON.stringify(modifiedLines)}`) + + // Calculate dimensions based on code content + const { offset, editStartLine, isPositionValid } = this.calculatePosition( + originalCode.split('\n'), + newCode.split('\n'), + addedLines, + currentTheme + ) + + // if the position for the EDITS suggestion is not valid (there is no difference between new + // and current code content), return EMPTY_DIFF_SVG and skip the suggestion. + if (!isPositionValid) { + return emptyDiffSvg + } + + const highlightRanges = this.generateHighlightRanges(removedLines, addedLines, modifiedLines) + const diffAddedWithHighlight = this.getHighlightEdit(addedLines, highlightRanges.addedRanges) + + // Create SVG window, document, and container + const window = createSVGWindow() + const document = window.document + registerWindow(window, document) + const draw = SVG(document.documentElement) as any + + const { width, height } = this.calculateDimensions(addedLines, currentTheme) + draw.size(width + offset, height) + + // Generate CSS for syntax highlighting HTML content based on theme + const styles = this.generateStyles(currentTheme) + const htmlContent = this.generateHtmlContent(diffAddedWithHighlight, styles, offset) + + // Create foreignObject to embed HTML + const foreignObject = draw.foreignObject(width + offset, height) + foreignObject.node.innerHTML = htmlContent.trim() + + const svgData = draw.svg() + const svgResult = `data:image/svg+xml;base64,${Buffer.from(svgData).toString('base64')}` + + return { + svgImage: vscode.Uri.parse(svgResult), + startLine: editStartLine, + newCode: newCode, + originalCodeHighlightRange: highlightRanges.removedRanges, + } + } + + private calculateDimensions(newLines: string[], currentTheme: editorThemeInfo): { width: number; height: number } { + // Calculate appropriate width and height based on diff content + const maxLineLength = Math.max(...newLines.map((line) => line.length)) + + const headerFrontSize = Math.ceil(currentTheme.fontSize * 0.66) + + // Estimate width based on character count and font size + const width = Math.max(41 * headerFrontSize * 0.7, maxLineLength * currentTheme.fontSize * 0.7) + + // Calculate height based on diff line count and line height + const totalLines = newLines.length + 1 // +1 for header + const height = totalLines * currentTheme.lingHeight + 25 // +25 for padding + + return { width, height } + } + + private generateStyles(theme: editorThemeInfo): string { + // Generate CSS styles based on editor theme + const fontSize = theme.fontSize + const headerFrontSize = Math.ceil(fontSize * 0.66) + const lineHeight = theme.lingHeight + const foreground = theme.foreground + const bordeColor = 'rgba(212, 212, 212, 0.5)' + const background = theme.background || '#1e1e1e' + const diffRemoved = theme.diffRemoved || 'rgba(255, 0, 0, 0.2)' + const diffAdded = 'rgba(72, 128, 72, 0.52)' + return ` + .code-container { + font-family: ${'monospace'}; + color: ${foreground}; + font-size: ${fontSize}px; + line-height: ${lineHeight}px; + background-color: ${background}; + border: 1px solid ${bordeColor}; + border-radius: 0px; + padding-top: 3px; + padding-bottom: 5px; + padding-left: 10px; + } + .diff-header { + color: ${theme.foreground || '#d4d4d4'}; + margin: 0; + font-size: ${headerFrontSize}px; + padding: 0px; + } + .diff-removed { + background-color: ${diffRemoved}; + white-space: pre-wrap; /* Preserve whitespace */ + text-decoration: line-through; + opacity: 0.7; + } + .diff-changed { + white-space: pre-wrap; /* Preserve whitespace */ + background-color: ${diffAdded}; + } + ` + } + + private generateHtmlContent(diffLines: string[], styles: string, offSet: number): string { + return ` +
+ +
+
Q: Press [Tab] to accept or [Esc] to reject:
+ ${diffLines.map((line) => `
${line}
`).join('')} +
+
+ ` + } + + /** + * Extract added and removed lines by comparing original and new code + * @param originalCode The original code string + * @param newCode The new code string + * @returns Object containing arrays of added and removed lines + */ + private getEditedLinesFromCode( + originalCode: string, + newCode: string + ): { addedLines: string[]; removedLines: string[] } { + const addedLines: string[] = [] + const removedLines: string[] = [] + + const changes = diffLines(originalCode, newCode) + + for (const change of changes) { + if (change.added) { + addedLines.push(...change.value.split('\n').filter((line) => line.length > 0)) + } else if (change.removed) { + removedLines.push(...change.value.split('\n').filter((line) => line.length > 0)) + } + } + + return { addedLines, removedLines } + } + + /** + * Applies highlighting to code lines based on the specified ranges + * @param newLines Array of code lines to highlight + * @param highlightRanges Array of ranges specifying which parts of the lines to highlight + * @returns Array of HTML strings with appropriate spans for highlighting + */ + private getHighlightEdit(newLines: string[], highlightRanges: Range[]): string[] { + const result: string[] = [] + + // Group ranges by line for easier lookup + const rangesByLine = new Map() + for (const range of highlightRanges) { + if (!rangesByLine.has(range.line)) { + rangesByLine.set(range.line, []) + } + rangesByLine.get(range.line)!.push(range) + } + + // Process each line of code + for (let lineIndex = 0; lineIndex < newLines.length; lineIndex++) { + const line = newLines[lineIndex] + // Get ranges for this line + const lineRanges = rangesByLine.get(lineIndex) || [] + + // If no ranges for this line, leave it as-is with HTML escaping + if (lineRanges.length === 0) { + result.push(this.escapeHtml(line)) + continue + } + + // Sort ranges by start position to ensure correct ordering + lineRanges.sort((a, b) => a.start - b.start) + + // Build the highlighted line + let highlightedLine = '' + let currentPos = 0 + + for (const range of lineRanges) { + // Add text before the current range (with HTML escaping) + if (range.start > currentPos) { + const beforeText = line.substring(currentPos, range.start) + highlightedLine += this.escapeHtml(beforeText) + } + + // Add the highlighted part (with HTML escaping) + const highlightedText = line.substring(range.start, range.end) + highlightedLine += `${this.escapeHtml(highlightedText)}` + + // Update current position + currentPos = range.end + } + + // Add any remaining text after the last range (with HTML escaping) + if (currentPos < line.length) { + const afterText = line.substring(currentPos) + highlightedLine += this.escapeHtml(afterText) + } + + result.push(highlightedLine) + } + + return result + } + + private getEditorTheme(): editorThemeInfo { + const editorConfig = vscode.workspace.getConfiguration('editor') + const fontSize = editorConfig.get('fontSize', 12) // Default to 12 if not set + const lineHeightSetting = editorConfig.get('lineHeight', 0) // Default to 0 if not set + + /** + * Calculate effective line height, documented as such: + * Use 0 to automatically compute the line height from the font size. + * Values between 0 and 8 will be used as a multiplier with the font size. + * Values greater than or equal to 8 will be used as effective values. + */ + let effectiveLineHeight: number + if (lineHeightSetting > 0 && lineHeightSetting < 8) { + effectiveLineHeight = lineHeightSetting * fontSize + } else if (lineHeightSetting >= 8) { + effectiveLineHeight = lineHeightSetting + } else { + effectiveLineHeight = Math.round(1.5 * fontSize) + } + + const themeName = vscode.workspace.getConfiguration('workbench').get('colorTheme', 'Default') + const themeColors = this.getThemeColors(themeName) + + return { + fontSize: fontSize, + lingHeight: effectiveLineHeight, + ...themeColors, + } + } + + private getThemeColors(themeName: string): { + foreground: string + background: string + diffAdded: string + diffRemoved: string + } { + // Define default dark theme colors + const darkThemeColors = { + foreground: 'rgba(212, 212, 212, 1)', + background: 'rgba(30, 30, 30, 1)', + diffAdded: 'rgba(231, 245, 231, 0.2)', + diffRemoved: 'rgba(255, 0, 0, 0.2)', + } + + // Define default light theme colors + const lightThemeColors = { + foreground: 'rgba(0, 0, 0, 1)', + background: 'rgba(255, 255, 255, 1)', + diffAdded: 'rgba(198, 239, 206, 0.2)', + diffRemoved: 'rgba(255, 199, 206, 0.5)', + } + + // For dark and light modes + const themeNameLower = themeName.toLowerCase() + + if (themeNameLower.includes('dark')) { + return darkThemeColors + } else if (themeNameLower.includes('light')) { + return lightThemeColors + } + + // Define colors for specific themes, add more if needed. + const themeColorMap: { + [key: string]: { foreground: string; background: string; diffAdded: string; diffRemoved: string } + } = { + Abyss: { + foreground: 'rgba(255, 255, 255, 1)', + background: 'rgba(0, 12, 24, 1)', + diffAdded: 'rgba(0, 255, 0, 0.2)', + diffRemoved: 'rgba(255, 0, 0, 0.3)', + }, + Red: { + foreground: 'rgba(255, 0, 0, 1)', + background: 'rgba(51, 0, 0, 1)', + diffAdded: 'rgba(255, 100, 100, 0.2)', + diffRemoved: 'rgba(255, 0, 0, 0.5)', + }, + } + + // Return colors for the specific theme or default to light theme + return themeColorMap[themeName] || lightThemeColors + } + + private calculatePosition( + originalLines: string[], + newLines: string[], + diffLines: string[], + theme: editorThemeInfo + ): { offset: number; editStartLine: number; isPositionValid: boolean } { + // Determine the starting line of the edit in the original file + let editStartLineInOldFile = 0 + const maxLength = Math.min(originalLines.length, newLines.length) + + for (let i = 0; i <= maxLength; i++) { + // if there is no difference between the original lines and the new lines, skip calculating for the start position. + if (i === maxLength && originalLines[i] === newLines[i] && originalLines.length === newLines.length) { + logger.info( + 'There is no difference between current and new code suggestion. Skip calculating for start position.' + ) + return { + offset: 0, + editStartLine: 0, + isPositionValid: false, + } + } + if (originalLines[i] !== newLines[i] || i === maxLength) { + editStartLineInOldFile = i + break + } + } + const shiftedStartLine = Math.max(0, editStartLineInOldFile - imageVerticalOffset) + + // Determine the range to consider + const startLine = shiftedStartLine + const endLine = Math.min(editStartLineInOldFile + diffLines.length, originalLines.length) + + // Find the longest line within the specified range + let maxLineLength = 0 + for (let i = startLine; i <= endLine; i++) { + const lineLength = originalLines[i]?.length || 0 + if (lineLength > maxLineLength) { + maxLineLength = lineLength + } + } + + // Calculate the offset based on the longest line and the starting line length + const startLineLength = originalLines[startLine]?.length || 0 + const offset = (maxLineLength - startLineLength) * theme.fontSize * 0.7 + 10 // padding + + return { offset, editStartLine: editStartLineInOldFile, isPositionValid: true } + } + + private escapeHtml(text: string): string { + return text + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, ''') + } + + /** + * Generates character-level highlight ranges for both original and modified code. + * @param originalCode Array of original code lines + * @param afterCode Array of code lines after modification + * @param modifiedLines Map of original lines to modified lines + * @returns Object containing ranges for original and after code character level highlighting + */ + private generateHighlightRanges( + originalCode: string[], + afterCode: string[], + modifiedLines: Map + ): { removedRanges: Range[]; addedRanges: Range[] } { + const originalRanges: Range[] = [] + const afterRanges: Range[] = [] + + // Create reverse mapping for quicker lookups + const reverseMap = new Map() + for (const [original, modified] of modifiedLines.entries()) { + reverseMap.set(modified, original) + } + + // Process original code lines - produces highlight ranges in current editor text + for (let lineIndex = 0; lineIndex < originalCode.length; lineIndex++) { + const line = originalCode[lineIndex] + + // If line exists in modifiedLines as a key, process character diffs + if (Array.from(modifiedLines.keys()).includes(line)) { + const modifiedLine = modifiedLines.get(line)! + const changes = diffWordsWithSpace(line, modifiedLine) + + let charPos = 0 + for (const part of changes) { + if (part.removed) { + originalRanges.push({ + line: lineIndex, + start: charPos, + end: charPos + part.value.length, + }) + } + + if (!part.added) { + charPos += part.value.length + } + } + } else { + // Line doesn't exist in modifiedLines values, highlight entire line + originalRanges.push({ + line: lineIndex, + start: 0, + end: line.length, + }) + } + } + + // Process after code lines - used for highlight in SVG image + for (let lineIndex = 0; lineIndex < afterCode.length; lineIndex++) { + const line = afterCode[lineIndex] + + if (reverseMap.has(line)) { + const originalLine = reverseMap.get(line)! + const changes = diffWordsWithSpace(originalLine, line) + + let charPos = 0 + for (const part of changes) { + if (part.added) { + afterRanges.push({ + line: lineIndex, + start: charPos, + end: charPos + part.value.length, + }) + } + + if (!part.removed) { + charPos += part.value.length + } + } + } else { + afterRanges.push({ + line: lineIndex, + start: 0, + end: line.length, + }) + } + } + + return { + removedRanges: originalRanges, + addedRanges: afterRanges, + } + } +} + +interface editorThemeInfo { + fontSize: number + lingHeight: number + foreground?: string + background?: string + diffAdded?: string + diffRemoved?: string +} diff --git a/packages/amazonq/src/app/inline/activation.ts b/packages/amazonq/src/app/inline/activation.ts index 69515127441..867ae95d9b5 100644 --- a/packages/amazonq/src/app/inline/activation.ts +++ b/packages/amazonq/src/app/inline/activation.ts @@ -17,6 +17,9 @@ import { globals, sleep } from 'aws-core-vscode/shared' export async function activate() { if (isInlineCompletionEnabled()) { + // Debugging purpose: only initialize NextEditPredictionPanel when development + // NextEditPredictionPanel.getInstance() + await setSubscriptionsforInlineCompletion() await AuthUtil.instance.setVscodeContextProps() } diff --git a/packages/amazonq/src/app/inline/completion.ts b/packages/amazonq/src/app/inline/completion.ts index 1e0716097bb..9a5f5522468 100644 --- a/packages/amazonq/src/app/inline/completion.ts +++ b/packages/amazonq/src/app/inline/completion.ts @@ -2,7 +2,7 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - +import * as vscode from 'vscode' import { CancellationToken, InlineCompletionContext, @@ -24,7 +24,7 @@ import { LogInlineCompletionSessionResultsParams, } from '@aws/language-server-runtimes/protocol' import { SessionManager } from './sessionManager' -import { RecommendationService } from './recommendationService' +import { GetAllRecommendationsOptions, RecommendationService } from './recommendationService' import { CodeWhispererConstants, ReferenceHoverProvider, @@ -32,16 +32,20 @@ import { ImportAdderProvider, CodeSuggestionsState, vsCodeState, - inlineCompletionsDebounceDelay, noInlineSuggestionsMsg, - ReferenceInlineProvider, + getDiagnosticsDifferences, + getDiagnosticsOfCurrentFile, + toIdeDiagnostics, + handleExtraBrackets, } from 'aws-core-vscode/codewhisperer' -import { InlineGeneratingMessage } from './inlineGeneratingMessage' import { LineTracker } from './stateTracker/lineTracker' import { InlineTutorialAnnotation } from './tutorials/inlineTutorialAnnotation' import { TelemetryHelper } from './telemetryHelper' -import { getLogger } from 'aws-core-vscode/shared' -import { debounce, messageUtils } from 'aws-core-vscode/utils' +import { Experiments, getLogger, sleep } from 'aws-core-vscode/shared' +import { messageUtils } from 'aws-core-vscode/utils' +import { showEdits } from './EditRendering/imageRenderer' +import { ICursorUpdateRecorder } from './cursorUpdateManager' +import { DocumentEventListener } from './documentEventListener' export class InlineCompletionManager implements Disposable { private disposable: Disposable @@ -50,42 +54,51 @@ export class InlineCompletionManager implements Disposable { private sessionManager: SessionManager private recommendationService: RecommendationService private lineTracker: LineTracker - private incomingGeneratingMessage: InlineGeneratingMessage + private inlineTutorialAnnotation: InlineTutorialAnnotation private readonly logSessionResultMessageName = 'aws/logInlineCompletionSessionResults' + private documentEventListener: DocumentEventListener constructor( languageClient: LanguageClient, sessionManager: SessionManager, lineTracker: LineTracker, - inlineTutorialAnnotation: InlineTutorialAnnotation + inlineTutorialAnnotation: InlineTutorialAnnotation, + cursorUpdateRecorder?: ICursorUpdateRecorder ) { this.languageClient = languageClient this.sessionManager = sessionManager this.lineTracker = lineTracker - this.incomingGeneratingMessage = new InlineGeneratingMessage(this.lineTracker) - this.recommendationService = new RecommendationService(this.sessionManager, this.incomingGeneratingMessage) + this.recommendationService = new RecommendationService(this.sessionManager, cursorUpdateRecorder) this.inlineTutorialAnnotation = inlineTutorialAnnotation + this.documentEventListener = new DocumentEventListener() this.inlineCompletionProvider = new AmazonQInlineCompletionItemProvider( languageClient, this.recommendationService, this.sessionManager, - this.inlineTutorialAnnotation + this.inlineTutorialAnnotation, + this.documentEventListener ) + this.disposable = languages.registerInlineCompletionItemProvider( CodeWhispererConstants.platformLanguageIds, this.inlineCompletionProvider ) - this.lineTracker.ready() } + public getInlineCompletionProvider(): AmazonQInlineCompletionItemProvider { + return this.inlineCompletionProvider + } + public dispose(): void { if (this.disposable) { this.disposable.dispose() - this.incomingGeneratingMessage.dispose() this.lineTracker.dispose() } + if (this.documentEventListener) { + this.documentEventListener.dispose() + } } public registerInlineCompletion() { @@ -94,130 +107,249 @@ export class InlineCompletionManager implements Disposable { item: InlineCompletionItemWithReferences, editor: TextEditor, requestStartTime: number, - startLine: number, + position: vscode.Position, firstCompletionDisplayLatency?: number ) => { - // TODO: also log the seen state for other suggestions in session - const params: LogInlineCompletionSessionResultsParams = { - sessionId: sessionId, - completionSessionResult: { - [item.itemId]: { - seen: true, - accepted: true, - discarded: false, - }, - }, - totalSessionDisplayTime: Date.now() - requestStartTime, - firstCompletionDisplayLatency: firstCompletionDisplayLatency, - } - this.languageClient.sendNotification(this.logSessionResultMessageName, params) - this.disposable.dispose() - this.disposable = languages.registerInlineCompletionItemProvider( - CodeWhispererConstants.platformLanguageIds, - this.inlineCompletionProvider - ) - if (item.references && item.references.length) { - const referenceLog = ReferenceLogViewProvider.getReferenceLog( - item.insertText as string, - item.references, - editor + try { + vsCodeState.isCodeWhispererEditing = true + const startLine = position.line + // TODO: also log the seen state for other suggestions in session + // Calculate timing metrics before diagnostic delay + const totalSessionDisplayTime = performance.now() - requestStartTime + await sleep(500) + const diagnosticDiff = getDiagnosticsDifferences( + this.sessionManager.getActiveSession()?.diagnosticsBeforeAccept, + getDiagnosticsOfCurrentFile() ) - ReferenceLogViewProvider.instance.addReferenceLog(referenceLog) - ReferenceHoverProvider.instance.addCodeReferences(item.insertText as string, item.references) - - // Show codelense for 5 seconds. - ReferenceInlineProvider.instance.setInlineReference( - startLine, - item.insertText as string, - item.references + // try remove the extra } ) ' " if there is a new reported problem + // the extra } will cause syntax error + if (diagnosticDiff.added.length > 0) { + await handleExtraBrackets(editor, editor.selection.active, position) + } + const params: LogInlineCompletionSessionResultsParams = { + sessionId: sessionId, + completionSessionResult: { + [item.itemId]: { + seen: true, + accepted: true, + discarded: false, + }, + }, + totalSessionDisplayTime: totalSessionDisplayTime, + firstCompletionDisplayLatency: firstCompletionDisplayLatency, + addedDiagnostics: diagnosticDiff.added.map((it) => toIdeDiagnostics(it)), + removedDiagnostics: diagnosticDiff.removed.map((it) => toIdeDiagnostics(it)), + } + this.languageClient.sendNotification(this.logSessionResultMessageName, params) + this.disposable.dispose() + this.disposable = languages.registerInlineCompletionItemProvider( + CodeWhispererConstants.platformLanguageIds, + this.inlineCompletionProvider ) - setTimeout(() => { - ReferenceInlineProvider.instance.removeInlineReference() - }, 5000) - } - if (item.mostRelevantMissingImports?.length) { - await ImportAdderProvider.instance.onAcceptRecommendation(editor, item, startLine) + if (item.references && item.references.length) { + const referenceLog = ReferenceLogViewProvider.getReferenceLog( + item.insertText as string, + item.references, + editor + ) + ReferenceLogViewProvider.instance.addReferenceLog(referenceLog) + ReferenceHoverProvider.instance.addCodeReferences(item.insertText as string, item.references) + } + if (item.mostRelevantMissingImports?.length) { + await ImportAdderProvider.instance.onAcceptRecommendation(editor, item, startLine) + } + this.sessionManager.incrementSuggestionCount() + // clear session manager states once accepted + this.sessionManager.clear() + } finally { + vsCodeState.isCodeWhispererEditing = false } - this.sessionManager.incrementSuggestionCount() - // clear session manager states once accepted - this.sessionManager.clear() } commands.registerCommand('aws.amazonq.acceptInline', onInlineAcceptance) const onInlineRejection = async () => { - await commands.executeCommand('editor.action.inlineSuggest.hide') - // TODO: also log the seen state for other suggestions in session - this.disposable.dispose() - this.disposable = languages.registerInlineCompletionItemProvider( - CodeWhispererConstants.platformLanguageIds, - this.inlineCompletionProvider - ) - const sessionId = this.sessionManager.getActiveSession()?.sessionId - const itemId = this.sessionManager.getActiveRecommendation()[0]?.itemId - if (!sessionId || !itemId) { - return - } - const params: LogInlineCompletionSessionResultsParams = { - sessionId: sessionId, - completionSessionResult: { - [itemId]: { - seen: true, - accepted: false, - discarded: false, + try { + vsCodeState.isCodeWhispererEditing = true + const session = this.sessionManager.getActiveSession() + if (session === undefined) { + return + } + const requestStartTime = session.requestStartTime + const totalSessionDisplayTime = performance.now() - requestStartTime + await commands.executeCommand('editor.action.inlineSuggest.hide') + // TODO: also log the seen state for other suggestions in session + this.disposable.dispose() + this.disposable = languages.registerInlineCompletionItemProvider( + CodeWhispererConstants.platformLanguageIds, + this.inlineCompletionProvider + ) + const sessionId = session.sessionId + const itemId = this.sessionManager.getActiveRecommendation()[0]?.itemId + if (!itemId) { + return + } + const params: LogInlineCompletionSessionResultsParams = { + sessionId: sessionId, + completionSessionResult: { + [itemId]: { + seen: true, + accepted: false, + discarded: false, + }, }, - }, + firstCompletionDisplayLatency: session.firstCompletionDisplayLatency, + totalSessionDisplayTime: totalSessionDisplayTime, + } + this.languageClient.sendNotification(this.logSessionResultMessageName, params) + // clear session manager states once rejected + this.sessionManager.clear() + } finally { + vsCodeState.isCodeWhispererEditing = false } - this.languageClient.sendNotification(this.logSessionResultMessageName, params) - // clear session manager states once rejected - this.sessionManager.clear() } commands.registerCommand('aws.amazonq.rejectCodeSuggestion', onInlineRejection) } } export class AmazonQInlineCompletionItemProvider implements InlineCompletionItemProvider { + private logger = getLogger() constructor( private readonly languageClient: LanguageClient, private readonly recommendationService: RecommendationService, private readonly sessionManager: SessionManager, - private readonly inlineTutorialAnnotation: InlineTutorialAnnotation + private readonly inlineTutorialAnnotation: InlineTutorialAnnotation, + private readonly documentEventListener: DocumentEventListener ) {} private readonly logSessionResultMessageName = 'aws/logInlineCompletionSessionResults' - provideInlineCompletionItems = debounce( - this._provideInlineCompletionItems.bind(this), - inlineCompletionsDebounceDelay, - true - ) - private async _provideInlineCompletionItems( + // Ideally use this API handleDidShowCompletionItem + // https://github.com/microsoft/vscode/blob/main/src/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts#L83 + // we need this because the returned items of provideInlineCompletionItems may not be actually rendered on screen + // if VS Code believes the user is actively typing then it will not show such item + async checkWhetherInlineCompletionWasShown() { + // this line is to force VS Code to re-render the inline completion + // if it decides the inline completion can be shown + await vscode.commands.executeCommand('editor.action.inlineSuggest.trigger') + // yield event loop to let backend state transition finish plus wait for vsc to render + await sleep(10) + // run the command to detect if inline suggestion is really shown or not + await vscode.commands.executeCommand(`aws.amazonq.checkInlineSuggestionVisibility`) + } + + /** + * Check if a completion suggestion is currently active/displayed + */ + public async isCompletionActive(): Promise { + const session = this.sessionManager.getActiveSession() + if (session === undefined || !session.displayed || session.suggestions.some((item) => item.isInlineEdit)) { + return false + } + + // Use VS Code command to check if inline suggestion is actually visible on screen + // This command only executes when inlineSuggestionVisible context is true + await vscode.commands.executeCommand('aws.amazonq.checkInlineSuggestionVisibility') + const isInlineSuggestionVisible = performance.now() - session.lastVisibleTime < 50 + return isInlineSuggestionVisible + } + + /** + * Batch discard telemetry for completion suggestions when edit suggestion is active + */ + public batchDiscardTelemetryForEditSuggestion(items: any[], session: any): void { + // Emit DISCARD telemetry for completion suggestions that can't be shown due to active edit + const completionSessionResult: { + [key: string]: { seen: boolean; accepted: boolean; discarded: boolean } + } = {} + + for (const item of items) { + if (!item.isInlineEdit && item.itemId) { + completionSessionResult[item.itemId] = { + seen: false, + accepted: false, + discarded: true, + } + } + } + + // Send single telemetry event for all discarded items + if (Object.keys(completionSessionResult).length > 0) { + const params: LogInlineCompletionSessionResultsParams = { + sessionId: session.sessionId, + completionSessionResult, + firstCompletionDisplayLatency: session.firstCompletionDisplayLatency, + totalSessionDisplayTime: performance.now() - session.requestStartTime, + } + this.languageClient.sendNotification(this.logSessionResultMessageName, params) + } + } + + // this method is automatically invoked by VS Code as user types + async provideInlineCompletionItems( document: TextDocument, position: Position, context: InlineCompletionContext, - token: CancellationToken + token: CancellationToken, + getAllRecommendationsOptions?: GetAllRecommendationsOptions ): Promise { + getLogger().info('_provideInlineCompletionItems called with: %O', { + documentUri: document.uri.toString(), + position, + context, + triggerKind: context.triggerKind === InlineCompletionTriggerKind.Automatic ? 'Automatic' : 'Invoke', + options: JSON.stringify(getAllRecommendationsOptions), + }) + // prevent concurrent API calls and write to shared state variables if (vsCodeState.isRecommendationsActive) { + getLogger().info('Recommendations already active, returning empty') return [] } + + if (vsCodeState.isCodeWhispererEditing) { + getLogger().info('Q is editing, returning empty') + return [] + } + + // there is a bug in VS Code, when hitting Enter, the context.triggerKind is Invoke (0) + // when hitting other keystrokes, the context.triggerKind is Automatic (1) + // we only mark option + C as manual trigger + // this is a workaround since the inlineSuggest.trigger command take no params + const isAutoTrigger = performance.now() - vsCodeState.lastManualTriggerTime > 50 + if (isAutoTrigger && !CodeSuggestionsState.instance.isSuggestionsEnabled()) { + // return early when suggestions are disabled with auto trigger + return [] + } + + // yield event loop to let the document listen catch updates + await sleep(1) + + let logstr = `GenerateCompletion metadata:\\n` try { + const t0 = performance.now() vsCodeState.isRecommendationsActive = true - const isAutoTrigger = context.triggerKind === InlineCompletionTriggerKind.Automatic - if (isAutoTrigger && !CodeSuggestionsState.instance.isSuggestionsEnabled()) { - // return early when suggestions are disabled with auto trigger - return [] - } - // handling previous session const prevSession = this.sessionManager.getActiveSession() const prevSessionId = prevSession?.sessionId const prevItemId = this.sessionManager.getActiveRecommendation()?.[0]?.itemId const prevStartPosition = prevSession?.startPosition + const editsTriggerOnAcceptance = prevSession?.triggerOnAcceptance + if (editsTriggerOnAcceptance) { + getAllRecommendationsOptions = { + ...getAllRecommendationsOptions, + editsStreakToken: prevSession?.editsStreakPartialResultToken, + } + } const editor = window.activeTextEditor - if (prevSession && prevSessionId && prevItemId && prevStartPosition) { + // Skip prefix matching for Edits suggestions that trigger on acceptance. + if (prevSession && prevSessionId && prevItemId && prevStartPosition && !editsTriggerOnAcceptance) { const prefix = document.getText(new Range(prevStartPosition, position)) const prevItemMatchingPrefix = [] for (const item of this.sessionManager.getActiveRecommendation()) { + // if item is an Edit suggestion, insertText is a diff instead of new code contents, skip the logic to check for prefix. + if (item.isInlineEdit) { + continue + } const text = typeof item.insertText === 'string' ? item.insertText : item.insertText.value if (text.startsWith(prefix) && position.isAfterOrEqual(prevStartPosition)) { item.command = { @@ -228,7 +360,7 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem item, editor, prevSession?.requestStartTime, - position.line, + position, prevSession?.firstCompletionDisplayLatency, ], } @@ -238,20 +370,24 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem } // re-use previous suggestions as long as new typed prefix matches if (prevItemMatchingPrefix.length > 0) { - getLogger().debug(`Re-using suggestions that match user typed characters`) + logstr += `- not call LSP and reuse previous suggestions that match user typed characters + - duration between trigger to completion suggestion is displayed ${performance.now() - t0}` + void this.checkWhetherInlineCompletionWasShown() return prevItemMatchingPrefix } - getLogger().debug(`Auto rejecting suggestions from previous session`) - // if no such suggestions, report the previous suggestion as Reject + + // if no such suggestions, report the previous suggestion as Reject or Discarded const params: LogInlineCompletionSessionResultsParams = { sessionId: prevSessionId, completionSessionResult: { [prevItemId]: { - seen: true, + seen: prevSession.displayed, accepted: false, - discarded: false, + discarded: !prevSession.displayed, }, }, + firstCompletionDisplayLatency: prevSession.firstCompletionDisplayLatency, + totalSessionDisplayTime: performance.now() - prevSession.requestStartTime, } this.languageClient.sendNotification(this.logSessionResultMessageName, params) this.sessionManager.clear() @@ -259,19 +395,42 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem // tell the tutorial that completions has been triggered await this.inlineTutorialAnnotation.triggered(context.triggerKind) + TelemetryHelper.instance.setInvokeSuggestionStartTime() TelemetryHelper.instance.setTriggerType(context.triggerKind) + const t1 = performance.now() + await this.recommendationService.getAllRecommendations( this.languageClient, document, position, - context, - token + { + triggerKind: isAutoTrigger ? 1 : 0, + selectedCompletionInfo: context.selectedCompletionInfo, + }, + token, + isAutoTrigger, + this.documentEventListener, + getAllRecommendationsOptions ) // get active item from session for displaying const items = this.sessionManager.getActiveRecommendation() const itemId = this.sessionManager.getActiveRecommendation()?.[0]?.itemId + + // eslint-disable-next-line @typescript-eslint/no-base-to-string + const itemLog = items[0] ? `${items[0].insertText.toString()}` : `no suggestion` + + const t2 = performance.now() + + logstr += `- number of suggestions: ${items.length} +- sessionId: ${this.sessionManager.getActiveSession()?.sessionId} +- first suggestion content (next line): +${itemLog} +- duration between trigger to before sending LSP call: ${t1 - t0}ms +- duration between trigger to after receiving LSP response: ${t2 - t0}ms +- duration between before sending LSP call to after receving LSP response: ${t2 - t1}ms +` const session = this.sessionManager.getActiveSession() // Show message to user when manual invoke fails to produce results. @@ -280,29 +439,44 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem } if (!session || !items.length || !editor) { - getLogger().debug( - `Failed to produce inline suggestion results. Received ${items.length} items from service` - ) + logstr += `Failed to produce inline suggestion results. Received ${items.length} items from service` return [] } const cursorPosition = document.validatePosition(position) - if (position.isAfter(editor.selection.active)) { - getLogger().debug(`Cursor moved behind trigger position. Discarding suggestion...`) - const params: LogInlineCompletionSessionResultsParams = { - sessionId: session.sessionId, - completionSessionResult: { - [itemId]: { - seen: false, - accepted: false, - discarded: true, + // Completion will not be rendered if users cursor moves to a position which is before the position when the service is invoked + if (items.length > 0 && !items[0].isInlineEdit) { + if (position.isAfter(editor.selection.active)) { + const params: LogInlineCompletionSessionResultsParams = { + sessionId: session.sessionId, + completionSessionResult: { + [itemId]: { + seen: false, + accepted: false, + discarded: true, + }, }, - }, + } + this.languageClient.sendNotification(this.logSessionResultMessageName, params) + this.sessionManager.clear() + logstr += `- cursor moved behind trigger position. Discarding completion suggestion...` + return [] + } + } + + // delay the suggestion rendeing if user is actively typing + // see https://github.com/aws/aws-toolkit-vscode/commit/a537602a96f498f372ed61ec9d82cf8577a9d854 + for (let i = 0; i < 30; i++) { + const lastDocumentChange = this.documentEventListener.getLastDocumentChangeEvent(document.uri.fsPath) + if ( + lastDocumentChange && + performance.now() - lastDocumentChange.timestamp < CodeWhispererConstants.inlineSuggestionShowDelay + ) { + await sleep(CodeWhispererConstants.showRecommendationTimerPollPeriod) + } else { + break } - this.languageClient.sendNotification(this.logSessionResultMessageName, params) - this.sessionManager.clear() - return [] } // the user typed characters from invoking suggestion cursor position to receiving suggestion position @@ -311,6 +485,15 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem const itemsMatchingTypeahead = [] for (const item of items) { + if (item.isInlineEdit) { + // Check if Next Edit Prediction feature flag is enabled + if (Experiments.instance.get('amazonqLSPNEP', true)) { + await showEdits(item, editor, session, this.languageClient, this) + logstr += `- duration between trigger to edits suggestion is displayed: ${performance.now() - t0}ms` + } + return [] + } + item.insertText = typeof item.insertText === 'string' ? item.insertText : item.insertText.value if (item.insertText.startsWith(typeahead)) { item.command = { @@ -321,21 +504,17 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem item, editor, session.requestStartTime, - cursorPosition.line, + cursorPosition, session.firstCompletionDisplayLatency, ], } item.range = new Range(cursorPosition, cursorPosition) itemsMatchingTypeahead.push(item) - ImportAdderProvider.instance.onShowRecommendation(document, cursorPosition.line, item) } } // report discard if none of suggestions match typeahead if (itemsMatchingTypeahead.length === 0) { - getLogger().debug( - `Suggestion does not match user typeahead from insertion position. Discarding suggestion...` - ) const params: LogInlineCompletionSessionResultsParams = { sessionId: session.sessionId, completionSessionResult: { @@ -348,16 +527,22 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem } this.languageClient.sendNotification(this.logSessionResultMessageName, params) this.sessionManager.clear() + logstr += `- suggestion does not match user typeahead from insertion position. Discarding suggestion...` return [] } + this.sessionManager.updateCodeReferenceAndImports() // suggestions returned here will be displayed on screen + logstr += `- duration between trigger to completion suggestion is displayed: ${performance.now() - t0}ms` + void this.checkWhetherInlineCompletionWasShown() return itemsMatchingTypeahead as InlineCompletionItem[] } catch (e) { getLogger('amazonqLsp').error('Failed to provide completion items: %O', e) + logstr += `- failed to provide completion items ${(e as Error).message}` return [] } finally { vsCodeState.isRecommendationsActive = false + this.logger.info(logstr) } } } diff --git a/packages/amazonq/src/app/inline/cursorUpdateManager.ts b/packages/amazonq/src/app/inline/cursorUpdateManager.ts new file mode 100644 index 00000000000..3c0ad6f6add --- /dev/null +++ b/packages/amazonq/src/app/inline/cursorUpdateManager.ts @@ -0,0 +1,211 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' +import { LanguageClient } from 'vscode-languageclient' +import { getLogger } from 'aws-core-vscode/shared' +import { globals } from 'aws-core-vscode/shared' +import { AmazonQInlineCompletionItemProvider } from './completion' +import { CodeSuggestionsState } from 'aws-core-vscode/codewhisperer' + +// Configuration section for cursor updates +export const cursorUpdateConfigurationSection = 'aws.q.cursorUpdate' + +/** + * Interface for recording completion requests + */ +export interface ICursorUpdateRecorder { + recordCompletionRequest(): void +} + +/** + * Manages periodic cursor position updates for Next Edit Prediction + */ +export class CursorUpdateManager implements vscode.Disposable, ICursorUpdateRecorder { + private readonly logger = getLogger('amazonqLsp') + private updateIntervalMs = 250 + private updateTimer?: NodeJS.Timeout + private lastPosition?: vscode.Position + private lastDocumentUri?: string + private lastSentPosition?: vscode.Position + private lastSentDocumentUri?: string + private isActive = false + private lastRequestTime = 0 + private autotriggerStateDisposable?: vscode.Disposable + + constructor( + private readonly languageClient: LanguageClient, + private readonly inlineCompletionProvider?: AmazonQInlineCompletionItemProvider + ) { + // Listen for autotrigger state changes to enable/disable the timer + this.autotriggerStateDisposable = CodeSuggestionsState.instance.onDidChangeState((isEnabled: boolean) => { + if (isEnabled && this.isActive) { + // If autotrigger is enabled and we're active, ensure timer is running + this.setupUpdateTimer() + } else { + // If autotrigger is disabled, clear the timer but keep isActive state + this.clearUpdateTimer() + } + }) + } + + /** + * Start tracking cursor positions and sending periodic updates + */ + public async start(): Promise { + if (this.isActive) { + return + } + + // Request configuration from server + try { + const config = await this.languageClient.sendRequest('aws/getConfigurationFromServer', { + section: cursorUpdateConfigurationSection, + }) + + if ( + config && + typeof config === 'object' && + 'intervalMs' in config && + typeof config.intervalMs === 'number' && + config.intervalMs > 0 + ) { + this.updateIntervalMs = config.intervalMs + } + } catch (error) { + this.logger.warn(`Failed to get cursor update configuration from server: ${error}`) + } + + this.isActive = true + if (CodeSuggestionsState.instance.isSuggestionsEnabled()) { + this.setupUpdateTimer() + } + } + + /** + * Stop tracking cursor positions and sending updates + */ + public stop(): void { + this.isActive = false + this.clearUpdateTimer() + } + + /** + * Update the current cursor position + */ + public updatePosition(position: vscode.Position, documentUri: string): void { + // If the document changed, set the last sent position to the current position + // This prevents triggering an immediate recommendation when switching tabs + if (this.lastDocumentUri !== documentUri) { + this.lastSentPosition = position.with() // Create a copy + this.lastSentDocumentUri = documentUri + } + + this.lastPosition = position.with() // Create a copy + this.lastDocumentUri = documentUri + } + + /** + * Record that a regular InlineCompletionWithReferences request was made + * This will prevent cursor updates from being sent for the update interval + */ + public recordCompletionRequest(): void { + this.lastRequestTime = globals.clock.Date.now() + } + + /** + * Set up the timer for periodic cursor position updates + */ + private setupUpdateTimer(): void { + this.clearUpdateTimer() + + this.updateTimer = globals.clock.setInterval(async () => { + await this.sendCursorUpdate() + }, this.updateIntervalMs) + } + + /** + * Clear the update timer + */ + private clearUpdateTimer(): void { + if (this.updateTimer) { + globals.clock.clearInterval(this.updateTimer) + this.updateTimer = undefined + } + } + + /** + * Creates a cancellation token source + * This method exists to make testing easier by allowing it to be stubbed + */ + private createCancellationTokenSource(): vscode.CancellationTokenSource { + return new vscode.CancellationTokenSource() + } + + /** + * Request LSP generate a completion for the current cursor position. + */ + private async sendCursorUpdate(): Promise { + // Don't send an update if a regular request was made recently + const now = globals.clock.Date.now() + if (now - this.lastRequestTime < this.updateIntervalMs) { + return + } + + const editor = vscode.window.activeTextEditor + if (!editor || editor.document.uri.toString() !== this.lastDocumentUri) { + return + } + + // Don't send an update if the position hasn't changed since the last update + if ( + this.lastSentPosition && + this.lastPosition && + this.lastSentDocumentUri === this.lastDocumentUri && + this.lastSentPosition.line === this.lastPosition.line && + this.lastSentPosition.character === this.lastPosition.character + ) { + return + } + + // Only proceed if we have a valid position and provider + if (this.lastPosition && this.inlineCompletionProvider) { + const position = this.lastPosition.with() // Create a copy + + // Call the inline completion provider instead of directly calling getAllRecommendations + try { + await this.inlineCompletionProvider.provideInlineCompletionItems( + editor.document, + position, + { + triggerKind: vscode.InlineCompletionTriggerKind.Automatic, + selectedCompletionInfo: undefined, + }, + this.createCancellationTokenSource().token, + { emitTelemetry: false, showUi: false } + ) + + // Only update the last sent position after successfully sending the request + this.lastSentPosition = position + this.lastSentDocumentUri = this.lastDocumentUri + } catch (error) { + this.logger.error(`Error sending cursor update: ${error}`) + } + } + } + + /** + * Dispose of resources + */ + public dispose(): void { + // Dispose of the autotrigger state change listener + if (this.autotriggerStateDisposable) { + this.autotriggerStateDisposable.dispose() + this.autotriggerStateDisposable = undefined + } + + this.stop() + } +} diff --git a/packages/amazonq/src/app/inline/documentEventListener.ts b/packages/amazonq/src/app/inline/documentEventListener.ts new file mode 100644 index 00000000000..36f65dc7331 --- /dev/null +++ b/packages/amazonq/src/app/inline/documentEventListener.ts @@ -0,0 +1,69 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ +import * as vscode from 'vscode' + +export interface DocumentChangeEvent { + event: vscode.TextDocumentChangeEvent + timestamp: number +} + +export class DocumentEventListener { + private lastDocumentChangeEventMap: Map = new Map() + private documentChangeListener: vscode.Disposable + private _maxDocument = 1000 + + constructor() { + this.documentChangeListener = vscode.workspace.onDidChangeTextDocument((e) => { + if (e.contentChanges.length > 0) { + if (this.lastDocumentChangeEventMap.size > this._maxDocument) { + this.lastDocumentChangeEventMap.clear() + } + this.lastDocumentChangeEventMap.set(e.document.uri.fsPath, { event: e, timestamp: performance.now() }) + // The VS Code provideInlineCompletionCallback may not trigger when Enter is pressed, especially in Python files + // manually make this trigger. In case of duplicate, the provideInlineCompletionCallback is already debounced + if (this.isEnter(e) && vscode.window.activeTextEditor) { + void vscode.commands.executeCommand('editor.action.inlineSuggest.trigger') + } + } + }) + } + + public isLastEventDeletion(filepath: string): boolean { + const result = this.lastDocumentChangeEventMap.get(filepath) + if (result) { + const event = result.event + const eventTime = result.timestamp + const isDelete = + (event && event.contentChanges.length === 1 && event.contentChanges[0].text === '') || false + const timeDiff = Math.abs(performance.now() - eventTime) + return timeDiff < 500 && isDelete + } + return false + } + + public getLastDocumentChangeEvent(filepath: string): DocumentChangeEvent | undefined { + return this.lastDocumentChangeEventMap.get(filepath) + } + + public dispose(): void { + if (this.documentChangeListener) { + this.documentChangeListener.dispose() + } + } + + private isEnter(e: vscode.TextDocumentChangeEvent): boolean { + if (e.contentChanges.length !== 1) { + return false + } + const str = e.contentChanges[0].text + if (str.length === 0) { + return false + } + return ( + (str.startsWith('\r\n') && str.substring(2).trim() === '') || + (str[0] === '\n' && str.substring(1).trim() === '') + ) + } +} diff --git a/packages/amazonq/src/app/inline/editSuggestionState.ts b/packages/amazonq/src/app/inline/editSuggestionState.ts new file mode 100644 index 00000000000..66a9211bdcf --- /dev/null +++ b/packages/amazonq/src/app/inline/editSuggestionState.ts @@ -0,0 +1,19 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * Manages the state of edit suggestions to avoid circular dependencies + */ +export class EditSuggestionState { + private static isEditSuggestionCurrentlyActive = false + + static setEditSuggestionActive(active: boolean): void { + this.isEditSuggestionCurrentlyActive = active + } + + static isEditSuggestionActive(): boolean { + return this.isEditSuggestionCurrentlyActive + } +} diff --git a/packages/amazonq/src/app/inline/inlineGeneratingMessage.ts b/packages/amazonq/src/app/inline/inlineGeneratingMessage.ts deleted file mode 100644 index 6c2d97fdad2..00000000000 --- a/packages/amazonq/src/app/inline/inlineGeneratingMessage.ts +++ /dev/null @@ -1,98 +0,0 @@ -/*! - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -import { editorUtilities } from 'aws-core-vscode/shared' -import * as vscode from 'vscode' -import { LineSelection, LineTracker } from './stateTracker/lineTracker' -import { AuthUtil } from 'aws-core-vscode/codewhisperer' -import { cancellableDebounce } from 'aws-core-vscode/utils' - -/** - * Manages the inline ghost text message show when Inline Suggestions is "thinking". - */ -export class InlineGeneratingMessage implements vscode.Disposable { - private readonly _disposable: vscode.Disposable - - private readonly cwLineHintDecoration: vscode.TextEditorDecorationType = - vscode.window.createTextEditorDecorationType({ - after: { - margin: '0 0 0 3em', - contentText: 'Amazon Q is generating...', - textDecoration: 'none', - fontWeight: 'normal', - fontStyle: 'normal', - color: 'var(--vscode-editorCodeLens-foreground)', - }, - rangeBehavior: vscode.DecorationRangeBehavior.OpenOpen, - isWholeLine: true, - }) - - constructor(private readonly lineTracker: LineTracker) { - this._disposable = vscode.Disposable.from( - AuthUtil.instance.auth.onDidChangeConnectionState(async (e) => { - if (e.state !== 'authenticating') { - this.hideGenerating() - } - }), - AuthUtil.instance.secondaryAuth.onDidChangeActiveConnection(async () => { - this.hideGenerating() - }) - ) - } - - dispose() { - this._disposable.dispose() - } - - readonly refreshDebounced = cancellableDebounce(async () => { - await this._refresh(true) - }, 1000) - - async showGenerating(triggerType: vscode.InlineCompletionTriggerKind) { - if (triggerType === vscode.InlineCompletionTriggerKind.Invoke) { - // if user triggers on demand, immediately update the UI and cancel the previous debounced update if there is one - this.refreshDebounced.cancel() - await this._refresh(true) - } else { - await this.refreshDebounced.promise() - } - } - - async _refresh(shouldDisplay: boolean) { - const editor = vscode.window.activeTextEditor - if (!editor) { - return - } - - const selections = this.lineTracker.selections - if (!editor || !selections || !editorUtilities.isTextEditor(editor)) { - this.hideGenerating() - return - } - - if (!AuthUtil.instance.isConnectionValid()) { - this.hideGenerating() - return - } - - await this.updateDecorations(editor, selections, shouldDisplay) - } - - hideGenerating() { - vscode.window.activeTextEditor?.setDecorations(this.cwLineHintDecoration, []) - } - - async updateDecorations(editor: vscode.TextEditor, lines: LineSelection[], shouldDisplay: boolean) { - const range = editor.document.validateRange( - new vscode.Range(lines[0].active, lines[0].active, lines[0].active, lines[0].active) - ) - - if (shouldDisplay) { - editor.setDecorations(this.cwLineHintDecoration, [range]) - } else { - editor.setDecorations(this.cwLineHintDecoration, []) - } - } -} diff --git a/packages/amazonq/src/app/inline/recommendationService.ts b/packages/amazonq/src/app/inline/recommendationService.ts index eab2fc874b8..55c08c820fe 100644 --- a/packages/amazonq/src/app/inline/recommendationService.ts +++ b/packages/amazonq/src/app/inline/recommendationService.ts @@ -2,90 +2,243 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - import { InlineCompletionListWithReferences, InlineCompletionWithReferencesParams, inlineCompletionWithReferencesRequestType, + TextDocumentContentChangeEvent, + editCompletionRequestType, } from '@aws/language-server-runtimes/protocol' import { CancellationToken, InlineCompletionContext, Position, TextDocument } from 'vscode' import { LanguageClient } from 'vscode-languageclient' import { SessionManager } from './sessionManager' -import { InlineGeneratingMessage } from './inlineGeneratingMessage' -import { CodeWhispererStatusBarManager } from 'aws-core-vscode/codewhisperer' +import { + AuthUtil, + CodeWhispererConstants, + CodeWhispererStatusBarManager, + vsCodeState, +} from 'aws-core-vscode/codewhisperer' import { TelemetryHelper } from './telemetryHelper' +import { ICursorUpdateRecorder } from './cursorUpdateManager' +import { getLogger } from 'aws-core-vscode/shared' +import { DocumentEventListener } from './documentEventListener' +import { getOpenFilesInWindow } from 'aws-core-vscode/utils' +import { asyncCallWithTimeout } from '../../util/timeoutUtil' +import { EditSuggestionState } from './editSuggestionState' + +export interface GetAllRecommendationsOptions { + emitTelemetry?: boolean + showUi?: boolean + editsStreakToken?: number | string +} export class RecommendationService { constructor( private readonly sessionManager: SessionManager, - private readonly inlineGeneratingMessage: InlineGeneratingMessage + private cursorUpdateRecorder?: ICursorUpdateRecorder ) {} + /** + * Set the recommendation service + */ + public setCursorUpdateRecorder(recorder: ICursorUpdateRecorder): void { + this.cursorUpdateRecorder = recorder + } + + async getRecommendationsWithTimeout( + languageClient: LanguageClient, + request: InlineCompletionWithReferencesParams, + token: CancellationToken + ) { + const resultPromise: Promise = languageClient.sendRequest( + inlineCompletionWithReferencesRequestType.method, + request, + token + ) + return await asyncCallWithTimeout( + resultPromise, + `${inlineCompletionWithReferencesRequestType.method} time out`, + CodeWhispererConstants.promiseTimeoutLimit * 1000 + ) + } async getAllRecommendations( languageClient: LanguageClient, document: TextDocument, position: Position, context: InlineCompletionContext, - token: CancellationToken + token: CancellationToken, + isAutoTrigger: boolean, + documentEventListener: DocumentEventListener, + options: GetAllRecommendationsOptions = { emitTelemetry: true, showUi: true } ) { - const request: InlineCompletionWithReferencesParams = { + const documentChangeEvent = documentEventListener?.getLastDocumentChangeEvent(document.uri.fsPath)?.event + + // Record that a regular request is being made + this.cursorUpdateRecorder?.recordCompletionRequest() + const documentChangeParams = documentChangeEvent + ? { + textDocument: { + uri: document.uri.toString(), + version: document.version, + }, + contentChanges: documentChangeEvent.contentChanges.map((x) => x as TextDocumentContentChangeEvent), + } + : undefined + const openTabs = await getOpenFilesInWindow() + let request: InlineCompletionWithReferencesParams = { textDocument: { uri: document.uri.toString(), }, position, context, + documentChangeParams: documentChangeParams, + openTabFilepaths: openTabs, } - const requestStartTime = Date.now() + if (options.editsStreakToken) { + request = { ...request, partialResultToken: options.editsStreakToken } + } + const requestStartTime = performance.now() const statusBar = CodeWhispererStatusBarManager.instance + + // Only track telemetry if enabled TelemetryHelper.instance.setInvokeSuggestionStartTime() TelemetryHelper.instance.setPreprocessEndTime() TelemetryHelper.instance.setSdkApiCallStartTime() try { - // Show UI indicators that we are generating suggestions - await this.inlineGeneratingMessage.showGenerating(context.triggerKind) - await statusBar.setLoading() + // Show UI indicators only if UI is enabled + if (options.showUi) { + await statusBar.setLoading() + } // Handle first request - const firstResult: InlineCompletionListWithReferences = await languageClient.sendRequest( - inlineCompletionWithReferencesRequestType.method, + getLogger().info('Sending inline completion request: %O', { + method: inlineCompletionWithReferencesRequestType.method, + request: { + textDocument: request.textDocument, + position: request.position, + context: request.context, + nextToken: request.partialResultToken, + }, + }) + const t0 = performance.now() + + // Best effort estimate of deletion + const isTriggerByDeletion = documentEventListener.isLastEventDeletion(document.uri.fsPath) + + const ps: Promise[] = [] + /** + * IsTriggerByDeletion is to prevent user deletion invoking Completions. + * PartialResultToken is not a hack for now since only Edits suggestion use partialResultToken across different calls of [getAllRecommendations], + * Completions use PartialResultToken with single 1 call of [getAllRecommendations]. + * Edits leverage partialResultToken to achieve EditStreak such that clients can pull all continuous suggestions generated by the model within 1 EOS block. + */ + if (!isTriggerByDeletion && !request.partialResultToken && !EditSuggestionState.isEditSuggestionActive()) { + const completionPromise: Promise = languageClient.sendRequest( + inlineCompletionWithReferencesRequestType.method, + request, + token + ) + ps.push(completionPromise) + } + + /** + * Though Edit request is sent on keystrokes everytime, the language server will execute the request in a debounced manner so that it won't be immediately executed. + */ + const editPromise: Promise = languageClient.sendRequest( + editCompletionRequestType.method, request, token ) + ps.push(editPromise) + + /** + * First come first serve, ideally we should simply return the first response returned. However there are some caviar here because either + * (1) promise might be returned early without going through service + * (2) some users are not enabled with edits suggestion, therefore service will return empty result without passing through the model + * With the scenarios listed above or others, it's possible that 1 promise will ALWAYS win the race and users will NOT get any suggestion back. + * This is the hack to return first "NON-EMPTY" response + */ + let result = await Promise.race(ps) + if (ps.length > 1 && result.items.length === 0) { + for (const p of ps) { + const r = await p + if (r.items.length > 0) { + result = r + } + } + } + + getLogger().info('Received inline completion response from LSP: %O', { + sessionId: result.sessionId, + latency: performance.now() - t0, + itemCount: result.items?.length || 0, + items: result.items?.map((item) => ({ + itemId: item.itemId, + insertText: + (typeof item.insertText === 'string' ? item.insertText : String(item.insertText))?.substring( + 0, + 50 + ) + '...', + })), + }) - // Set telemetry data for the first response TelemetryHelper.instance.setSdkApiCallEndTime() - TelemetryHelper.instance.setSessionId(firstResult.sessionId) - if (firstResult.items.length > 0) { - TelemetryHelper.instance.setFirstResponseRequestId(firstResult.items[0].itemId) + TelemetryHelper.instance.setSessionId(result.sessionId) + if (result.items.length > 0 && result.items[0].itemId !== undefined) { + TelemetryHelper.instance.setFirstResponseRequestId(result.items[0].itemId as string) } TelemetryHelper.instance.setFirstSuggestionShowTime() - const firstCompletionDisplayLatency = Date.now() - requestStartTime + const firstCompletionDisplayLatency = performance.now() - requestStartTime this.sessionManager.startSession( - firstResult.sessionId, - firstResult.items, + result.sessionId, + result.items, requestStartTime, position, firstCompletionDisplayLatency ) - if (firstResult.partialResultToken) { - // If there are more results to fetch, handle them in the background - this.processRemainingRequests(languageClient, request, firstResult, token).catch((error) => { - languageClient.warn(`Error when getting suggestions: ${error}`) - }) - } else { - this.sessionManager.closeSession() - - // No more results to fetch, mark pagination as complete - TelemetryHelper.instance.setAllPaginationEndTime() - TelemetryHelper.instance.tryRecordClientComponentLatency() + const isInlineEdit = result.items.some((item) => item.isInlineEdit) + + // TODO: question, is it possible that the first request returns empty suggestion but has non-empty next token? + if (result.partialResultToken) { + if (!isInlineEdit) { + // If the suggestion is COMPLETIONS and there are more results to fetch, handle them in the background + getLogger().info( + 'Suggestion type is COMPLETIONS. Start fetching for more items if partialResultToken exists.' + ) + this.processRemainingRequests(languageClient, request, result, token).catch((error) => { + languageClient.warn(`Error when getting suggestions: ${error}`) + }) + } else { + // Skip fetching for more items if the suggesion is EDITS. If it is EDITS suggestion, only fetching for more + // suggestions when the user start to accept a suggesion. + // Save editsStreakPartialResultToken for the next EDITS suggestion trigger if user accepts. + getLogger().info('Suggestion type is EDITS. Skip fetching for more items.') + this.sessionManager.updateActiveEditsStreakToken(result.partialResultToken) + } } + } catch (error: any) { + getLogger().error('Error getting recommendations: %O', error) + // bearer token expired + if (error.data && error.data.awsErrorCode === 'E_AMAZON_Q_CONNECTION_EXPIRED') { + // ref: https://github.com/aws/aws-toolkit-vscode/blob/amazonq/v1.74.0/packages/core/src/codewhisperer/service/inlineCompletionService.ts#L104 + // show re-auth once if connection expired + if (AuthUtil.instance.isConnectionExpired()) { + await AuthUtil.instance.notifyReauthenticate(isAutoTrigger) + } else { + // get a new bearer token, if this failed, the connection will be marked as expired. + // new tokens will be synced per 10 seconds in auth.startTokenRefreshInterval + await AuthUtil.instance.getBearerToken() + } + } + return [] } finally { - // Remove all UI indicators of message generation since we are done - this.inlineGeneratingMessage.hideGenerating() - void statusBar.refreshStatusBar() // effectively "stop loading" + // Remove all UI indicators if UI is enabled + if (options.showUi) { + void statusBar.refreshStatusBar() // effectively "stop loading" + } } } @@ -98,17 +251,20 @@ export class RecommendationService { let nextToken = firstResult.partialResultToken while (nextToken) { const request = { ...initialRequest, partialResultToken: nextToken } - const result: InlineCompletionListWithReferences = await languageClient.sendRequest( - inlineCompletionWithReferencesRequestType.method, - request, - token - ) + + const result = await this.getRecommendationsWithTimeout(languageClient, request, token) + // when pagination is in progress, but user has already accepted or rejected an inline completion + // then stop pagination + if (this.sessionManager.getActiveSession() === undefined || vsCodeState.isCodeWhispererEditing) { + break + } this.sessionManager.updateSessionSuggestions(result.items) nextToken = result.partialResultToken } this.sessionManager.closeSession() + // refresh inline completion items to render paginated responses // All pagination requests completed TelemetryHelper.instance.setAllPaginationEndTime() TelemetryHelper.instance.tryRecordClientComponentLatency() diff --git a/packages/amazonq/src/app/inline/sessionManager.ts b/packages/amazonq/src/app/inline/sessionManager.ts index 6e052ddbfbe..15d7dbbb8d0 100644 --- a/packages/amazonq/src/app/inline/sessionManager.ts +++ b/packages/amazonq/src/app/inline/sessionManager.ts @@ -4,9 +4,15 @@ */ import * as vscode from 'vscode' import { InlineCompletionItemWithReferences } from '@aws/language-server-runtimes-types' +import { + FileDiagnostic, + getDiagnosticsOfCurrentFile, + ImportAdderProvider, + ReferenceInlineProvider, +} from 'aws-core-vscode/codewhisperer' // TODO: add more needed data to the session interface -interface CodeWhispererSession { +export interface CodeWhispererSession { sessionId: string suggestions: InlineCompletionItemWithReferences[] // TODO: might need to convert to enum states @@ -14,12 +20,21 @@ interface CodeWhispererSession { requestStartTime: number firstCompletionDisplayLatency?: number startPosition: vscode.Position + diagnosticsBeforeAccept: FileDiagnostic | undefined + // partialResultToken for the next trigger if user accepts an EDITS suggestion + editsStreakPartialResultToken?: number | string + triggerOnAcceptance?: boolean + // whether any suggestion in this session was displayed on screen + displayed: boolean + // timestamp when the suggestion was last visible + lastVisibleTime: number } export class SessionManager { private activeSession?: CodeWhispererSession private _acceptedSuggestionCount: number = 0 - + private _refreshedSessions = new Set() + private _currentSuggestionIndex = 0 constructor() {} public startSession( @@ -29,6 +44,7 @@ export class SessionManager { startPosition: vscode.Position, firstCompletionDisplayLatency?: number ) { + const diagnosticsBeforeAccept = getDiagnosticsOfCurrentFile() this.activeSession = { sessionId, suggestions, @@ -36,7 +52,11 @@ export class SessionManager { requestStartTime, startPosition, firstCompletionDisplayLatency, + diagnosticsBeforeAccept, + displayed: false, + lastVisibleTime: 0, } + this._currentSuggestionIndex = 0 } public closeSession() { @@ -69,7 +89,95 @@ export class SessionManager { this._acceptedSuggestionCount += 1 } + public updateActiveEditsStreakToken(partialResultToken: number | string) { + if (!this.activeSession) { + return + } + this.activeSession.editsStreakPartialResultToken = partialResultToken + } + public clear() { this.activeSession = undefined + this._currentSuggestionIndex = 0 + this.clearReferenceInlineHintsAndImportHints() + } + + // re-render the session ghost text to display paginated responses once per completed session + public async maybeRefreshSessionUx() { + if ( + this.activeSession && + !this.activeSession.isRequestInProgress && + !this._refreshedSessions.has(this.activeSession.sessionId) + ) { + await vscode.commands.executeCommand('editor.action.inlineSuggest.hide') + await vscode.commands.executeCommand('editor.action.inlineSuggest.trigger') + if (this._refreshedSessions.size > 1000) { + this._refreshedSessions.clear() + } + this._refreshedSessions.add(this.activeSession.sessionId) + } + } + + public onNextSuggestion() { + if (this.activeSession?.suggestions && this.activeSession?.suggestions.length > 0) { + this._currentSuggestionIndex = (this._currentSuggestionIndex + 1) % this.activeSession.suggestions.length + this.updateCodeReferenceAndImports() + } + } + + public onPrevSuggestion() { + if (this.activeSession?.suggestions && this.activeSession.suggestions.length > 0) { + this._currentSuggestionIndex = + (this._currentSuggestionIndex - 1 + this.activeSession.suggestions.length) % + this.activeSession.suggestions.length + this.updateCodeReferenceAndImports() + } + } + + public checkInlineSuggestionVisibility() { + if (this.activeSession) { + this.activeSession.displayed = true + this.activeSession.lastVisibleTime = performance.now() + } + } + + private clearReferenceInlineHintsAndImportHints() { + ReferenceInlineProvider.instance.removeInlineReference() + ImportAdderProvider.instance.clear() + } + + // Ideally use this API handleDidShowCompletionItem + // https://github.com/microsoft/vscode/blob/main/src/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts#L83 + updateCodeReferenceAndImports() { + try { + this.clearReferenceInlineHintsAndImportHints() + if ( + this.activeSession?.suggestions && + this.activeSession.suggestions[this._currentSuggestionIndex] && + this.activeSession.suggestions.length > 0 + ) { + const reference = this.activeSession.suggestions[this._currentSuggestionIndex].references + const insertText = this.activeSession.suggestions[this._currentSuggestionIndex].insertText + if (reference && reference.length > 0) { + const insertTextStr = + typeof insertText === 'string' ? insertText : (insertText.value ?? String(insertText)) + + ReferenceInlineProvider.instance.setInlineReference( + this.activeSession.startPosition.line, + insertTextStr, + reference + ) + } + if (vscode.window.activeTextEditor) { + ImportAdderProvider.instance.onShowRecommendation( + vscode.window.activeTextEditor.document, + this.activeSession.startPosition.line, + this.activeSession.suggestions[this._currentSuggestionIndex] + ) + } + } + } catch { + // do nothing as this is not critical path + } } } diff --git a/packages/amazonq/src/app/inline/tutorials/inlineTutorialAnnotation.ts b/packages/amazonq/src/app/inline/tutorials/inlineTutorialAnnotation.ts index bd12b1d28dd..ad0807df94c 100644 --- a/packages/amazonq/src/app/inline/tutorials/inlineTutorialAnnotation.ts +++ b/packages/amazonq/src/app/inline/tutorials/inlineTutorialAnnotation.ts @@ -5,13 +5,7 @@ import * as vscode from 'vscode' import * as os from 'os' -import { - AnnotationChangeSource, - AuthUtil, - inlinehintKey, - runtimeLanguageContext, - TelemetryHelper, -} from 'aws-core-vscode/codewhisperer' +import { AnnotationChangeSource, AuthUtil, inlinehintKey, runtimeLanguageContext } from 'aws-core-vscode/codewhisperer' import { editorUtilities, getLogger, globals, setContext, vscodeUtilities } from 'aws-core-vscode/shared' import { LinesChangeEvent, LineSelection, LineTracker } from '../stateTracker/lineTracker' import { telemetry } from 'aws-core-vscode/telemetry' @@ -296,28 +290,27 @@ export class InlineTutorialAnnotation implements vscode.Disposable { } async triggered(triggerType: vscode.InlineCompletionTriggerKind): Promise { - await telemetry.withTraceId(async () => { - if (!this._isReady) { - return - } - - if (this._currentState instanceof ManualtriggerState) { - if ( - triggerType === vscode.InlineCompletionTriggerKind.Invoke && - this._currentState.hasManualTrigger === false - ) { - this._currentState.hasManualTrigger = true - } - if ( - this.sessionManager.getActiveRecommendation().length > 0 && - this._currentState.hasValidResponse === false - ) { - this._currentState.hasValidResponse = true - } - } - - await this.refresh(vscode.window.activeTextEditor, 'codewhisperer') - }, TelemetryHelper.instance.traceId) + // TODO: this logic will take ~200ms each trigger, need to root cause and re-enable once it's fixed, or it should only be invoked when the tutorial is actually needed + // await telemetry.withTraceId(async () => { + // if (!this._isReady) { + // return + // } + // if (this._currentState instanceof ManualtriggerState) { + // if ( + // triggerType === vscode.InlineCompletionTriggerKind.Invoke && + // this._currentState.hasManualTrigger === false + // ) { + // this._currentState.hasManualTrigger = true + // } + // if ( + // this.sessionManager.getActiveRecommendation().length > 0 && + // this._currentState.hasValidResponse === false + // ) { + // this._currentState.hasValidResponse = true + // } + // } + // await this.refresh(vscode.window.activeTextEditor, 'codewhisperer') + // }, TelemetryHelper.instance.traceId) } isTutorialDone(): boolean { diff --git a/packages/amazonq/src/app/inline/webViewPanel.ts b/packages/amazonq/src/app/inline/webViewPanel.ts new file mode 100644 index 00000000000..2effa94429c --- /dev/null +++ b/packages/amazonq/src/app/inline/webViewPanel.ts @@ -0,0 +1,450 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' +/* eslint-disable no-restricted-imports */ +import fs from 'fs' +import { getLogger } from 'aws-core-vscode/shared' + +/** + * Interface for JSON request log data + */ +interface RequestLogEntry { + timestamp: string + request: string + response: string + endpoint: string + error: string + requestId: string + responseCode: number + applicationLogs?: { + rts?: string[] + ceo?: string[] + [key: string]: string[] | undefined + } + latency?: number + latencyBreakdown?: { + rts?: number + ceo?: number + [key: string]: number | undefined + } + miscellaneous?: any +} + +/** + * Manages the webview panel for displaying insert text content and request logs + */ +export class NextEditPredictionPanel implements vscode.Disposable { + public static readonly viewType = 'nextEditPrediction' + + private static instance: NextEditPredictionPanel | undefined + private panel: vscode.WebviewPanel | undefined + private disposables: vscode.Disposable[] = [] + private statusBarItem: vscode.StatusBarItem + private isVisible = false + private fileWatcher: vscode.FileSystemWatcher | undefined + private requestLogs: RequestLogEntry[] = [] + private logFilePath = '/tmp/request_log.jsonl' + private fileReadTimeout: NodeJS.Timeout | undefined + + private constructor() { + // Create status bar item - higher priority (1) to ensure visibility + this.statusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, 1) + this.statusBarItem.text = '$(eye) NEP' // Add icon for better visibility + this.statusBarItem.tooltip = 'Toggle Next Edit Prediction Panel' + this.statusBarItem.command = 'aws.amazonq.toggleNextEditPredictionPanel' + this.statusBarItem.show() + + // Register command for toggling the panel + this.disposables.push( + vscode.commands.registerCommand('aws.amazonq.toggleNextEditPredictionPanel', () => { + this.toggle() + }) + ) + } + + /** + * Get or create the NextEditPredictionPanel instance + */ + public static getInstance(): NextEditPredictionPanel { + if (!NextEditPredictionPanel.instance) { + NextEditPredictionPanel.instance = new NextEditPredictionPanel() + } + return NextEditPredictionPanel.instance + } + + /** + * Setup file watcher to monitor the request log file + */ + private setupFileWatcher(): void { + if (this.fileWatcher) { + return + } + + try { + // Create the watcher for the specific file + this.fileWatcher = vscode.workspace.createFileSystemWatcher(this.logFilePath) + + // When file is changed, read it after a delay + this.fileWatcher.onDidChange(() => { + this.scheduleFileRead() + }) + + // When file is created, read it after a delay + this.fileWatcher.onDidCreate(() => { + this.scheduleFileRead() + }) + + this.disposables.push(this.fileWatcher) + + // Initial read of the file if it exists + if (fs.existsSync(this.logFilePath)) { + this.scheduleFileRead() + } + + getLogger('nextEditPrediction').info(`File watcher set up for ${this.logFilePath}`) + } catch (error) { + getLogger('nextEditPrediction').error(`Error setting up file watcher: ${error}`) + } + } + + /** + * Schedule file read with a delay to ensure file is fully written + */ + private scheduleFileRead(): void { + // Clear any existing timeout + if (this.fileReadTimeout) { + clearTimeout(this.fileReadTimeout) + } + + // Schedule new read after 1 second delay + this.fileReadTimeout = setTimeout(() => { + this.readRequestLogFile() + }, 1000) + } + + /** + * Read the request log file and update the panel content + */ + private readRequestLogFile(): void { + getLogger('nextEditPrediction').info(`Attempting to read log file: ${this.logFilePath}`) + try { + if (!fs.existsSync(this.logFilePath)) { + getLogger('nextEditPrediction').info(`Log file does not exist: ${this.logFilePath}`) + return + } + + const content = fs.readFileSync(this.logFilePath, 'utf8') + this.requestLogs = [] + + // Process JSONL format (one JSON object per line) + const lines = content.split('\n').filter((line: string) => line.trim() !== '') + for (let i = 0; i < lines.length; i++) { + const line = lines[i].trim() + try { + // Try to parse the JSON, handling potential trailing characters + let jsonString = line + + // Find the last valid JSON by looking for the last closing brace/bracket + const lastClosingBrace = line.lastIndexOf('}') + const lastClosingBracket = line.lastIndexOf(']') + const lastValidChar = Math.max(lastClosingBrace, lastClosingBracket) + + if (lastValidChar > 0 && lastValidChar < line.length - 1) { + // If there are characters after the last valid JSON ending, trim them + jsonString = line.substring(0, lastValidChar + 1) + getLogger('nextEditPrediction').info(`Trimmed extra characters from line ${i + 1}`) + } + + // Step 1: Parse the JSON string to get an object + const parsed = JSON.parse(jsonString) + // Step 2: Stringify the object to normalize it + const normalized = JSON.stringify(parsed) + // Step 3: Parse the normalized string back to an object + const logEntry = JSON.parse(normalized) as RequestLogEntry + + // Parse request and response fields if they're JSON stringss + if (typeof logEntry.request === 'string') { + try { + // Apply the same double-parse technique to nested JSON + const requestObj = JSON.parse(logEntry.request) + const requestNormalized = JSON.stringify(requestObj) + logEntry.request = JSON.parse(requestNormalized) + } catch (e) { + // Keep as string if it's not valid JSON + getLogger('nextEditPrediction').info(`Could not parse request as JSON: ${e}`) + } + } + + if (typeof logEntry.response === 'string') { + try { + // Apply the same double-parse technique to nested JSON + const responseObj = JSON.parse(logEntry.response) + const responseNormalized = JSON.stringify(responseObj) + logEntry.response = JSON.parse(responseNormalized) + } catch (e) { + // Keep as string if it's not valid JSON + getLogger('nextEditPrediction').info(`Could not parse response as JSON: ${e}`) + } + } + + this.requestLogs.push(logEntry) + } catch (e) { + getLogger('nextEditPrediction').error(`Error parsing log entry ${i + 1}: ${e}`) + getLogger('nextEditPrediction').error( + `Problematic line: ${line.length > 100 ? line.substring(0, 100) + '...' : line}` + ) + } + } + + if (this.isVisible && this.panel) { + this.updateRequestLogsView() + } + + getLogger('nextEditPrediction').info(`Read ${this.requestLogs.length} log entries`) + } catch (error) { + getLogger('nextEditPrediction').error(`Error reading log file: ${error}`) + } + } + + /** + * Update the panel with request logs data + */ + private updateRequestLogsView(): void { + if (this.panel) { + this.panel.webview.html = this.getWebviewContent() + getLogger('nextEditPrediction').info('Webview panel updated with request logs') + } + } + + /** + * Toggle the panel visibility + */ + public toggle(): void { + if (this.isVisible) { + this.hide() + } else { + this.show() + } + } + + /** + * Show the panel + */ + public show(): void { + if (!this.panel) { + // Create the webview panel + this.panel = vscode.window.createWebviewPanel( + NextEditPredictionPanel.viewType, + 'Next Edit Prediction', + vscode.ViewColumn.Beside, + { + enableScripts: true, + retainContextWhenHidden: true, + } + ) + + // Set initial content + this.panel.webview.html = this.getWebviewContent() + + // Handle panel disposal + this.panel.onDidDispose( + () => { + this.panel = undefined + this.isVisible = false + this.updateStatusBarItem() + }, + undefined, + this.disposables + ) + + // Handle webview messages + this.panel.webview.onDidReceiveMessage( + (message) => { + switch (message.command) { + case 'refresh': + getLogger('nextEditPrediction').info(`Refresh button clicked`) + this.readRequestLogFile() + break + case 'clear': + getLogger('nextEditPrediction').info(`Clear logs button clicked`) + this.clearLogFile() + break + } + }, + undefined, + this.disposables + ) + } else { + this.panel.reveal() + } + + this.isVisible = true + this.updateStatusBarItem() + + // Setup file watcher when panel is shown + this.setupFileWatcher() + + // If we already have logs, update the view + if (this.requestLogs.length > 0) { + this.updateRequestLogsView() + } else { + // Try to read the log file + this.scheduleFileRead() + } + } + + /** + * Hide the panel + */ + private hide(): void { + if (this.panel) { + this.panel.dispose() + this.panel = undefined + this.isVisible = false + this.updateStatusBarItem() + } + } + + /** + * Update the status bar item appearance based on panel state + */ + private updateStatusBarItem(): void { + if (this.isVisible) { + this.statusBarItem.backgroundColor = new vscode.ThemeColor('statusBarItem.warningBackground') + } else { + this.statusBarItem.backgroundColor = undefined + } + } + + /** + * Update the panel content with new text + */ + public updateContent(text: string): void { + if (this.panel) { + try { + // Store the text for display in a separate section + const customContent = text + + // Update the panel with both the custom content and the request logs + this.panel.webview.html = this.getWebviewContent(customContent) + getLogger('nextEditPrediction').info('Webview panel content updated') + } catch (error) { + getLogger('nextEditPrediction').error(`Error updating webview: ${error}`) + } + } + } + + /** + * Generate HTML content for the webview + */ + private getWebviewContent(customContent?: string): string { + // Path to the debug.html file + const debugHtmlPath = vscode.Uri.file( + vscode.Uri.joinPath( + vscode.Uri.file(__dirname), + '..', + '..', + '..', + 'app', + 'inline', + 'EditRendering', + 'debug.html' + ).fsPath + ) + + // Read the HTML file content + try { + const htmlContent = fs.readFileSync(debugHtmlPath.fsPath, 'utf8') + getLogger('nextEditPrediction').info(`Successfully loaded debug.html from ${debugHtmlPath.fsPath}`) + + // Modify the HTML to add vscode API initialization + return htmlContent.replace( + '', + ` + + ` + ) + } catch (error) { + getLogger('nextEditPrediction').error(`Error loading debug.html: ${error}`) + return ` + + +

Error loading visualization

+

Failed to load debug.html file: ${error}

+ + + ` + } + } + + /** + * Clear the log file and update the panel + */ + private clearLogFile(): void { + try { + getLogger('nextEditPrediction').info(`Clearing log file: ${this.logFilePath}`) + + // Write an empty string to clear the file + fs.writeFileSync(this.logFilePath, '') + + // Clear the in-memory logs + this.requestLogs = [] + + // Update the view + if (this.isVisible && this.panel) { + this.updateRequestLogsView() + } + + getLogger('nextEditPrediction').info(`Log file cleared successfully`) + } catch (error) { + getLogger('nextEditPrediction').error(`Error clearing log file: ${error}`) + } + } + + /** + * Dispose of resources + */ + public dispose(): void { + if (this.panel) { + this.panel.dispose() + } + + if (this.fileWatcher) { + this.fileWatcher.dispose() + } + + if (this.fileReadTimeout) { + clearTimeout(this.fileReadTimeout) + } + + this.statusBarItem.dispose() + + for (const d of this.disposables) { + d.dispose() + } + this.disposables = [] + + NextEditPredictionPanel.instance = undefined + } +} diff --git a/packages/amazonq/src/extension.ts b/packages/amazonq/src/extension.ts index 65caea3b2c8..9b83695205c 100644 --- a/packages/amazonq/src/extension.ts +++ b/packages/amazonq/src/extension.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { Auth, AuthUtils, CredentialsStore, LoginManager, initializeAuth } from 'aws-core-vscode/auth' +import { AuthUtils, CredentialsStore, LoginManager, initializeAuth } from 'aws-core-vscode/auth' import { activate as activateCodeWhisperer, shutdown as shutdownCodeWhisperer } from 'aws-core-vscode/codewhisperer' import { makeEndpointsProvider, registerGenericCommands } from 'aws-core-vscode' import { CommonAuthWebview } from 'aws-core-vscode/login' @@ -44,8 +44,8 @@ import * as vscode from 'vscode' import { registerCommands } from './commands' import { focusAmazonQPanel } from 'aws-core-vscode/codewhispererChat' import { activate as activateAmazonqLsp } from './lsp/activation' -import { activate as activateInlineCompletion } from './app/inline/activation' import { hasGlibcPatch } from './lsp/client' +import { activateAutoDebug } from './lsp/chat/autoDebug/activation' export const amazonQContextPrefix = 'amazonq' @@ -122,20 +122,22 @@ export async function activateAmazonQCommon(context: vscode.ExtensionContext, is } // Configure proxy settings early - ProxyUtil.configureProxyForLanguageServer() + await ProxyUtil.configureProxyForLanguageServer() // This contains every lsp agnostic things (auth, security scan, code scan) await activateCodeWhisperer(extContext as ExtContext) - if ( - (Experiments.instance.get('amazonqLSP', true) || Auth.instance.isInternalAmazonUser()) && - (!isAmazonLinux2() || hasGlibcPatch()) - ) { - // start the Amazon Q LSP for internal users first - // for AL2, start LSP if glibc patch is found + + if (!isAmazonLinux2() || hasGlibcPatch()) { + // Activate Amazon Q LSP for everyone unless they're using AL2 without the glibc patch await activateAmazonqLsp(context) } - if (!Experiments.instance.get('amazonqLSPInline', true)) { - await activateInlineCompletion() + + // Activate AutoDebug feature at extension level + try { + const autoDebugFeature = await activateAutoDebug(context) + context.subscriptions.push(autoDebugFeature) + } catch (error) { + getLogger().error('Failed to activate AutoDebug feature at extension level: %s', error) } // Generic extension commands diff --git a/packages/amazonq/src/lsp/auth.ts b/packages/amazonq/src/lsp/auth.ts index 0bfee98f2e2..161ba4d9762 100644 --- a/packages/amazonq/src/lsp/auth.ts +++ b/packages/amazonq/src/lsp/auth.ts @@ -5,6 +5,7 @@ import { bearerCredentialsUpdateRequestType, + iamCredentialsUpdateRequestType, ConnectionMetadata, NotificationType, RequestType, @@ -17,8 +18,8 @@ import { LanguageClient } from 'vscode-languageclient' import { AuthUtil } from 'aws-core-vscode/codewhisperer' import { Writable } from 'stream' import { onceChanged } from 'aws-core-vscode/utils' -import { getLogger, oneMinute } from 'aws-core-vscode/shared' -import { isSsoConnection } from 'aws-core-vscode/auth' +import { getLogger, oneMinute, isSageMaker } from 'aws-core-vscode/shared' +import { isSsoConnection, isIamConnection } from 'aws-core-vscode/auth' export const encryptionKey = crypto.randomBytes(32) @@ -78,10 +79,16 @@ export class AmazonQLspAuth { */ async refreshConnection(force: boolean = false) { const activeConnection = this.authUtil.conn - if (this.authUtil.isConnectionValid() && isSsoConnection(activeConnection)) { - // send the token to the language server - const token = await this.authUtil.getBearerToken() - await (force ? this._updateBearerToken(token) : this.updateBearerToken(token)) + if (this.authUtil.isConnectionValid()) { + if (isSsoConnection(activeConnection)) { + // Existing SSO path + const token = await this.authUtil.getBearerToken() + await (force ? this._updateBearerToken(token) : this.updateBearerToken(token)) + } else if (isSageMaker() && isIamConnection(activeConnection)) { + // New SageMaker IAM path + const credentials = await this.authUtil.getCredentials() + await (force ? this._updateIamCredentials(credentials) : this.updateIamCredentials(credentials)) + } } } @@ -92,9 +99,7 @@ export class AmazonQLspAuth { public updateBearerToken = onceChanged(this._updateBearerToken.bind(this)) private async _updateBearerToken(token: string) { - const request = await this.createUpdateCredentialsRequest({ - token, - }) + const request = await this.createUpdateBearerCredentialsRequest(token) // "aws/credentials/token/update" // https://github.com/aws/language-servers/blob/44d81f0b5754747d77bda60b40cc70950413a737/core/aws-lsp-core/src/credentials/credentialsProvider.ts#L27 @@ -103,6 +108,26 @@ export class AmazonQLspAuth { this.client.info(`UpdateBearerToken: ${JSON.stringify(request)}`) } + public updateIamCredentials = onceChanged(this._updateIamCredentials.bind(this)) + private async _updateIamCredentials(credentials: any) { + getLogger().info( + `[SageMaker Debug] Updating IAM credentials - credentials received: ${credentials ? 'YES' : 'NO'}` + ) + if (credentials) { + getLogger().info( + `[SageMaker Debug] IAM credentials structure: accessKeyId=${credentials.accessKeyId ? 'present' : 'missing'}, secretAccessKey=${credentials.secretAccessKey ? 'present' : 'missing'}, sessionToken=${credentials.sessionToken ? 'present' : 'missing'}` + ) + } + + const request = await this.createUpdateIamCredentialsRequest(credentials) + + // "aws/credentials/iam/update" + await this.client.sendRequest(iamCredentialsUpdateRequestType.method, request) + + this.client.info(`UpdateIamCredentials: ${JSON.stringify(request)}`) + getLogger().info(`[SageMaker Debug] IAM credentials update request sent successfully`) + } + public startTokenRefreshInterval(pollingTime: number = oneMinute / 2) { const interval = setInterval(async () => { await this.refreshConnection().catch((e) => this.logRefreshError(e)) @@ -110,8 +135,9 @@ export class AmazonQLspAuth { return interval } - private async createUpdateCredentialsRequest(data: any): Promise { - const payload = new TextEncoder().encode(JSON.stringify({ data })) + private async createUpdateBearerCredentialsRequest(token: string): Promise { + const bearerCredentials = { token } + const payload = new TextEncoder().encode(JSON.stringify({ data: bearerCredentials })) const jwt = await new jose.CompactEncrypt(payload) .setProtectedHeader({ alg: 'dir', enc: 'A256GCM' }) @@ -127,4 +153,24 @@ export class AmazonQLspAuth { encrypted: true, } } + + private async createUpdateIamCredentialsRequest(credentials: any): Promise { + // Extract IAM credentials structure + const iamCredentials = { + accessKeyId: credentials.accessKeyId, + secretAccessKey: credentials.secretAccessKey, + sessionToken: credentials.sessionToken, + } + const payload = new TextEncoder().encode(JSON.stringify({ data: iamCredentials })) + + const jwt = await new jose.CompactEncrypt(payload) + .setProtectedHeader({ alg: 'dir', enc: 'A256GCM' }) + .encrypt(encryptionKey) + + return { + data: jwt, + // Omit metadata for IAM credentials since startUrl is undefined for non-SSO connections + encrypted: true, + } + } } diff --git a/packages/amazonq/src/lsp/chat/activation.ts b/packages/amazonq/src/lsp/chat/activation.ts index 90a0adbc61f..1f443bed875 100644 --- a/packages/amazonq/src/lsp/chat/activation.ts +++ b/packages/amazonq/src/lsp/chat/activation.ts @@ -17,12 +17,16 @@ import { activate as registerLegacyChatListeners } from '../../app/chat/activati import { DefaultAmazonQAppInitContext } from 'aws-core-vscode/amazonq' import { AuthUtil, getSelectedCustomization } from 'aws-core-vscode/codewhisperer' import { pushConfigUpdate } from '../config' +import { AutoDebugLspClient } from './autoDebug/lsp/autoDebugLspClient' export async function activate(languageClient: LanguageClient, encryptionKey: Buffer, mynahUIPath: string) { const disposables = globals.context.subscriptions const provider = new AmazonQChatViewProvider(mynahUIPath, languageClient) + // Set the chat view provider for AutoDebug to use + AutoDebugLspClient.setChatViewProvider(provider) + disposables.push( window.registerWebviewViewProvider(AmazonQChatViewProvider.viewType, provider, { webviewOptions: { diff --git a/packages/amazonq/src/lsp/chat/autoDebug/activation.ts b/packages/amazonq/src/lsp/chat/autoDebug/activation.ts new file mode 100644 index 00000000000..f18c82c237a --- /dev/null +++ b/packages/amazonq/src/lsp/chat/autoDebug/activation.ts @@ -0,0 +1,78 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' +import { getLogger } from 'aws-core-vscode/shared' +import { AutoDebugCommands } from './commands' +import { AutoDebugCodeActionsProvider } from './codeActionsProvider' +import { AutoDebugController } from './controller' + +/** + * Auto Debug feature activation for Amazon Q + * This handles the complete lifecycle of the auto debug feature + */ +export class AutoDebugFeature implements vscode.Disposable { + private readonly logger = getLogger() + private readonly disposables: vscode.Disposable[] = [] + + private autoDebugCommands?: AutoDebugCommands + private codeActionsProvider?: AutoDebugCodeActionsProvider + private controller?: AutoDebugController + + constructor(private readonly context: vscode.ExtensionContext) {} + + /** + * Activate the auto debug feature + */ + async activate(): Promise { + try { + // Initialize the controller first + this.controller = new AutoDebugController() + + // Initialize commands and register them with the controller + this.autoDebugCommands = new AutoDebugCommands() + this.autoDebugCommands.registerCommands(this.context, this.controller) + + // Initialize code actions provider + this.codeActionsProvider = new AutoDebugCodeActionsProvider() + this.context.subscriptions.push(this.codeActionsProvider) + + // Add all to disposables + this.disposables.push(this.controller, this.autoDebugCommands, this.codeActionsProvider) + } catch (error) { + this.logger.error('AutoDebugFeature: Failed to activate auto debug feature: %s', error) + throw error + } + } + + /** + * Get the auto debug controller instance + */ + getController(): AutoDebugController | undefined { + return this.controller + } + + /** + * Dispose of all resources + */ + dispose(): void { + vscode.Disposable.from(...this.disposables).dispose() + } +} + +/** + * Factory function to activate auto debug feature with LSP client + * This is the main entry point for activating auto debug + */ +export async function activateAutoDebug( + context: vscode.ExtensionContext, + client?: any, + encryptionKey?: Buffer +): Promise { + const feature = new AutoDebugFeature(context) + await feature.activate() + + return feature +} diff --git a/packages/amazonq/src/lsp/chat/autoDebug/codeActionsProvider.ts b/packages/amazonq/src/lsp/chat/autoDebug/codeActionsProvider.ts new file mode 100644 index 00000000000..aed926eaacf --- /dev/null +++ b/packages/amazonq/src/lsp/chat/autoDebug/codeActionsProvider.ts @@ -0,0 +1,119 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' + +/** + * Provides code actions for Amazon Q Auto Debug features. + * Integrates with VS Code's quick fix system to offer debugging assistance. + */ +export class AutoDebugCodeActionsProvider implements vscode.CodeActionProvider, vscode.Disposable { + private readonly disposables: vscode.Disposable[] = [] + + public static readonly providedCodeActionKinds = [vscode.CodeActionKind.QuickFix, vscode.CodeActionKind.Refactor] + + constructor() { + this.registerProvider() + } + + private registerProvider(): void { + // Register for all file types + const selector: vscode.DocumentSelector = [{ scheme: 'file' }] + + this.disposables.push( + vscode.languages.registerCodeActionsProvider(selector, this, { + providedCodeActionKinds: AutoDebugCodeActionsProvider.providedCodeActionKinds, + }) + ) + } + + /** + * Provides code actions for the given document and range + */ + public provideCodeActions( + document: vscode.TextDocument, + range: vscode.Range | vscode.Selection, + context: vscode.CodeActionContext, + token: vscode.CancellationToken + ): vscode.ProviderResult<(vscode.CodeAction | vscode.Command)[]> { + if (token.isCancellationRequested) { + return [] + } + + const actions: vscode.CodeAction[] = [] + + // Get diagnostics for the current range + const diagnostics = context.diagnostics.filter( + (diagnostic) => diagnostic.range.intersection(range) !== undefined + ) + + if (diagnostics.length > 0) { + // Add "Fix with Amazon Q" action + actions.push(this.createFixWithQAction(document, range, diagnostics)) + + // Add "Fix All with Amazon Q" action + actions.push(this.createFixAllWithQAction(document)) + + // Add "Explain Problem" action + actions.push(this.createExplainProblemAction(document, range, diagnostics)) + } + return actions + } + + private createFixWithQAction( + document: vscode.TextDocument, + range: vscode.Range, + diagnostics: vscode.Diagnostic[] + ): vscode.CodeAction { + const action = new vscode.CodeAction( + `Amazon Q: Fix Problem (${diagnostics.length} issue${diagnostics.length !== 1 ? 's' : ''})`, + vscode.CodeActionKind.QuickFix + ) + + action.command = { + command: 'amazonq.01.fixWithQ', + title: 'Amazon Q: Fix Problem', + arguments: [range, diagnostics], + } + + action.diagnostics = diagnostics + action.isPreferred = true // Make this the preferred quick fix + + return action + } + + private createFixAllWithQAction(document: vscode.TextDocument): vscode.CodeAction { + const action = new vscode.CodeAction('Amazon Q: Fix All Errors', vscode.CodeActionKind.QuickFix) + + action.command = { + command: 'amazonq.02.fixAllWithQ', + title: 'Amazon Q: Fix All Errors', + } + + return action + } + + private createExplainProblemAction( + document: vscode.TextDocument, + range: vscode.Range, + diagnostics: vscode.Diagnostic[] + ): vscode.CodeAction { + const action = new vscode.CodeAction('Amazon Q: Explain Problem', vscode.CodeActionKind.QuickFix) + + action.command = { + command: 'amazonq.03.explainProblem', + title: 'Amazon Q: Explain Problem', + arguments: [range, diagnostics], + } + + action.diagnostics = diagnostics + + return action + } + + public dispose(): void { + vscode.Disposable.from(...this.disposables).dispose() + } +} diff --git a/packages/amazonq/src/lsp/chat/autoDebug/commands.ts b/packages/amazonq/src/lsp/chat/autoDebug/commands.ts new file mode 100644 index 00000000000..54dfd06a1dc --- /dev/null +++ b/packages/amazonq/src/lsp/chat/autoDebug/commands.ts @@ -0,0 +1,147 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' +import { Commands, getLogger, messages } from 'aws-core-vscode/shared' +import { AutoDebugController } from './controller' + +/** + * Auto Debug commands for Amazon Q + * Handles all command registrations and implementations + */ +export class AutoDebugCommands implements vscode.Disposable { + private readonly logger = getLogger() + private readonly disposables: vscode.Disposable[] = [] + private controller!: AutoDebugController + + /** + * Register all auto debug commands + */ + registerCommands(context: vscode.ExtensionContext, controller: AutoDebugController): void { + this.controller = controller + this.disposables.push( + // Fix with Amazon Q command + Commands.register( + { + id: 'amazonq.01.fixWithQ', + name: 'Amazon Q: Fix Problem', + }, + async (range?: vscode.Range, diagnostics?: vscode.Diagnostic[]) => { + await this.fixWithAmazonQ(range, diagnostics) + } + ), + + // Fix All with Amazon Q command + Commands.register( + { + id: 'amazonq.02.fixAllWithQ', + name: 'Amazon Q: Fix All Errors', + }, + async () => { + await this.fixAllWithAmazonQ() + } + ), + + // Explain Problem with Amazon Q command + Commands.register( + { + id: 'amazonq.03.explainProblem', + name: 'Amazon Q: Explain Problem', + }, + async (range?: vscode.Range, diagnostics?: vscode.Diagnostic[]) => { + await this.explainProblem(range, diagnostics) + } + ) + ) + + // Add all disposables to context + context.subscriptions.push(...this.disposables) + } + + /** + * Generic error handling wrapper for command execution + */ + private async executeWithErrorHandling( + action: () => Promise, + errorMessage: string, + logContext: string + ): Promise { + try { + return await action() + } catch (error) { + this.logger.error(`AutoDebugCommands: Error in ${logContext}: %s`, error) + void messages.showMessage('error', 'Amazon Q was not able to fix or explain the problem. Try again shortly') + } + } + + /** + * Check if there's an active editor and log warning if not + */ + private checkActiveEditor(): vscode.TextEditor | undefined { + const editor = vscode.window.activeTextEditor + if (!editor) { + this.logger.warn('AutoDebugCommands: No active editor found') + } + return editor + } + + /** + * Fix with Amazon Q - fixes only the specific issues the user selected + */ + private async fixWithAmazonQ(range?: vscode.Range, diagnostics?: vscode.Diagnostic[]): Promise { + await this.executeWithErrorHandling( + async () => { + const editor = this.checkActiveEditor() + if (!editor) { + return + } + await this.controller.fixSpecificProblems(range, diagnostics) + }, + 'Fix with Amazon Q', + 'fixWithAmazonQ' + ) + } + + /** + * Fix All with Amazon Q - processes all errors in the current file + */ + private async fixAllWithAmazonQ(): Promise { + await this.executeWithErrorHandling( + async () => { + const editor = this.checkActiveEditor() + if (!editor) { + return + } + await this.controller.fixAllProblemsInFile(10) // 10 errors per batch + }, + 'Fix All with Amazon Q', + 'fixAllWithAmazonQ' + ) + } + + /** + * Explains the problem using Amazon Q + */ + private async explainProblem(range?: vscode.Range, diagnostics?: vscode.Diagnostic[]): Promise { + await this.executeWithErrorHandling( + async () => { + const editor = this.checkActiveEditor() + if (!editor) { + return + } + await this.controller.explainProblems(range, diagnostics) + }, + 'Explain Problem', + 'explainProblem' + ) + } + + /** + * Dispose of all resources + */ + dispose(): void { + vscode.Disposable.from(...this.disposables).dispose() + } +} diff --git a/packages/amazonq/src/lsp/chat/autoDebug/controller.ts b/packages/amazonq/src/lsp/chat/autoDebug/controller.ts new file mode 100644 index 00000000000..0a0f8e10622 --- /dev/null +++ b/packages/amazonq/src/lsp/chat/autoDebug/controller.ts @@ -0,0 +1,204 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' +import { getLogger, randomUUID, messages } from 'aws-core-vscode/shared' +import { AutoDebugLspClient } from './lsp/autoDebugLspClient' +import { mapDiagnosticSeverity } from './shared/diagnosticUtils' +import { ErrorContextFormatter } from './diagnostics/errorContext' +import { Problem } from './diagnostics/problemDetector' +export interface AutoDebugConfig { + readonly enabled: boolean + readonly excludedSources: string[] + readonly severityFilter: ('error' | 'warning' | 'info' | 'hint')[] +} + +/** + * Simplified controller for Amazon Q Auto Debug system. + * Focuses on context menu and quick fix functionality without workspace-wide monitoring. + */ +export class AutoDebugController implements vscode.Disposable { + private readonly logger = getLogger() + private readonly lspClient: AutoDebugLspClient + private readonly errorFormatter: ErrorContextFormatter + private readonly disposables: vscode.Disposable[] = [] + + private config: AutoDebugConfig + + constructor(config?: Partial) { + this.config = { + enabled: true, + excludedSources: [], // No default exclusions - let users configure as needed + severityFilter: ['error'], // Only auto-fix errors, not warnings + ...config, + } + + this.lspClient = new AutoDebugLspClient() + this.errorFormatter = new ErrorContextFormatter() + } + + /** + * Extract common logic for getting problems from diagnostics + */ + private async getProblemsFromDiagnostics( + range?: vscode.Range, + diagnostics?: vscode.Diagnostic[] + ): Promise<{ editor: vscode.TextEditor; problems: Problem[] } | undefined> { + const editor = vscode.window.activeTextEditor + if (!editor) { + throw new Error('No active editor found') + } + + // Use provided diagnostics or get diagnostics for the range + let targetDiagnostics = diagnostics + if (!targetDiagnostics && range) { + const allDiagnostics = vscode.languages.getDiagnostics(editor.document.uri) + targetDiagnostics = allDiagnostics.filter((d) => d.range.intersection(range) !== undefined) + } + + if (!targetDiagnostics || targetDiagnostics.length === 0) { + return undefined + } + + // Convert diagnostics to problems + const problems = targetDiagnostics.map((diagnostic) => ({ + uri: editor.document.uri, + diagnostic, + severity: mapDiagnosticSeverity(diagnostic.severity), + source: diagnostic.source || 'unknown', + isNew: false, + })) + + return { editor, problems } + } + + /** + * Filter diagnostics to only errors and apply source filtering + */ + private filterErrorDiagnostics(diagnostics: vscode.Diagnostic[]): vscode.Diagnostic[] { + return diagnostics.filter((d) => { + if (d.severity !== vscode.DiagnosticSeverity.Error) { + return false + } + // Apply source filtering + if (this.config.excludedSources.length > 0 && d.source) { + return !this.config.excludedSources.includes(d.source) + } + return true + }) + } + + /** + * Fix specific problems in the code + */ + async fixSpecificProblems(range?: vscode.Range, diagnostics?: vscode.Diagnostic[]): Promise { + try { + const result = await this.getProblemsFromDiagnostics(range, diagnostics) + if (!result) { + return + } + const fixMessage = this.createFixMessage(result.editor.document.uri.fsPath, result.problems) + await this.sendMessageToChat(fixMessage) + } catch (error) { + this.logger.error('AutoDebugController: Error fixing specific problems: %s', error) + throw error + } + } + + /** + * Fix with Amazon Q - sends up to 15 error messages one time when user clicks the button + */ + public async fixAllProblemsInFile(maxProblems: number = 15): Promise { + try { + const editor = vscode.window.activeTextEditor + if (!editor) { + void messages.showMessage('warn', 'No active editor found') + return + } + + // Get all diagnostics for the current file + const allDiagnostics = vscode.languages.getDiagnostics(editor.document.uri) + const errorDiagnostics = this.filterErrorDiagnostics(allDiagnostics) + if (errorDiagnostics.length === 0) { + return + } + + // Take up to maxProblems errors (15 by default) + const diagnosticsToFix = errorDiagnostics.slice(0, maxProblems) + const result = await this.getProblemsFromDiagnostics(undefined, diagnosticsToFix) + if (!result) { + return + } + + const fixMessage = this.createFixMessage(result.editor.document.uri.fsPath, result.problems) + await this.sendMessageToChat(fixMessage) + } catch (error) { + this.logger.error('AutoDebugController: Error in fix process: %s', error) + } + } + + /** + * Explain problems using Amazon Q + */ + async explainProblems(range?: vscode.Range, diagnostics?: vscode.Diagnostic[]): Promise { + try { + const result = await this.getProblemsFromDiagnostics(range, diagnostics) + if (!result) { + return + } + const explainMessage = this.createExplainMessage(result.editor.document.uri.fsPath, result.problems) + await this.sendMessageToChat(explainMessage) + } catch (error) { + this.logger.error('AutoDebugController: Error explaining problems: %s', error) + throw error + } + } + + private createFixMessage(filePath: string, problems: Problem[]): string { + const workspaceRoot = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath || '' + const formattedProblems = this.errorFormatter.formatProblemsString(problems, workspaceRoot) + + return `Please help me fix the following errors in ${filePath}:${formattedProblems}` + } + + private createExplainMessage(filePath: string, problems: Problem[]): string { + const workspaceRoot = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath || '' + const formattedProblems = this.errorFormatter.formatProblemsString(problems, workspaceRoot) + + return `Please explain the following problems in ${filePath}. DO NOT edit files. ONLY provide explanation:${formattedProblems}` + } + + /** + * Sends message directly to language server bypassing webview connectors + * This ensures messages go through the proper LSP chat system + */ + private async sendMessageToChat(message: string): Promise { + const triggerID = randomUUID() + try { + const success = await this.lspClient.sendChatMessage({ + message: message, + triggerType: 'autoDebug', + eventId: triggerID, + }) + + if (success) { + this.logger.debug('AutoDebugController: Chat message sent successfully through LSP client') + } else { + this.logger.error('AutoDebugController: Failed to send chat message through LSP client') + throw new Error('Failed to send message through LSP client') + } + } catch (error) { + this.logger.error( + 'AutoDebugController: Error sending message through LSP client with triggerID %s: %s', + triggerID, + error + ) + } + } + + public dispose(): void { + vscode.Disposable.from(...this.disposables).dispose() + } +} diff --git a/packages/amazonq/src/lsp/chat/autoDebug/diagnostics/diagnosticsMonitor.ts b/packages/amazonq/src/lsp/chat/autoDebug/diagnostics/diagnosticsMonitor.ts new file mode 100644 index 00000000000..8f4000bf217 --- /dev/null +++ b/packages/amazonq/src/lsp/chat/autoDebug/diagnostics/diagnosticsMonitor.ts @@ -0,0 +1,22 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' + +export interface DiagnosticCollection { + readonly diagnostics: [vscode.Uri, vscode.Diagnostic[]][] + readonly timestamp: number +} + +export interface DiagnosticSnapshot { + readonly diagnostics: DiagnosticCollection + readonly captureTime: number + readonly id: string +} + +export interface FileDiagnostics { + readonly uri: vscode.Uri + readonly diagnostics: vscode.Diagnostic[] +} diff --git a/packages/amazonq/src/lsp/chat/autoDebug/diagnostics/errorContext.ts b/packages/amazonq/src/lsp/chat/autoDebug/diagnostics/errorContext.ts new file mode 100644 index 00000000000..dee7bc0565a --- /dev/null +++ b/packages/amazonq/src/lsp/chat/autoDebug/diagnostics/errorContext.ts @@ -0,0 +1,75 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' +import * as path from 'path' +import { Problem } from './problemDetector' + +export interface ErrorContext { + readonly source: string + readonly severity: 'error' | 'warning' | 'info' | 'hint' + readonly location: { + readonly file: string + readonly line: number + readonly column: number + readonly range?: vscode.Range + } + readonly message: string + readonly code?: string | number + readonly relatedInformation?: vscode.DiagnosticRelatedInformation[] + readonly suggestedFixes?: vscode.CodeAction[] + readonly surroundingCode?: string +} + +export interface FormattedErrorReport { + readonly summary: string + readonly details: string + readonly contextualCode: string + readonly suggestions: string +} + +/** + * Formats diagnostic errors into contextual information for AI debugging assistance. + */ +export class ErrorContextFormatter { + /** + * Creates a problems string with Markdown formatting for better readability + */ + public formatProblemsString(problems: Problem[], cwd: string): string { + let result = '' + const fileGroups = this.groupProblemsByFile(problems) + + for (const [filePath, fileProblems] of fileGroups.entries()) { + if (fileProblems.length > 0) { + result += `\n\n**${path.relative(cwd, filePath)}**\n\n` + + // Group problems into a code block for better formatting + result += '```\n' + for (const problem of fileProblems) { + const line = problem.diagnostic.range.start.line + 1 + const source = problem.source ? `${problem.source}` : 'Unknown' + result += `[${source}] Line ${line}: ${problem.diagnostic.message}\n` + } + result += '```' + } + } + + return result.trim() + } + + private groupProblemsByFile(problems: Problem[]): Map { + const groups = new Map() + + for (const problem of problems) { + const filePath = problem.uri.fsPath + if (!groups.has(filePath)) { + groups.set(filePath, []) + } + groups.get(filePath)!.push(problem) + } + + return groups + } +} diff --git a/packages/amazonq/src/lsp/chat/autoDebug/diagnostics/problemDetector.ts b/packages/amazonq/src/lsp/chat/autoDebug/diagnostics/problemDetector.ts new file mode 100644 index 00000000000..44d00b55ca1 --- /dev/null +++ b/packages/amazonq/src/lsp/chat/autoDebug/diagnostics/problemDetector.ts @@ -0,0 +1,21 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' + +export interface Problem { + readonly uri: vscode.Uri + readonly diagnostic: vscode.Diagnostic + readonly severity: 'error' | 'warning' | 'info' | 'hint' + readonly source: string + readonly isNew: boolean +} + +export interface CategorizedProblems { + readonly errors: Problem[] + readonly warnings: Problem[] + readonly info: Problem[] + readonly hints: Problem[] +} diff --git a/packages/amazonq/src/lsp/chat/autoDebug/index.ts b/packages/amazonq/src/lsp/chat/autoDebug/index.ts new file mode 100644 index 00000000000..4819835066b --- /dev/null +++ b/packages/amazonq/src/lsp/chat/autoDebug/index.ts @@ -0,0 +1,18 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * Auto Debug feature for Amazon Q + * + * This module provides auto debug functionality including: + * - Command registration for fixing problems with Amazon Q + * - Code actions provider for quick fixes + * - Integration with VSCode's diagnostic system + */ + +export { AutoDebugFeature, activateAutoDebug } from './activation' +export { AutoDebugCommands } from './commands' +export { AutoDebugCodeActionsProvider } from './codeActionsProvider' +export { AutoDebugController } from './controller' diff --git a/packages/amazonq/src/lsp/chat/autoDebug/lsp/autoDebugLspClient.ts b/packages/amazonq/src/lsp/chat/autoDebug/lsp/autoDebugLspClient.ts new file mode 100644 index 00000000000..2d2d0ca3664 --- /dev/null +++ b/packages/amazonq/src/lsp/chat/autoDebug/lsp/autoDebugLspClient.ts @@ -0,0 +1,75 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ +import { getLogger, placeholder } from 'aws-core-vscode/shared' +import { focusAmazonQPanel } from 'aws-core-vscode/codewhispererChat' + +export class AutoDebugLspClient { + private readonly logger = getLogger() + private static chatViewProvider: any // AmazonQChatViewProvider instance + + /** + * Sets the chat view provider instance + */ + public static setChatViewProvider(provider: any): void { + AutoDebugLspClient.chatViewProvider = provider + } + + public async sendChatMessage(params: { message: string; triggerType: string; eventId: string }): Promise { + try { + // Ensure the chat view provider and webview are available + await this.ensureWebviewReady() + + // Get the webview provider from the static reference + const amazonQChatViewProvider = AutoDebugLspClient.chatViewProvider + + if (!amazonQChatViewProvider?.webview) { + this.logger.error( + 'AutoDebugLspClient: Amazon Q Chat View Provider webview not available after initialization' + ) + return false + } + + // Focus Amazon Q panel first using the imported function + await focusAmazonQPanel.execute(placeholder, 'autoDebug') + + // Wait for panel to focus + await new Promise((resolve) => setTimeout(resolve, 200)) + await amazonQChatViewProvider.webview.postMessage({ + command: 'sendToPrompt', + params: { + selection: '', + triggerType: 'autoDebug', + prompt: { + prompt: params.message, // what gets sent to the user + escapedPrompt: params.message, // what gets sent to the backend + }, + autoSubmit: true, // Automatically submit the message + }, + }) + return true + } catch (error) { + this.logger.error('AutoDebugLspClient: Error sending message via webview: %s', error) + return false + } + } + + /** + * Ensures that the chat view provider and its webview are ready for use + */ + private async ensureWebviewReady(): Promise { + if (!AutoDebugLspClient.chatViewProvider) { + await focusAmazonQPanel.execute(placeholder, 'autoDebug') + // wait 1 second for focusAmazonQPanel to finish + await new Promise((resolve) => setTimeout(resolve, 500)) + } + + // Now ensure the webview is created + if (!AutoDebugLspClient.chatViewProvider.webview) { + await focusAmazonQPanel.execute(placeholder, 'autoDebug') + // wait 1 second for webview to be created + await new Promise((resolve) => setTimeout(resolve, 500)) + } + } +} diff --git a/packages/amazonq/src/lsp/chat/autoDebug/shared/diagnosticUtils.ts b/packages/amazonq/src/lsp/chat/autoDebug/shared/diagnosticUtils.ts new file mode 100644 index 00000000000..bf466168347 --- /dev/null +++ b/packages/amazonq/src/lsp/chat/autoDebug/shared/diagnosticUtils.ts @@ -0,0 +1,35 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' +import { toIdeDiagnostics } from 'aws-core-vscode/codewhisperer' + +/** + * Maps VSCode DiagnosticSeverity to string representation + * Reuses the existing toIdeDiagnostics logic but returns lowercase format expected by Problem interface + */ +export function mapDiagnosticSeverity(severity: vscode.DiagnosticSeverity): 'error' | 'warning' | 'info' | 'hint' { + // Create a minimal diagnostic to use with toIdeDiagnostics + const tempDiagnostic: vscode.Diagnostic = { + range: new vscode.Range(0, 0, 0, 0), + message: '', + severity: severity, + } + + const ideDiagnostic = toIdeDiagnostics(tempDiagnostic) + // Convert uppercase severity to lowercase format expected by Problem interface + switch (ideDiagnostic.severity) { + case 'ERROR': + return 'error' + case 'WARNING': + return 'warning' + case 'INFORMATION': + return 'info' + case 'HINT': + return 'hint' + default: + return 'error' + } +} diff --git a/packages/amazonq/src/lsp/chat/commands.ts b/packages/amazonq/src/lsp/chat/commands.ts index 115118a4ad2..fca3a132f90 100644 --- a/packages/amazonq/src/lsp/chat/commands.ts +++ b/packages/amazonq/src/lsp/chat/commands.ts @@ -6,9 +6,12 @@ import { Commands, globals } from 'aws-core-vscode/shared' import { window } from 'vscode' import { AmazonQChatViewProvider } from './webviewProvider' -import { CodeScanIssue } from 'aws-core-vscode/codewhisperer' -import { EditorContextExtractor } from 'aws-core-vscode/codewhispererChat' -import { DefaultAmazonQAppInitContext } from 'aws-core-vscode/amazonq' +import { CodeScanIssue, AuthUtil } from 'aws-core-vscode/codewhisperer' +import { getLogger } from 'aws-core-vscode/shared' +import * as vscode from 'vscode' +import * as path from 'path' +import { codeReviewInChat } from '../../app/amazonqScan/models/constants' +import { telemetry, AmazonqCodeReviewTool } from 'aws-core-vscode/telemetry' /** * TODO: Re-enable these once we can figure out which path they're going to live in @@ -20,52 +23,28 @@ export function registerCommands(provider: AmazonQChatViewProvider) { registerGenericCommand('aws.amazonq.refactorCode', 'Refactor', provider), registerGenericCommand('aws.amazonq.fixCode', 'Fix', provider), registerGenericCommand('aws.amazonq.optimizeCode', 'Optimize', provider), - Commands.register('aws.amazonq.generateUnitTests', async () => { - DefaultAmazonQAppInitContext.instance.getAppsToWebViewMessagePublisher().publish({ - sender: 'testChat', - command: 'test', - type: 'chatMessage', - }) - }), - Commands.register('aws.amazonq.explainIssue', async (issue: CodeScanIssue) => { - void focusAmazonQPanel().then(async () => { - const editorContextExtractor = new EditorContextExtractor() - const extractedContext = await editorContextExtractor.extractContextForTrigger('ContextMenu') - const selectedCode = - extractedContext?.activeFileContext?.fileText - ?.split('\n') - .slice(issue.startLine, issue.endLine) - .join('\n') ?? '' - - // The message that gets sent to the UI - const uiMessage = [ - 'Explain the ', - issue.title, - ' issue in the following code:', - '\n```\n', - selectedCode, - '\n```', - ].join('') - - // The message that gets sent to the backend - const contextMessage = `Explain the issue "${issue.title}" (${JSON.stringify( - issue - )}) and generate code demonstrating the fix` + registerGenericCommand('aws.amazonq.generateUnitTests', 'Generate Tests', provider), - void provider.webview?.postMessage({ - command: 'sendToPrompt', - params: { - selection: '', - triggerType: 'contextMenu', - prompt: { - prompt: uiMessage, // what gets sent to the user - escapedPrompt: contextMessage, // what gets sent to the backend - }, - autoSubmit: true, - }, - }) - }) - }), + Commands.register('aws.amazonq.explainIssue', (issue: CodeScanIssue, filePath: string) => + handleIssueCommand( + issue, + filePath, + 'Explain', + 'Provide a small description of the issue. You must not attempt to fix the issue. You should only give a small summary of it to the user.', + provider, + 'explainIssue' + ) + ), + Commands.register('aws.amazonq.generateFix', (issue: CodeScanIssue, filePath: string) => + handleIssueCommand( + issue, + filePath, + 'Fix', + 'Generate a fix for the following code issue. You must not explain the issue, just generate and explain the fix. The user should have the option to accept or reject the fix before any code is changed.', + provider, + 'applyFix' + ) + ), Commands.register('aws.amazonq.sendToPrompt', (data) => { const triggerType = getCommandTriggerType(data) const selection = getSelectedText() @@ -84,8 +63,79 @@ export function registerCommands(provider: AmazonQChatViewProvider) { params: {}, }) }) - }) + }), + registerShellCommandShortCut('aws.amazonq.runCmdExecution', 'run-shell-command', provider), + registerShellCommandShortCut('aws.amazonq.rejectCmdExecution', 'reject-shell-command', provider), + registerShellCommandShortCut('aws.amazonq.stopCmdExecution', 'stop-shell-command', provider) ) + if (codeReviewInChat) { + globals.context.subscriptions.push( + registerGenericCommand('aws.amazonq.security.scan-statusbar', 'Review', provider) + ) + } +} + +async function handleIssueCommand( + issue: CodeScanIssue, + filePath: string, + action: string, + contextPrompt: string, + provider: AmazonQChatViewProvider, + metricName: string +) { + await focusAmazonQPanel() + + if (issue && filePath) { + await openFileWithSelection(issue, filePath) + } + + const lineRange = createLineRangeText(issue) + const visibleMessageInChat = `_${action} **${issue.title}** issue in **${path.basename(filePath)}** at \`${lineRange}\`_` + const contextMessage = `${contextPrompt} Code issue - ${JSON.stringify(issue)}` + + void provider.webview?.postMessage({ + command: 'sendToPrompt', + params: { + selection: '', + triggerType: 'contextMenu', + prompt: { + prompt: visibleMessageInChat, + escapedPrompt: contextMessage, + }, + autoSubmit: true, + }, + }) + + telemetry.amazonq_codeReviewTool.emit({ + findingId: issue.findingId, + detectorId: issue.detectorId, + ruleId: issue.ruleId, + credentialStartUrl: AuthUtil.instance.startUrl, + autoDetected: issue.autoDetected, + result: 'Succeeded', + reason: metricName, + } as AmazonqCodeReviewTool) +} + +async function openFileWithSelection(issue: CodeScanIssue, filePath: string) { + try { + const range = new vscode.Range(issue.startLine, 0, issue.endLine, 0) + const doc = await vscode.workspace.openTextDocument(filePath) + await vscode.window.showTextDocument(doc, { + selection: range, + viewColumn: vscode.ViewColumn.One, + preview: true, + }) + } catch (e) { + getLogger().error('openFileWithSelection: Failed to open file %s with selection: %O', filePath, e) + void vscode.window.showInformationMessage('Failed to display file with issue.') + } +} + +function createLineRangeText(issue: CodeScanIssue): string { + return issue.startLine === issue.endLine - 1 + ? `[${issue.startLine + 1}]` + : `[${issue.startLine + 1}, ${issue.endLine}]` } function getSelectedText(): string { @@ -129,3 +179,14 @@ export async function focusAmazonQPanel() { await Commands.tryExecute('aws.amazonq.AmazonQChatView.focus') await Commands.tryExecute('aws.amazonq.AmazonCommonAuth.focus') } + +function registerShellCommandShortCut(commandName: string, buttonId: string, provider: AmazonQChatViewProvider) { + return Commands.register(commandName, async () => { + void focusAmazonQPanel().then(() => { + void provider.webview?.postMessage({ + command: 'aws/chat/executeShellCommandShortCut', + params: { id: buttonId }, + }) + }) + }) +} diff --git a/packages/amazonq/src/lsp/chat/messages.ts b/packages/amazonq/src/lsp/chat/messages.ts index 74b56a9bada..16965e2f41f 100644 --- a/packages/amazonq/src/lsp/chat/messages.ts +++ b/packages/amazonq/src/lsp/chat/messages.ts @@ -16,6 +16,7 @@ import { ChatPromptOptionAcknowledgedMessage, STOP_CHAT_RESPONSE, StopChatResponseMessage, + OPEN_FILE_DIALOG, } from '@aws/chat-client-ui-types' import { ChatResult, @@ -60,13 +61,35 @@ import { ruleClickRequestType, pinnedContextNotificationType, activeEditorChangedNotificationType, + listAvailableModelsRequestType, + ShowOpenDialogRequestType, + ShowOpenDialogParams, + openFileDialogRequestType, + OpenFileDialogResult, } from '@aws/language-server-runtimes/protocol' import { v4 as uuidv4 } from 'uuid' import * as vscode from 'vscode' import { Disposable, LanguageClient, Position, TextDocumentIdentifier } from 'vscode-languageclient' import { AmazonQChatViewProvider } from './webviewProvider' -import { AuthUtil, ReferenceLogViewProvider } from 'aws-core-vscode/codewhisperer' -import { amazonQDiffScheme, AmazonQPromptSettings, messages, openUrl, isTextEditor } from 'aws-core-vscode/shared' +import { + AggregatedCodeScanIssue, + AuthUtil, + CodeAnalysisScope, + CodeWhispererSettings, + initSecurityScanRender, + ReferenceLogViewProvider, + SecurityIssueTreeViewProvider, + CodeWhispererConstants, +} from 'aws-core-vscode/codewhisperer' +import { + amazonQDiffScheme, + AmazonQPromptSettings, + messages, + openUrl, + isTextEditor, + globals, + setContext, +} from 'aws-core-vscode/shared' import { DefaultAmazonQAppInitContext, messageDispatcher, @@ -74,11 +97,13 @@ import { ViewDiffMessage, referenceLogText, } from 'aws-core-vscode/amazonq' -import { telemetry, TelemetryBase } from 'aws-core-vscode/telemetry' +import { telemetry } from 'aws-core-vscode/telemetry' import { isValidResponseError } from './error' import { decryptResponse, encryptRequest } from '../encryption' import { getCursorState } from '../utils' import { focusAmazonQPanel } from './commands' +import { ChatMessage } from '@aws/language-server-runtimes/server-interface' +import { CommentUtils } from 'aws-core-vscode/utils' export function registerActiveEditorChangeListener(languageClient: LanguageClient) { let debounceTimer: NodeJS.Timeout | undefined @@ -119,10 +144,13 @@ export function registerLanguageServerEventListener(languageClient: LanguageClie // This passes through metric data from LSP events to Toolkit telemetry with all fields from the LSP server languageClient.onTelemetry((e) => { const telemetryName: string = e.name - - if (telemetryName in telemetry) { - languageClient.info(`[VSCode Telemetry] Emitting ${telemetryName} telemetry: ${JSON.stringify(e.data)}`) - telemetry[telemetryName as keyof TelemetryBase].emit(e.data) + languageClient.info(`[VSCode Telemetry] Emitting ${telemetryName} telemetry: ${JSON.stringify(e.data)}`) + try { + // Flare is now the source of truth for metrics instead of depending on each IDE client and toolkit-common + const metric = (telemetry as any).getMetric(telemetryName) + metric?.emit(e.data) + } catch (error) { + languageClient.warn(`[VSCode Telemetry] Failed to emit ${telemetryName}: ${error}`) } }) } @@ -279,6 +307,31 @@ export function registerMessageListeners( } const chatRequest = await encryptRequest(chatParams, encryptionKey) + + // Add detailed logging for SageMaker debugging + if (process.env.USE_IAM_AUTH === 'true') { + languageClient.info(`[SageMaker Debug] Making chat request with IAM auth`) + languageClient.info(`[SageMaker Debug] Chat request method: ${chatRequestType.method}`) + languageClient.info( + `[SageMaker Debug] Original chat params: ${JSON.stringify( + { + tabId: chatParams.tabId, + prompt: chatParams.prompt, + // Don't log full textDocument content, just metadata + textDocument: chatParams.textDocument + ? { uri: chatParams.textDocument.uri } + : undefined, + context: chatParams.context ? `${chatParams.context.length} context items` : undefined, + }, + undefined, + 2 + )}` + ) + languageClient.info( + `[SageMaker Debug] Environment context: USE_IAM_AUTH=${process.env.USE_IAM_AUTH}, AWS_REGION=${process.env.AWS_REGION}` + ) + } + try { const chatResult = await languageClient.sendRequest( chatRequestType.method, @@ -288,12 +341,33 @@ export function registerMessageListeners( }, cancellationToken.token ) + + // Add response content logging for SageMaker debugging + if (process.env.USE_IAM_AUTH === 'true') { + languageClient.info(`[SageMaker Debug] Chat response received - type: ${typeof chatResult}`) + if (typeof chatResult === 'string') { + languageClient.info( + `[SageMaker Debug] Chat response (string): ${chatResult.substring(0, 200)}...` + ) + } else if (chatResult && typeof chatResult === 'object') { + languageClient.info( + `[SageMaker Debug] Chat response (object keys): ${Object.keys(chatResult)}` + ) + if ('message' in chatResult) { + languageClient.info( + `[SageMaker Debug] Chat response message: ${JSON.stringify(chatResult.message).substring(0, 200)}...` + ) + } + } + } + await handleCompleteResult( chatResult, encryptionKey, provider, chatParams.tabId, - chatDisposable + chatDisposable, + languageClient ) } catch (e) { const errorMsg = `Error occurred during chat request: ${e}` @@ -309,13 +383,27 @@ export function registerMessageListeners( encryptionKey, provider, chatParams.tabId, - chatDisposable + chatDisposable, + languageClient ) } finally { chatStreamTokens.delete(chatParams.tabId) } break } + case OPEN_FILE_DIALOG: { + // openFileDialog is the event emitted from webView to open + // file system + const result = await languageClient.sendRequest( + openFileDialogRequestType.method, + message.params + ) + void provider.webview?.postMessage({ + command: openFileDialogRequestType.method, + params: result, + }) + break + } case quickActionRequestType.method: { const quickActionPartialResultToken = uuidv4() const quickActionDisposable = languageClient.onProgress( @@ -340,7 +428,8 @@ export function registerMessageListeners( encryptionKey, provider, message.params.tabId, - quickActionDisposable + quickActionDisposable, + languageClient ) break } @@ -351,6 +440,41 @@ export function registerMessageListeners( case listMcpServersRequestType.method: case mcpServerClickRequestType.method: case tabBarActionRequestType.method: + // handling for show_logs button + if (message.params.action === 'show_logs') { + languageClient.info('[VSCode Client] Received show_logs action, showing disclaimer') + + // Show warning message without buttons - just informational + void vscode.window.showWarningMessage( + 'Log files may contain sensitive information such as account IDs, resource names, and other data. Be careful when sharing these logs.' + ) + + // Get the log directory path + const logFolderPath = globals.context.logUri?.fsPath + const result = { ...message.params, success: false } + + if (logFolderPath) { + // Open the log directory in the OS file explorer directly + languageClient.info('[VSCode Client] Opening logs directory') + const path = require('path') + const logFilePath = path.join(logFolderPath, 'Amazon Q Logs.log') + await vscode.commands.executeCommand('revealFileInOS', vscode.Uri.file(logFilePath)) + result.success = true + } else { + // Fallback: show error if log path is not available + void vscode.window.showErrorMessage('Log location not available.') + languageClient.error('[VSCode Client] Log location not available') + } + + void webview?.postMessage({ + command: message.command, + params: result, + }) + + break + } + // eslint-disable-next-line no-fallthrough + case listAvailableModelsRequestType.method: await resolveChatResponse(message.command, message.params, languageClient, webview) break case followUpClickNotificationType.method: @@ -372,6 +496,11 @@ export function registerMessageListeners( } default: if (isServerEvent(message.command)) { + if (enterFocus(message.params)) { + await setContext('aws.amazonq.amazonqChatLSP.isFocus', true) + } else if (exitFocus(message.params)) { + await setContext('aws.amazonq.amazonqChatLSP.isFocus', false) + } languageClient.sendNotification(message.command, message.params) } break @@ -461,6 +590,24 @@ export function registerMessageListeners( } }) + languageClient.onRequest(ShowOpenDialogRequestType.method, async (params: ShowOpenDialogParams) => { + try { + const uris = await vscode.window.showOpenDialog({ + canSelectFiles: params.canSelectFiles ?? true, + canSelectFolders: params.canSelectFolders ?? false, + canSelectMany: params.canSelectMany ?? false, + filters: params.filters, + defaultUri: params.defaultUri ? vscode.Uri.parse(params.defaultUri, false) : undefined, + title: params.title, + }) + const urisString = uris?.map((uri) => uri.fsPath) + return { uris: urisString || [] } + } catch (err) { + languageClient.error(`[VSCode Client] Failed to open file dialog: ${(err as Error).message}`) + return { uris: [] } + } + }) + languageClient.onRequest( ShowDocumentRequest.method, async (params: ShowDocumentParams): Promise> => { @@ -563,6 +710,14 @@ function isServerEvent(command: string) { return command.startsWith('aws/chat/') || command === 'telemetry/event' } +function enterFocus(params: any) { + return params.name === 'enterFocus' +} + +function exitFocus(params: any) { + return params.name === 'exitFocus' +} + /** * Decodes partial chat responses from the language server before sending them to mynah UI */ @@ -574,6 +729,16 @@ async function handlePartialResult( ) { const decryptedMessage = await decryptResponse(partialResult, encryptionKey) + // This is to filter out the message containing findings from CodeReview tool to update CodeIssues panel + decryptedMessage.additionalMessages = decryptedMessage.additionalMessages?.filter( + (message) => + !( + message.messageId !== undefined && + (message.messageId.endsWith(CodeWhispererConstants.codeReviewFindingsSuffix) || + message.messageId.endsWith(CodeWhispererConstants.displayFindingsSuffix)) + ) + ) + if (decryptedMessage.body !== undefined) { void provider.webview?.postMessage({ command: chatRequestType.method, @@ -594,10 +759,13 @@ async function handleCompleteResult( encryptionKey: Buffer | undefined, provider: AmazonQChatViewProvider, tabId: string, - disposable: Disposable + disposable: Disposable, + languageClient: LanguageClient ) { const decryptedMessage = await decryptResponse(result, encryptionKey) + await handleSecurityFindings(decryptedMessage, languageClient) + void provider.webview?.postMessage({ command: chatRequestType.method, params: decryptedMessage, @@ -611,6 +779,54 @@ async function handleCompleteResult( disposable.dispose() } +async function handleSecurityFindings( + decryptedMessage: { additionalMessages?: ChatMessage[] }, + languageClient: LanguageClient +): Promise { + if (decryptedMessage.additionalMessages === undefined || decryptedMessage.additionalMessages.length === 0) { + return + } + for (let i = decryptedMessage.additionalMessages.length - 1; i >= 0; i--) { + const message = decryptedMessage.additionalMessages[i] + if ( + message.messageId !== undefined && + (message.messageId.endsWith(CodeWhispererConstants.codeReviewFindingsSuffix) || + message.messageId.endsWith(CodeWhispererConstants.displayFindingsSuffix)) + ) { + if (message.body !== undefined) { + try { + const aggregatedCodeScanIssues: AggregatedCodeScanIssue[] = JSON.parse(message.body) + for (const aggregatedCodeScanIssue of aggregatedCodeScanIssues) { + const document = await vscode.workspace.openTextDocument(aggregatedCodeScanIssue.filePath) + for (const issue of aggregatedCodeScanIssue.issues) { + const isIssueTitleIgnored = CodeWhispererSettings.instance + .getIgnoredSecurityIssues() + .includes(issue.title) + const isSingleIssueIgnored = CommentUtils.detectCommentAboveLine( + document, + issue.startLine, + CodeWhispererConstants.amazonqIgnoreNextLine + ) + + issue.visible = !isIssueTitleIgnored && !isSingleIssueIgnored + } + } + initSecurityScanRender( + aggregatedCodeScanIssues, + undefined, + CodeAnalysisScope.AGENTIC, + message.messageId.endsWith(CodeWhispererConstants.codeReviewFindingsSuffix) + ) + SecurityIssueTreeViewProvider.focus() + } catch (e) { + languageClient.info('Failed to parse findings') + } + } + decryptedMessage.additionalMessages.splice(i, 1) + } + } +} + async function resolveChatResponse( requestMethod: string, params: any, diff --git a/packages/amazonq/src/lsp/chat/webviewProvider.ts b/packages/amazonq/src/lsp/chat/webviewProvider.ts index 7d51648398d..109a6afd10f 100644 --- a/packages/amazonq/src/lsp/chat/webviewProvider.ts +++ b/packages/amazonq/src/lsp/chat/webviewProvider.ts @@ -13,6 +13,7 @@ import { Webview, } from 'vscode' import * as path from 'path' +import * as os from 'os' import { globals, isSageMaker, @@ -149,7 +150,7 @@ export class AmazonQChatViewProvider implements WebviewViewProvider { const vscodeApi = acquireVsCodeApi() const hybridChatConnector = new HybridChatAdapter(${(await AuthUtil.instance.getChatAuthState()).amazonQ === 'connected'},${featureConfigData},${welcomeCount},${disclaimerAcknowledged},${regionProfileString},${disabledCommands},${isSMUS},${isSM},vscodeApi.postMessage) const commands = [hybridChatConnector.initialQuickActions[0]] - qChat = amazonQChat.createChat(vscodeApi, {disclaimerAcknowledged: ${disclaimerAcknowledged}, pairProgrammingAcknowledged: ${pairProgrammingAcknowledged}, agenticMode: true, quickActionCommands: commands, modelSelectionEnabled: ${modelSelectionEnabled}}, hybridChatConnector, ${JSON.stringify(featureConfigData)}); + qChat = amazonQChat.createChat(vscodeApi, {os: "${os.platform()}", disclaimerAcknowledged: ${disclaimerAcknowledged}, pairProgrammingAcknowledged: ${pairProgrammingAcknowledged}, agenticMode: true, quickActionCommands: commands, modelSelectionEnabled: ${modelSelectionEnabled}}, hybridChatConnector, ${JSON.stringify(featureConfigData)}); } window.addEventListener('message', (event) => { /** diff --git a/packages/amazonq/src/lsp/client.ts b/packages/amazonq/src/lsp/client.ts index c359ac73ded..bc065c8f620 100644 --- a/packages/amazonq/src/lsp/client.ts +++ b/packages/amazonq/src/lsp/client.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import vscode, { env, version } from 'vscode' +import vscode, { version } from 'vscode' import * as nls from 'vscode-nls' import { LanguageClient, LanguageClientOptions, RequestType, State } from 'vscode-languageclient' import { InlineCompletionManager } from '../app/inline/completion' @@ -12,17 +12,18 @@ import { CreateFilesParams, DeleteFilesParams, DidChangeWorkspaceFoldersParams, - DidSaveTextDocumentParams, GetConfigurationFromServerParams, RenameFilesParams, ResponseMessage, WorkspaceFolder, + ConnectionMetadata, } from '@aws/language-server-runtimes/protocol' import { AuthUtil, CodeWhispererSettings, getSelectedCustomization, TelemetryHelper, + vsCodeState, } from 'aws-core-vscode/codewhisperer' import { Settings, @@ -37,7 +38,10 @@ import { getOptOutPreference, isAmazonLinux2, getClientId, + getClientName, extensionVersion, + isSageMaker, + DevSettings, } from 'aws-core-vscode/shared' import { processUtils } from 'aws-core-vscode/shared' import { activate } from './chat/activation' @@ -49,15 +53,29 @@ import { SessionManager } from '../app/inline/sessionManager' import { LineTracker } from '../app/inline/stateTracker/lineTracker' import { InlineTutorialAnnotation } from '../app/inline/tutorials/inlineTutorialAnnotation' import { InlineChatTutorialAnnotation } from '../app/inline/tutorials/inlineChatTutorialAnnotation' +import { codeReviewInChat } from '../app/amazonqScan/models/constants' const localize = nls.loadMessageBundle() const logger = getLogger('amazonqLsp.lspClient') -export const glibcLinker: string = process.env.VSCODE_SERVER_CUSTOM_GLIBC_LINKER || '' -export const glibcPath: string = process.env.VSCODE_SERVER_CUSTOM_GLIBC_PATH || '' - export function hasGlibcPatch(): boolean { - return glibcLinker.length > 0 && glibcPath.length > 0 + // Skip GLIBC patching for SageMaker environments + if (isSageMaker()) { + getLogger('amazonqLsp').info('SageMaker environment detected in hasGlibcPatch, skipping GLIBC patching') + return false // Return false to ensure SageMaker doesn't try to use GLIBC patching + } + + // Check for environment variables (for CDM) + const glibcLinker = process.env.VSCODE_SERVER_CUSTOM_GLIBC_LINKER || '' + const glibcPath = process.env.VSCODE_SERVER_CUSTOM_GLIBC_PATH || '' + + if (glibcLinker.length > 0 && glibcPath.length > 0) { + getLogger('amazonqLsp').info('GLIBC patching environment variables detected') + return true + } + + // No environment variables, no patching needed + return false } export async function startLanguageServer( @@ -82,9 +100,24 @@ export async function startLanguageServer( const traceServerEnabled = Settings.instance.isSet(`${clientId}.trace.server`) let executable: string[] = [] // apply the GLIBC 2.28 path to node js runtime binary - if (isAmazonLinux2() && hasGlibcPatch()) { - executable = [glibcLinker, '--library-path', glibcPath, resourcePaths.node] - getLogger('amazonqLsp').info(`Patched node runtime with GLIBC to ${executable}`) + if (isSageMaker()) { + // SageMaker doesn't need GLIBC patching + getLogger('amazonqLsp').info('SageMaker environment detected, skipping GLIBC patching') + executable = [resourcePaths.node] + } else if (isAmazonLinux2() && hasGlibcPatch()) { + // Use environment variables if available (for CDM) + if (process.env.VSCODE_SERVER_CUSTOM_GLIBC_LINKER && process.env.VSCODE_SERVER_CUSTOM_GLIBC_PATH) { + executable = [ + process.env.VSCODE_SERVER_CUSTOM_GLIBC_LINKER, + '--library-path', + process.env.VSCODE_SERVER_CUSTOM_GLIBC_PATH, + resourcePaths.node, + ] + getLogger('amazonqLsp').info(`Patched node runtime with GLIBC using env vars to ${executable}`) + } else { + // No environment variables, use the node executable directly + executable = [resourcePaths.node] + } } else { executable = [resourcePaths.node] } @@ -100,6 +133,15 @@ export async function startLanguageServer( await validateNodeExe(executable, resourcePaths.lsp, argv, logger) + const endpointOverride = DevSettings.instance.get('codewhispererService', {}).endpoint ?? undefined + const textDocSection = { + inlineEditSupport: Experiments.instance.get('amazonqLSPNEP', true), + } as any + + if (endpointOverride) { + textDocSection.endpointOverride = endpointOverride + } + // Options to control the language client const clientOptions: LanguageClientOptions = { // Register the server for json documents @@ -122,7 +164,7 @@ export async function startLanguageServer( initializationOptions: { aws: { clientInfo: { - name: env.appName, + name: getClientName(), version: version, extension: { name: 'AmazonQ-For-VSCode', @@ -134,20 +176,33 @@ export async function startLanguageServer( q: { developerProfiles: true, pinnedContextEnabled: true, + imageContextEnabled: true, mcp: true, + shortcut: true, + reroute: true, + modelSelection: true, + workspaceFilePath: vscode.workspace.workspaceFile?.fsPath, + codeReviewInChat: codeReviewInChat, + // feature flag for displaying findings found not through CodeReview in the Code Issues Panel + displayFindings: true, }, window: { notifications: true, showSaveFileDialog: true, + showLogs: isSageMaker() ? false : true, + }, + textDocument: { + inlineCompletionWithReferences: textDocSection, }, }, contextConfiguration: { workspaceIdentifier: extensionContext.storageUri?.path, }, - logLevel: toAmazonQLSPLogLevel(globals.logOutputChannel.logLevel), + logLevel: isSageMaker() ? 'debug' : toAmazonQLSPLogLevel(globals.logOutputChannel.logLevel), }, credentials: { providesBearerToken: true, + providesIam: isSageMaker(), // Enable IAM credentials for SageMaker environments }, }, /** @@ -173,6 +228,32 @@ export async function startLanguageServer( toDispose.push(disposable) await client.onReady() + // Set up connection metadata handler + client.onRequest(notificationTypes.getConnectionMetadata.method, () => { + // For IAM auth, provide a default startUrl + if (process.env.USE_IAM_AUTH === 'true') { + getLogger().info( + `[SageMaker Debug] Connection metadata requested - returning hardcoded startUrl for IAM auth` + ) + return { + sso: { + // TODO P261194666 Replace with correct startUrl once identified + startUrl: 'https://amzn.awsapps.com/start', // Default for IAM auth + }, + } + } + + // For SSO auth, use the actual startUrl + getLogger().info( + `[SageMaker Debug] Connection metadata requested - returning actual startUrl for SSO auth: ${AuthUtil.instance.auth.startUrl}` + ) + return { + sso: { + startUrl: AuthUtil.instance.auth.startUrl, + }, + } + }) + const auth = await initializeAuth(client) await onLanguageServerReady(extensionContext, auth, client, resourcePaths, toDispose) @@ -186,6 +267,59 @@ async function initializeAuth(client: LanguageClient): Promise { return auth } +// jscpd:ignore-start +async function initializeLanguageServerConfiguration(client: LanguageClient, context: string = 'startup') { + const logger = getLogger('amazonqLsp') + + if (AuthUtil.instance.isConnectionValid()) { + logger.info(`[${context}] Initializing language server configuration`) + // jscpd:ignore-end + + try { + // Send profile configuration + logger.debug(`[${context}] Sending profile configuration to language server`) + await sendProfileToLsp(client) + logger.debug(`[${context}] Profile configuration sent successfully`) + + // Send customization configuration + logger.debug(`[${context}] Sending customization configuration to language server`) + await pushConfigUpdate(client, { + type: 'customization', + customization: getSelectedCustomization(), + }) + logger.debug(`[${context}] Customization configuration sent successfully`) + + logger.info(`[${context}] Language server configuration completed successfully`) + } catch (error) { + logger.error(`[${context}] Failed to initialize language server configuration: ${error}`) + throw error + } + } else { + logger.warn( + `[${context}] Connection invalid, skipping language server configuration - this will cause authentication failures` + ) + const activeConnection = AuthUtil.instance.auth.activeConnection + const connectionState = activeConnection + ? AuthUtil.instance.auth.getConnectionState(activeConnection) + : 'no-connection' + logger.warn(`[${context}] Connection state: ${connectionState}`) + } +} + +async function sendProfileToLsp(client: LanguageClient) { + const logger = getLogger('amazonqLsp') + const profileArn = AuthUtil.instance.regionProfileManager.activeRegionProfile?.arn + + logger.debug(`Sending profile to LSP: ${profileArn || 'undefined'}`) + + await pushConfigUpdate(client, { + type: 'profile', + profileArn: profileArn, + }) + + logger.debug(`Profile sent to LSP successfully`) +} + async function onLanguageServerReady( extensionContext: vscode.ExtensionContext, auth: AmazonQLspAuth, @@ -217,18 +351,26 @@ async function onLanguageServerReady( // We manually push the cached values the first time since event handlers, which should push, may not have been setup yet. // Execution order is weird and should be fixed in the flare implementation. // TODO: Revisit if we need this if we setup the event handlers properly - if (AuthUtil.instance.isConnectionValid()) { - await sendProfileToLsp(client) - - await pushConfigUpdate(client, { - type: 'customization', - customization: getSelectedCustomization(), - }) - } + await initializeLanguageServerConfiguration(client, 'startup') toDispose.push( inlineManager, + Commands.register('aws.amazonq.showPrev', async () => { + await sessionManager.maybeRefreshSessionUx() + await vscode.commands.executeCommand('editor.action.inlineSuggest.showPrevious') + sessionManager.onPrevSuggestion() + }), + Commands.register('aws.amazonq.showNext', async () => { + await sessionManager.maybeRefreshSessionUx() + await vscode.commands.executeCommand('editor.action.inlineSuggest.showNext') + sessionManager.onNextSuggestion() + }), + // this is a workaround since handleDidShowCompletionItem is not public API + Commands.register('aws.amazonq.checkInlineSuggestionVisibility', async () => { + sessionManager.checkInlineSuggestionVisibility() + }), Commands.register({ id: 'aws.amazonq.invokeInlineCompletion', autoconnect: true }, async () => { + vsCodeState.lastManualTriggerTime = performance.now() await vscode.commands.executeCommand('editor.action.inlineSuggest.trigger') }), Commands.register('aws.amazonq.refreshAnnotation', async (forceProceed: boolean) => { @@ -296,13 +438,6 @@ async function onLanguageServerReady( }), } as RenameFilesParams) }), - vscode.workspace.onDidSaveTextDocument((e) => { - client.sendNotification('workspace/didSaveTextDocument', { - textDocument: { - uri: e.uri.fsPath, - }, - } as DidSaveTextDocumentParams) - }), vscode.workspace.onDidChangeWorkspaceFolders((e) => { client.sendNotification('workspace/didChangeWorkspaceFolder', { event: { @@ -325,13 +460,6 @@ async function onLanguageServerReady( // Set this inside onReady so that it only triggers on subsequent language server starts (not the first) onServerRestartHandler(client, auth) ) - - async function sendProfileToLsp(client: LanguageClient) { - await pushConfigUpdate(client, { - type: 'profile', - profileArn: AuthUtil.instance.regionProfileManager.activeRegionProfile?.arn, - }) - } } /** @@ -351,8 +479,21 @@ function onServerRestartHandler(client: LanguageClient, auth: AmazonQLspAuth) { // TODO: Port this metric override to common definitions telemetry.languageServer_crash.emit({ id: 'AmazonQ' }) - // Need to set the auth token in the again - await auth.refreshConnection(true) + const logger = getLogger('amazonqLsp') + logger.info('[crash-recovery] Language server crash detected, reinitializing authentication') + + try { + // Send bearer token + logger.debug('[crash-recovery] Refreshing connection and sending bearer token') + await auth.refreshConnection(true) + logger.debug('[crash-recovery] Bearer token sent successfully') + + // Send profile and customization configuration + await initializeLanguageServerConfiguration(client, 'crash-recovery') + logger.info('[crash-recovery] Authentication reinitialized successfully') + } catch (error) { + logger.error(`[crash-recovery] Failed to reinitialize after crash: ${error}`) + } }) } diff --git a/packages/amazonq/src/lsp/config.ts b/packages/amazonq/src/lsp/config.ts index 66edc9ff6f1..6b88eb98d21 100644 --- a/packages/amazonq/src/lsp/config.ts +++ b/packages/amazonq/src/lsp/config.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ import * as vscode from 'vscode' -import { DevSettings, getServiceEnvVarConfig, BaseLspInstaller } from 'aws-core-vscode/shared' +import { DevSettings, getServiceEnvVarConfig, BaseLspInstaller, getLogger } from 'aws-core-vscode/shared' import { LanguageClient } from 'vscode-languageclient' import { DidChangeConfigurationNotification, @@ -68,23 +68,31 @@ export function toAmazonQLSPLogLevel(logLevel: vscode.LogLevel): LspLogLevel { * push the given config. */ export async function pushConfigUpdate(client: LanguageClient, config: QConfigs) { + const logger = getLogger('amazonqLsp') + switch (config.type) { case 'profile': + logger.debug(`Pushing profile configuration: ${config.profileArn || 'undefined'}`) await client.sendRequest(updateConfigurationRequestType.method, { section: 'aws.q', settings: { profileArn: config.profileArn }, }) + logger.debug(`Profile configuration pushed successfully`) break case 'customization': + logger.debug(`Pushing customization configuration: ${config.customization || 'undefined'}`) client.sendNotification(DidChangeConfigurationNotification.type.method, { section: 'aws.q', settings: { customization: config.customization }, }) + logger.debug(`Customization configuration pushed successfully`) break case 'logLevel': + logger.debug(`Pushing log level configuration`) client.sendNotification(DidChangeConfigurationNotification.type.method, { section: 'aws.logLevel', }) + logger.debug(`Log level configuration pushed successfully`) break } } diff --git a/packages/amazonq/src/util/timeoutUtil.ts b/packages/amazonq/src/util/timeoutUtil.ts new file mode 100644 index 00000000000..c42d1e3be01 --- /dev/null +++ b/packages/amazonq/src/util/timeoutUtil.ts @@ -0,0 +1,15 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +export function asyncCallWithTimeout(asyncPromise: Promise, message: string, timeLimit: number): Promise { + let timeoutHandle: NodeJS.Timeout + const timeoutPromise = new Promise((_resolve, reject) => { + timeoutHandle = setTimeout(() => reject(new Error(message)), timeLimit) + }) + return Promise.race([asyncPromise, timeoutPromise]).then((result) => { + clearTimeout(timeoutHandle) + return result as T + }) +} diff --git a/packages/amazonq/test/e2e/amazonq/doc.test.ts b/packages/amazonq/test/e2e/amazonq/doc.test.ts deleted file mode 100644 index 20d281fe7b8..00000000000 --- a/packages/amazonq/test/e2e/amazonq/doc.test.ts +++ /dev/null @@ -1,492 +0,0 @@ -/*! - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -import vscode from 'vscode' -import assert from 'assert' -import { qTestingFramework } from './framework/framework' -import { getTestWindow, registerAuthHook, toTextEditor, using } from 'aws-core-vscode/test' -import { loginToIdC } from './utils/setup' -import { Messenger } from './framework/messenger' -import { FollowUpTypes } from 'aws-core-vscode/amazonq' -import { fs, i18n, sleep } from 'aws-core-vscode/shared' -import { - docGenerationProgressMessage, - DocGenerationStep, - docGenerationSuccessMessage, - docRejectConfirmation, - Mode, -} from 'aws-core-vscode/amazonqDoc' - -describe('Amazon Q Doc Generation', async function () { - let framework: qTestingFramework - let tab: Messenger - let workspaceUri: vscode.Uri - let rootReadmeFileUri: vscode.Uri - - type testProjectConfig = { - path: string - language: string - mockFile: string - mockContent: string - } - const testProjects: testProjectConfig[] = [ - { - path: 'ts-plain-sam-app', - language: 'TypeScript', - mockFile: 'bubbleSort.ts', - mockContent: ` - function bubbleSort(arr: number[]): number[] { - const n = arr.length; - for (let i = 0; i < n - 1; i++) { - for (let j = 0; j < n - i - 1; j++) { - if (arr[j] > arr[j + 1]) { - [arr[j], arr[j + 1]] = [arr[j + 1], arr[j]]; - } - } - } - return arr; - }`, - }, - { - path: 'ruby-plain-sam-app', - language: 'Ruby', - mockFile: 'bubble_sort.rb', - mockContent: ` - def bubble_sort(arr) - n = arr.length - (n-1).times do |i| - (0..n-i-2).each do |j| - if arr[j] > arr[j+1] - arr[j], arr[j+1] = arr[j+1], arr[j] - end - end - end - arr - end`, - }, - { - path: 'js-plain-sam-app', - language: 'JavaScript', - mockFile: 'bubbleSort.js', - mockContent: ` - function bubbleSort(arr) { - const n = arr.length; - for (let i = 0; i < n - 1; i++) { - for (let j = 0; j < n - i - 1; j++) { - if (arr[j] > arr[j + 1]) { - [arr[j], arr[j + 1]] = [arr[j + 1], arr[j]]; - } - } - } - return arr; - }`, - }, - { - path: 'java11-plain-maven-sam-app', - language: 'Java', - mockFile: 'BubbleSort.java', - mockContent: ` - public static void bubbleSort(int[] arr) { - int n = arr.length; - for (int i = 0; i < n - 1; i++) { - for (int j = 0; j < n - i - 1; j++) { - if (arr[j] > arr[j + 1]) { - int temp = arr[j]; - arr[j] = arr[j + 1]; - arr[j + 1] = temp; - } - } - } - }`, - }, - { - path: 'go1-plain-sam-app', - language: 'Go', - mockFile: 'bubble_sort.go', - mockContent: ` - func bubbleSort(arr []int) []int { - n := len(arr) - for i := 0; i < n-1; i++ { - for j := 0; j < n-i-1; j++ { - if arr[j] > arr[j+1] { - arr[j], arr[j+1] = arr[j+1], arr[j] - } - } - } - return arr - }`, - }, - { - path: 'python3.7-plain-sam-app', - language: 'Python', - mockFile: 'bubble_sort.py', - mockContent: ` - def bubble_sort(arr): - n = len(arr) - for i in range(n-1): - for j in range(0, n-i-1): - if arr[j] > arr[j+1]: - arr[j], arr[j+1] = arr[j+1], arr[j] - return arr`, - }, - ] - - const docUtils = { - async initializeDocOperation(operation: 'create' | 'update' | 'edit') { - console.log(`Initializing documentation ${operation} operation`) - - switch (operation) { - case 'create': - await tab.waitForButtons([FollowUpTypes.CreateDocumentation, FollowUpTypes.UpdateDocumentation]) - tab.clickButton(FollowUpTypes.CreateDocumentation) - await tab.waitForText(i18n('AWS.amazonq.doc.answer.createReadme')) - break - case 'update': - await tab.waitForButtons([FollowUpTypes.CreateDocumentation, FollowUpTypes.UpdateDocumentation]) - tab.clickButton(FollowUpTypes.UpdateDocumentation) - await tab.waitForButtons([FollowUpTypes.SynchronizeDocumentation, FollowUpTypes.EditDocumentation]) - tab.clickButton(FollowUpTypes.SynchronizeDocumentation) - await tab.waitForText(i18n('AWS.amazonq.doc.answer.updateReadme')) - break - case 'edit': - await tab.waitForButtons([FollowUpTypes.UpdateDocumentation]) - tab.clickButton(FollowUpTypes.UpdateDocumentation) - await tab.waitForButtons([FollowUpTypes.SynchronizeDocumentation, FollowUpTypes.EditDocumentation]) - tab.clickButton(FollowUpTypes.EditDocumentation) - await tab.waitForText(i18n('AWS.amazonq.doc.answer.updateReadme')) - break - } - }, - - async handleFolderSelection(testProject: testProjectConfig) { - console.table({ - 'Test in project': { - Path: testProject.path, - Language: testProject.language, - }, - }) - - const projectUri = vscode.Uri.joinPath(workspaceUri, testProject.path) - const readmeFileUri = vscode.Uri.joinPath(projectUri, 'README.md') - - // Cleanup existing README - await fs.delete(readmeFileUri, { force: true }) - - await tab.waitForButtons([FollowUpTypes.ProceedFolderSelection, FollowUpTypes.ChooseFolder]) - tab.clickButton(FollowUpTypes.ChooseFolder) - getTestWindow().onDidShowDialog((d) => d.selectItem(projectUri)) - - return readmeFileUri - }, - - async executeDocumentationFlow(operation: 'create' | 'update' | 'edit', msg?: string) { - const mode = { - create: Mode.CREATE, - update: Mode.SYNC, - edit: Mode.EDIT, - }[operation] - - console.log(`Executing documentation ${operation} flow`) - - await tab.waitForButtons([FollowUpTypes.ProceedFolderSelection]) - tab.clickButton(FollowUpTypes.ProceedFolderSelection) - - if (mode === Mode.EDIT && msg) { - tab.addChatMessage({ prompt: msg }) - } - await tab.waitForText(docGenerationProgressMessage(DocGenerationStep.SUMMARIZING_FILES, mode)) - await tab.waitForText(`${docGenerationSuccessMessage(mode)} ${i18n('AWS.amazonq.doc.answer.codeResult')}`) - await tab.waitForButtons([ - FollowUpTypes.AcceptChanges, - FollowUpTypes.MakeChanges, - FollowUpTypes.RejectChanges, - ]) - }, - - async verifyResult(action: FollowUpTypes, readmeFileUri?: vscode.Uri, shouldExist = true) { - tab.clickButton(action) - - if (action === FollowUpTypes.RejectChanges) { - await tab.waitForText(docRejectConfirmation) - assert.deepStrictEqual(tab.getChatItems().pop()?.body, docRejectConfirmation) - } - await tab.waitForButtons([FollowUpTypes.NewTask, FollowUpTypes.CloseSession]) - - if (readmeFileUri) { - const fileExists = await fs.exists(readmeFileUri) - console.log(`README file exists: ${fileExists}, Expected: ${shouldExist}`) - assert.strictEqual( - fileExists, - shouldExist, - shouldExist - ? 'README file was not saved to the appropriate folder' - : 'README file should not be saved to the folder' - ) - if (fileExists) { - await fs.delete(readmeFileUri, { force: true }) - } - } - }, - - async prepareMockFile(testProject: testProjectConfig) { - const folderUri = vscode.Uri.joinPath(workspaceUri, testProject.path) - const mockFileUri = vscode.Uri.joinPath(folderUri, testProject.mockFile) - await toTextEditor(testProject.mockContent, testProject.mockFile, folderUri.path) - return mockFileUri - }, - - getRandomTestProject() { - const randomIndex = Math.floor(Math.random() * testProjects.length) - return testProjects[randomIndex] - }, - async setupTest() { - tab = framework.createTab() - tab.addChatMessage({ command: '/doc' }) - tab = framework.getSelectedTab() - await tab.waitForChatFinishesLoading() - }, - } - /** - * Executes a test method with automatic retry capability for retryable errors. - * Uses Promise.race to detect errors during test execution without hanging. - */ - async function retryIfRequired(testMethod: () => Promise, maxAttempts: number = 3) { - const errorMessages = { - tooManyRequests: 'Too many requests', - unexpectedError: 'Encountered an unexpected error when processing the request', - } - const hasRetryableError = () => { - const lastTwoMessages = tab - .getChatItems() - .slice(-2) - .map((item) => item.body) - return lastTwoMessages.some( - (body) => body?.includes(errorMessages.unexpectedError) || body?.includes(errorMessages.tooManyRequests) - ) - } - for (let attempt = 1; attempt <= maxAttempts; attempt++) { - console.log(`Attempt ${attempt}/${maxAttempts}`) - const errorDetectionPromise = new Promise((_, reject) => { - const errorCheckInterval = setInterval(() => { - if (hasRetryableError()) { - clearInterval(errorCheckInterval) - reject(new Error('Retryable error detected')) - } - }, 1000) - }) - try { - await Promise.race([testMethod(), errorDetectionPromise]) - return - } catch (error) { - if (attempt === maxAttempts) { - assert.fail(`Test failed after ${maxAttempts} attempts`) - } - console.log(`Attempt ${attempt} failed, retrying...`) - await sleep(1000 * attempt) - await docUtils.setupTest() - } - } - } - before(async function () { - /** - * The tests are getting throttled, only run them on stable for now - * - * TODO: Re-enable for all versions once the backend can handle them - */ - - const testVersion = process.env['VSCODE_TEST_VERSION'] - if (testVersion && testVersion !== 'stable') { - this.skip() - } - - await using(registerAuthHook('amazonq-test-account'), async () => { - await loginToIdC() - }) - }) - - beforeEach(() => { - registerAuthHook('amazonq-test-account') - framework = new qTestingFramework('doc', true, []) - tab = framework.createTab() - const wsFolders = vscode.workspace.workspaceFolders - if (!wsFolders?.length) { - assert.fail('Workspace folder not found') - } - workspaceUri = wsFolders[0].uri - rootReadmeFileUri = vscode.Uri.joinPath(workspaceUri, 'README.md') - }) - - afterEach(() => { - framework.removeTab(tab.tabID) - framework.dispose() - }) - - describe('Quick action availability', () => { - it('Shows /doc command when doc generation is enabled', async () => { - const command = tab.findCommand('/doc') - if (!command.length) { - assert.fail('Could not find command') - } - - if (command.length > 1) { - assert.fail('Found too many commands with the name /doc') - } - }) - - it('Hide /doc command when doc generation is NOT enabled', () => { - // The beforeEach registers a framework which accepts requests. If we don't dispose before building a new one we have duplicate messages - framework.dispose() - framework = new qTestingFramework('doc', false, []) - const tab = framework.createTab() - const command = tab.findCommand('/doc') - if (command.length > 0) { - assert.fail('Found command when it should not have been found') - } - }) - }) - - describe('/doc entry', () => { - beforeEach(async function () { - await docUtils.setupTest() - }) - - it('Display create and update options on initial load', async () => { - await tab.waitForButtons([FollowUpTypes.CreateDocumentation, FollowUpTypes.UpdateDocumentation]) - }) - it('Return to the select create or update documentation state when cancel button clicked', async () => { - await tab.waitForButtons([FollowUpTypes.CreateDocumentation, FollowUpTypes.UpdateDocumentation]) - tab.clickButton(FollowUpTypes.UpdateDocumentation) - await tab.waitForButtons([FollowUpTypes.SynchronizeDocumentation, FollowUpTypes.EditDocumentation]) - tab.clickButton(FollowUpTypes.SynchronizeDocumentation) - await tab.waitForButtons([ - FollowUpTypes.ProceedFolderSelection, - FollowUpTypes.ChooseFolder, - FollowUpTypes.CancelFolderSelection, - ]) - tab.clickButton(FollowUpTypes.CancelFolderSelection) - await tab.waitForChatFinishesLoading() - const followupButton = tab.getFollowUpButton(FollowUpTypes.CreateDocumentation) - if (!followupButton) { - assert.fail('Could not find follow up button for create or update readme') - } - }) - }) - - describe('README Creation', () => { - let testProject: testProjectConfig - beforeEach(async function () { - await docUtils.setupTest() - testProject = docUtils.getRandomTestProject() - }) - - it('Create and save README in root folder when accepted', async () => { - await retryIfRequired(async () => { - await docUtils.initializeDocOperation('create') - await docUtils.executeDocumentationFlow('create') - await docUtils.verifyResult(FollowUpTypes.AcceptChanges, rootReadmeFileUri, true) - }) - }) - it('Create and save README in subfolder when accepted', async () => { - await retryIfRequired(async () => { - await docUtils.initializeDocOperation('create') - const readmeFileUri = await docUtils.handleFolderSelection(testProject) - await docUtils.executeDocumentationFlow('create') - await docUtils.verifyResult(FollowUpTypes.AcceptChanges, readmeFileUri, true) - }) - }) - - it('Discard README in subfolder when rejected', async () => { - await retryIfRequired(async () => { - await docUtils.initializeDocOperation('create') - const readmeFileUri = await docUtils.handleFolderSelection(testProject) - await docUtils.executeDocumentationFlow('create') - await docUtils.verifyResult(FollowUpTypes.RejectChanges, readmeFileUri, false) - }) - }) - }) - - describe('README Editing', () => { - beforeEach(async function () { - await docUtils.setupTest() - }) - - it('Apply specific content changes when requested', async () => { - await retryIfRequired(async () => { - await docUtils.initializeDocOperation('edit') - await docUtils.executeDocumentationFlow('edit', 'remove the repository structure section') - await docUtils.verifyResult(FollowUpTypes.AcceptChanges, rootReadmeFileUri, true) - }) - }) - - it('Handle unrelated prompts with appropriate error message', async () => { - await retryIfRequired(async () => { - await docUtils.initializeDocOperation('edit') - await tab.waitForButtons([FollowUpTypes.ProceedFolderSelection]) - tab.clickButton(FollowUpTypes.ProceedFolderSelection) - tab.addChatMessage({ prompt: 'tell me about the weather' }) - await tab.waitForEvent(() => - tab - .getChatItems() - .some(({ body }) => body?.startsWith(i18n('AWS.amazonq.doc.error.promptUnrelated'))) - ) - await tab.waitForEvent(() => { - const store = tab.getStore() - return ( - !store.promptInputDisabledState && - store.promptInputPlaceholder === i18n('AWS.amazonq.doc.placeholder.editReadme') - ) - }) - }) - }) - }) - describe('README Updates', () => { - let testProject: testProjectConfig - let mockFileUri: vscode.Uri - - beforeEach(async function () { - await docUtils.setupTest() - testProject = docUtils.getRandomTestProject() - }) - afterEach(async function () { - // Clean up mock file - if (mockFileUri) { - await fs.delete(mockFileUri, { force: true }) - } - }) - - it('Update README with code change in subfolder', async () => { - mockFileUri = await docUtils.prepareMockFile(testProject) - await retryIfRequired(async () => { - await docUtils.initializeDocOperation('update') - const readmeFileUri = await docUtils.handleFolderSelection(testProject) - await docUtils.executeDocumentationFlow('update') - await docUtils.verifyResult(FollowUpTypes.AcceptChanges, readmeFileUri, true) - }) - }) - it('Update root README and incorporate additional changes', async () => { - // Cleanup any existing README - await fs.delete(rootReadmeFileUri, { force: true }) - mockFileUri = await docUtils.prepareMockFile(testProject) - await retryIfRequired(async () => { - await docUtils.initializeDocOperation('update') - await docUtils.executeDocumentationFlow('update') - tab.clickButton(FollowUpTypes.MakeChanges) - tab.addChatMessage({ prompt: 'remove the repository structure section' }) - - await tab.waitForText(docGenerationProgressMessage(DocGenerationStep.SUMMARIZING_FILES, Mode.SYNC)) - await tab.waitForText( - `${docGenerationSuccessMessage(Mode.SYNC)} ${i18n('AWS.amazonq.doc.answer.codeResult')}` - ) - await tab.waitForButtons([ - FollowUpTypes.AcceptChanges, - FollowUpTypes.MakeChanges, - FollowUpTypes.RejectChanges, - ]) - - await docUtils.verifyResult(FollowUpTypes.AcceptChanges, rootReadmeFileUri, true) - }) - }) - }) -}) diff --git a/packages/amazonq/test/e2e/amazonq/explore.test.ts b/packages/amazonq/test/e2e/amazonq/explore.test.ts deleted file mode 100644 index 970d93d00bb..00000000000 --- a/packages/amazonq/test/e2e/amazonq/explore.test.ts +++ /dev/null @@ -1,45 +0,0 @@ -/*! - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -import assert from 'assert' -import sinon from 'sinon' -import { qTestingFramework } from './framework/framework' -import { Messenger } from './framework/messenger' - -describe('Amazon Q Explore page', function () { - let framework: qTestingFramework - let tab: Messenger - - beforeEach(() => { - framework = new qTestingFramework('agentWalkthrough', true, [], 0) - const welcomeTab = framework.getTabs()[0] - welcomeTab.clickInBodyButton('explore') - - // Find the new explore tab - const exploreTab = framework.findTab('Explore') - if (!exploreTab) { - assert.fail('Explore tab not found') - } - tab = exploreTab - }) - - afterEach(() => { - framework.removeTab(tab.tabID) - framework.dispose() - sinon.restore() - }) - - // TODO refactor page objects so we can associate clicking user guides with actual urls - // TODO test that clicking quick start changes the tab title, etc - it('should have correct button IDs', async () => { - const features = ['featuredev', 'testgen', 'doc', 'review', 'gumby'] - - for (const [index, feature] of features.entries()) { - const buttons = (tab.getStore().chatItems ?? [])[index].buttons ?? [] - assert.deepStrictEqual(buttons[0].id, `user-guide-${feature}`) - assert.deepStrictEqual(buttons[1].id, `quick-start-${feature}`) - } - }) -}) diff --git a/packages/amazonq/test/e2e/amazonq/featureDev.test.ts b/packages/amazonq/test/e2e/amazonq/featureDev.test.ts deleted file mode 100644 index 87099e2a2d0..00000000000 --- a/packages/amazonq/test/e2e/amazonq/featureDev.test.ts +++ /dev/null @@ -1,345 +0,0 @@ -/*! - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -import assert from 'assert' -import { qTestingFramework } from './framework/framework' -import sinon from 'sinon' -import { registerAuthHook, using } from 'aws-core-vscode/test' -import { loginToIdC } from './utils/setup' -import { Messenger } from './framework/messenger' -import { FollowUpTypes } from 'aws-core-vscode/amazonq' -import { sleep } from 'aws-core-vscode/shared' - -describe('Amazon Q Feature Dev', function () { - let framework: qTestingFramework - let tab: Messenger - - const prompt = 'Add current timestamp into blank.txt' - const iteratePrompt = `Add a new section in readme to explain your change` - const fileLevelAcceptPrompt = `${prompt} and ${iteratePrompt}` - const informationCard = - 'After you provide a task, I will:\n1. Generate code based on your description and the code in your workspace\n2. Provide a list of suggestions for you to review and add to your workspace\n3. If needed, iterate based on your feedback\nTo learn more, visit the [user guide](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/software-dev.html)' - const tooManyRequestsWaitTime = 100000 - - async function waitForText(text: string) { - await tab.waitForText(text, { - waitIntervalInMs: 250, - waitTimeoutInMs: 2000, - }) - } - - async function iterate(prompt: string) { - tab.addChatMessage({ prompt }) - - await retryIfRequired( - async () => { - // Wait for a backend response - await tab.waitForChatFinishesLoading() - }, - () => {} - ) - } - - async function clickActionButton(filePath: string, actionName: string) { - tab.clickFileActionButton(filePath, actionName) - await tab.waitForEvent(() => !tab.hasAction(filePath, actionName), { - waitIntervalInMs: 500, - waitTimeoutInMs: 600000, - }) - } - - /** - * Wait for the original request to finish. - * If the response has a retry button or encountered a guardrails error, continue retrying - * - * This allows the e2e tests to recover from potential one off backend problems/random guardrails - */ - async function retryIfRequired(waitUntilReady: () => Promise, request?: () => void) { - await waitUntilReady() - - const findAnotherTopic = 'find another topic to discuss' - const tooManyRequests = 'Too many requests' - const failureState = (message: string) => { - return ( - tab.getChatItems().pop()?.body?.includes(message) || - tab.getChatItems().slice(-2).shift()?.body?.includes(message) - ) - } - while ( - tab.hasButton(FollowUpTypes.Retry) || - (request && (failureState(findAnotherTopic) || failureState(tooManyRequests))) - ) { - if (tab.hasButton(FollowUpTypes.Retry)) { - console.log('Retrying request') - tab.clickButton(FollowUpTypes.Retry) - await waitUntilReady() - } else if (failureState(tooManyRequests)) { - // 3 versions of the e2e tests are running at the same time in the ci so we occassionally need to wait before continuing - request && request() - await sleep(tooManyRequestsWaitTime) - } else { - // We've hit guardrails, re-make the request and wait again - request && request() - await waitUntilReady() - } - } - - // The backend never recovered - if (tab.hasButton(FollowUpTypes.SendFeedback)) { - assert.fail('Encountered an error when attempting to call the feature dev backend. Could not continue') - } - } - - before(async function () { - /** - * The tests are getting throttled, only run them on stable for now - * - * TODO: Re-enable for all versions once the backend can handle them - */ - const testVersion = process.env['VSCODE_TEST_VERSION'] - if (testVersion && testVersion !== 'stable') { - this.skip() - } - - await using(registerAuthHook('amazonq-test-account'), async () => { - await loginToIdC() - }) - }) - - beforeEach(() => { - registerAuthHook('amazonq-test-account') - framework = new qTestingFramework('featuredev', true, []) - tab = framework.createTab() - }) - - afterEach(() => { - framework.removeTab(tab.tabID) - framework.dispose() - sinon.restore() - }) - - describe('Quick action availability', () => { - it('Shows /dev when feature dev is enabled', async () => { - const command = tab.findCommand('/dev') - if (!command) { - assert.fail('Could not find command') - } - - if (command.length > 1) { - assert.fail('Found too many commands with the name /dev') - } - }) - - it('Does NOT show /dev when feature dev is NOT enabled', () => { - // The beforeEach registers a framework which accepts requests. If we don't dispose before building a new one we have duplicate messages - framework.dispose() - framework = new qTestingFramework('featuredev', false, []) - const tab = framework.createTab() - const command = tab.findCommand('/dev') - if (command.length > 0) { - assert.fail('Found command when it should not have been found') - } - }) - }) - - describe('/dev entry', () => { - before(async () => { - tab = framework.createTab() - tab.addChatMessage({ command: '/dev' }) // This would create a new tab for feature dev. - tab = framework.getSelectedTab() - }) - - it('should display information card', async () => { - await retryIfRequired( - async () => { - await tab.waitForChatFinishesLoading() - }, - () => { - const lastChatItems = tab.getChatItems().pop() - assert.deepStrictEqual(lastChatItems?.body, informationCard) - } - ) - }) - }) - - describe('/dev {msg} entry', async () => { - beforeEach(async function () { - const isMultiIterationTestsEnabled = process.env['AMAZONQ_FEATUREDEV_ITERATION_TEST'] // Controls whether to enable multiple iteration testing for Amazon Q feature development - if (!isMultiIterationTestsEnabled) { - this.skip() - } else { - this.timeout(900000) // Code Gen with multi-iterations requires longer than default timeout(5 mins). - } - tab = framework.createTab() - tab.addChatMessage({ command: '/dev', prompt }) - tab = framework.getSelectedTab() - await retryIfRequired( - async () => { - await tab.waitForChatFinishesLoading() - }, - () => {} - ) - }) - - afterEach(async function () { - // currentTest.state is undefined if a beforeEach fails - if ( - this.currentTest?.state === undefined || - this.currentTest?.isFailed() || - this.currentTest?.isPending() - ) { - // Since the tests are long running this may help in diagnosing the issue - console.log('Current chat items at failure') - console.log(JSON.stringify(tab.getChatItems(), undefined, 4)) - } - }) - - it('Clicks accept code and click new task', async () => { - await retryIfRequired(async () => { - await Promise.any([ - tab.waitForButtons([FollowUpTypes.InsertCode, FollowUpTypes.ProvideFeedbackAndRegenerateCode]), - tab.waitForButtons([FollowUpTypes.Retry]), - ]) - }) - tab.clickButton(FollowUpTypes.InsertCode) - await tab.waitForButtons([FollowUpTypes.NewTask, FollowUpTypes.CloseSession]) - tab.clickButton(FollowUpTypes.NewTask) - await waitForText('What new task would you like to work on?') - assert.deepStrictEqual(tab.getChatItems().pop()?.body, 'What new task would you like to work on?') - }) - - it('Iterates on codegen', async () => { - await retryIfRequired(async () => { - await Promise.any([ - tab.waitForButtons([FollowUpTypes.InsertCode, FollowUpTypes.ProvideFeedbackAndRegenerateCode]), - tab.waitForButtons([FollowUpTypes.Retry]), - ]) - }) - tab.clickButton(FollowUpTypes.ProvideFeedbackAndRegenerateCode) - await tab.waitForChatFinishesLoading() - await iterate(iteratePrompt) - tab.clickButton(FollowUpTypes.InsertCode) - await tab.waitForButtons([FollowUpTypes.NewTask, FollowUpTypes.CloseSession]) - }) - }) - - describe('file-level accepts', async () => { - beforeEach(async function () { - tab = framework.createTab() - tab.addChatMessage({ command: '/dev', prompt: fileLevelAcceptPrompt }) - tab = framework.getSelectedTab() - await retryIfRequired( - async () => { - await tab.waitForChatFinishesLoading() - }, - () => { - tab.addChatMessage({ prompt }) - } - ) - await retryIfRequired(async () => { - await Promise.any([ - tab.waitForButtons([FollowUpTypes.InsertCode, FollowUpTypes.ProvideFeedbackAndRegenerateCode]), - tab.waitForButtons([FollowUpTypes.Retry]), - ]) - }) - }) - - describe('fileList', async () => { - it('has both accept-change and reject-change action buttons for file', async () => { - const filePath = tab.getFilePaths()[0] - assert.ok(tab.getActionsByFilePath(filePath).length === 2) - assert.ok(tab.hasAction(filePath, 'accept-change')) - assert.ok(tab.hasAction(filePath, 'reject-change')) - }) - - it('has only revert-rejection action button for rejected file', async () => { - const filePath = tab.getFilePaths()[0] - await clickActionButton(filePath, 'reject-change') - - assert.ok(tab.getActionsByFilePath(filePath).length === 1) - assert.ok(tab.hasAction(filePath, 'revert-rejection')) - }) - - it('does not have any of the action buttons for accepted file', async () => { - const filePath = tab.getFilePaths()[0] - await clickActionButton(filePath, 'accept-change') - - assert.ok(tab.getActionsByFilePath(filePath).length === 0) - }) - - it('disables all action buttons when new task is clicked', async () => { - tab.clickButton(FollowUpTypes.InsertCode) - await tab.waitForButtons([FollowUpTypes.NewTask, FollowUpTypes.CloseSession]) - tab.clickButton(FollowUpTypes.NewTask) - await waitForText('What new task would you like to work on?') - - const filePaths = tab.getFilePaths() - for (const filePath of filePaths) { - assert.ok(tab.getActionsByFilePath(filePath).length === 0) - } - }) - - it('disables all action buttons when close session is clicked', async () => { - tab.clickButton(FollowUpTypes.InsertCode) - await tab.waitForButtons([FollowUpTypes.NewTask, FollowUpTypes.CloseSession]) - tab.clickButton(FollowUpTypes.CloseSession) - await waitForText( - "Okay, I've ended this chat session. You can open a new tab to chat or start another workflow." - ) - - const filePaths = tab.getFilePaths() - for (const filePath of filePaths) { - assert.ok(tab.getActionsByFilePath(filePath).length === 0) - } - }) - }) - - describe('accept button', async () => { - describe('button text', async () => { - it('shows "Accept all changes" when no files are accepted or rejected, and "Accept remaining changes" otherwise', async () => { - let insertCodeButton = tab.getFollowUpButton(FollowUpTypes.InsertCode) - assert.ok(insertCodeButton.pillText === 'Accept all changes') - - const filePath = tab.getFilePaths()[0] - await clickActionButton(filePath, 'reject-change') - - insertCodeButton = tab.getFollowUpButton(FollowUpTypes.InsertCode) - assert.ok(insertCodeButton.pillText === 'Accept remaining changes') - - await clickActionButton(filePath, 'revert-rejection') - - insertCodeButton = tab.getFollowUpButton(FollowUpTypes.InsertCode) - assert.ok(insertCodeButton.pillText === 'Accept all changes') - - await clickActionButton(filePath, 'accept-change') - - insertCodeButton = tab.getFollowUpButton(FollowUpTypes.InsertCode) - assert.ok(insertCodeButton.pillText === 'Accept remaining changes') - }) - - it('shows "Continue" when all files are either accepted or rejected, with at least one of them rejected', async () => { - const filePaths = tab.getFilePaths() - for (const filePath of filePaths) { - await clickActionButton(filePath, 'reject-change') - } - - const insertCodeButton = tab.getFollowUpButton(FollowUpTypes.InsertCode) - assert.ok(insertCodeButton.pillText === 'Continue') - }) - }) - - it('disappears and automatically moves on to the next step when all changes are accepted', async () => { - const filePaths = tab.getFilePaths() - for (const filePath of filePaths) { - await clickActionButton(filePath, 'accept-change') - } - await tab.waitForButtons([FollowUpTypes.NewTask, FollowUpTypes.CloseSession]) - - assert.ok(tab.hasButton(FollowUpTypes.InsertCode) === false) - assert.ok(tab.hasButton(FollowUpTypes.ProvideFeedbackAndRegenerateCode) === false) - }) - }) - }) -}) diff --git a/packages/amazonq/test/e2e/amazonq/testGen.test.ts b/packages/amazonq/test/e2e/amazonq/testGen.test.ts deleted file mode 100644 index 21db83fd6e8..00000000000 --- a/packages/amazonq/test/e2e/amazonq/testGen.test.ts +++ /dev/null @@ -1,209 +0,0 @@ -/*! - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -import assert from 'assert' -import vscode from 'vscode' -import { qTestingFramework } from './framework/framework' -import sinon from 'sinon' -import { Messenger } from './framework/messenger' -import { FollowUpTypes } from 'aws-core-vscode/amazonq' -import { registerAuthHook, using, TestFolder, closeAllEditors, getTestWorkspaceFolder } from 'aws-core-vscode/test' -import { loginToIdC } from './utils/setup' -import { waitUntil, workspaceUtils } from 'aws-core-vscode/shared' -import * as path from 'path' - -describe('Amazon Q Test Generation', function () { - let framework: qTestingFramework - let tab: Messenger - - const testFiles = [ - { - language: 'python', - filePath: 'testGenFolder/src/main/math.py', - testFilePath: 'testGenFolder/src/test/test_math.py', - }, - { - language: 'java', - filePath: 'testGenFolder/src/main/Math.java', - testFilePath: 'testGenFolder/src/test/MathTest.java', - }, - ] - - // handles opening the file since /test must be called on an active file - async function setupTestDocument(filePath: string, language: string) { - const document = await waitUntil(async () => { - const doc = await workspaceUtils.openTextDocument(filePath) - return doc - }, {}) - - if (!document) { - assert.fail(`Failed to open ${language} file`) - } - - await waitUntil(async () => { - await vscode.window.showTextDocument(document, { preview: false }) - }, {}) - - const activeEditor = vscode.window.activeTextEditor - if (!activeEditor || activeEditor.document.uri.fsPath !== document.uri.fsPath) { - assert.fail(`Failed to make ${language} file active`) - } - } - - async function waitForChatItems(index: number) { - await tab.waitForEvent(() => tab.getChatItems().length > index, { - waitTimeoutInMs: 5000, - waitIntervalInMs: 1000, - }) - } - - // clears test file to a blank file - // not cleaning up test file may possibly cause bloat in CI since testFixtures does not get reset - async function cleanupTestFile(testFilePath: string) { - const workspaceFolder = getTestWorkspaceFolder() - const absoluteTestFilePath = path.join(workspaceFolder, testFilePath) - const testFileUri = vscode.Uri.file(absoluteTestFilePath) - await vscode.workspace.fs.writeFile(testFileUri, Buffer.from('', 'utf-8')) - } - - before(async function () { - await using(registerAuthHook('amazonq-test-account'), async () => { - await loginToIdC() - }) - }) - - beforeEach(async () => { - registerAuthHook('amazonq-test-account') - framework = new qTestingFramework('testgen', true, []) - tab = framework.createTab() - }) - - afterEach(async () => { - // Close all editors to prevent conflicts with subsequent tests trying to open the same file - await closeAllEditors() - framework.removeTab(tab.tabID) - framework.dispose() - sinon.restore() - }) - - describe('Quick action availability', () => { - it('Shows /test when test generation is enabled', async () => { - const command = tab.findCommand('/test') - if (!command.length) { - assert.fail('Could not find command') - } - if (command.length > 1) { - assert.fail('Found too many commands with the name /test') - } - }) - - it('Does NOT show /test when test generation is NOT enabled', () => { - // The beforeEach registers a framework which accepts requests. If we don't dispose before building a new one we have duplicate messages - framework.dispose() - framework = new qTestingFramework('testgen', false, []) - const tab = framework.createTab() - const command = tab.findCommand('/test') - if (command.length > 0) { - assert.fail('Found command when it should not have been found') - } - }) - }) - - describe('/test entry', () => { - describe('External file out of project', async () => { - let testFolder: TestFolder - let fileName: string - - beforeEach(async () => { - testFolder = await TestFolder.create() - fileName = 'math.py' - const filePath = await testFolder.write(fileName, 'def add(a, b): return a + b') - - const document = await vscode.workspace.openTextDocument(filePath) - await vscode.window.showTextDocument(document, { preview: false }) - }) - - it('/test for external file redirects to chat', async () => { - tab.addChatMessage({ command: '/test' }) - await tab.waitForChatFinishesLoading() - - await waitForChatItems(3) - const externalFileMessage = tab.getChatItems()[3] - - assert.deepStrictEqual(externalFileMessage.type, 'answer') - assert.deepStrictEqual( - externalFileMessage.body, - `I can't generate tests for ${fileName} because the file is outside of workspace scope.
I can still provide examples, instructions and code suggestions.` - ) - }) - }) - - for (const { language, filePath, testFilePath } of testFiles) { - describe(`/test on ${language} file`, () => { - beforeEach(async () => { - await waitUntil(async () => await setupTestDocument(filePath, language), {}) - - tab.addChatMessage({ command: '/test' }) - await tab.waitForChatFinishesLoading() - - await tab.waitForButtons([FollowUpTypes.ViewDiff]) - tab.clickButton(FollowUpTypes.ViewDiff) - await tab.waitForChatFinishesLoading() - }) - - describe('View diff of test file', async () => { - it('Clicks on view diff', async () => { - const chatItems = tab.getChatItems() - const viewDiffMessage = chatItems[5] - - assert.deepStrictEqual(viewDiffMessage.type, 'answer') - const expectedEnding = - 'Please see the unit tests generated below. Click “View diff” to review the changes in the code editor.' - assert.strictEqual( - viewDiffMessage.body?.includes(expectedEnding), - true, - `View diff message does not contain phrase: ${expectedEnding}` - ) - }) - }) - - describe('Accept unit tests', async () => { - afterEach(async () => { - // this e2e test generates unit tests, so we want to clean them up after this test is done - await waitUntil(async () => { - await cleanupTestFile(testFilePath) - }, {}) - }) - - it('Clicks on accept', async () => { - await tab.waitForButtons([FollowUpTypes.AcceptCode, FollowUpTypes.RejectCode]) - tab.clickButton(FollowUpTypes.AcceptCode) - await tab.waitForChatFinishesLoading() - - await waitForChatItems(7) - const acceptedMessage = tab.getChatItems()[7] - - assert.deepStrictEqual(acceptedMessage?.type, 'answer-part') - assert.deepStrictEqual(acceptedMessage?.followUp?.options?.[0].pillText, 'Accepted') - }) - }) - - describe('Reject unit tests', async () => { - it('Clicks on reject', async () => { - await tab.waitForButtons([FollowUpTypes.AcceptCode, FollowUpTypes.RejectCode]) - tab.clickButton(FollowUpTypes.RejectCode) - await tab.waitForChatFinishesLoading() - - await waitForChatItems(7) - const rejectedMessage = tab.getChatItems()[7] - - assert.deepStrictEqual(rejectedMessage?.type, 'answer-part') - assert.deepStrictEqual(rejectedMessage?.followUp?.options?.[0].pillText, 'Rejected') - }) - }) - }) - } - }) -}) diff --git a/packages/amazonq/test/e2e/amazonq/transformByQ.test.ts b/packages/amazonq/test/e2e/amazonq/transformByQ.test.ts index 4493a7c2387..7a9273a1e84 100644 --- a/packages/amazonq/test/e2e/amazonq/transformByQ.test.ts +++ b/packages/amazonq/test/e2e/amazonq/transformByQ.test.ts @@ -129,8 +129,6 @@ describe('Amazon Q Code Transformation', function () { waitIntervalInMs: 1000, }) - // TO-DO: add this back when releasing CSB - /* const customDependencyVersionPrompt = tab.getChatItems().pop() assert.strictEqual( customDependencyVersionPrompt?.body?.includes('You can optionally upload a YAML file'), @@ -139,11 +137,10 @@ describe('Amazon Q Code Transformation', function () { tab.clickCustomFormButton({ id: 'gumbyTransformFormContinue' }) // 2 additional chat messages get sent after Continue button clicked; wait for both of them - await tab.waitForEvent(() => tab.getChatItems().length > 13, { + await tab.waitForEvent(() => tab.getChatItems().length > 10, { waitTimeoutInMs: 5000, waitIntervalInMs: 1000, }) - */ const sourceJdkPathPrompt = tab.getChatItems().pop() assert.strictEqual(sourceJdkPathPrompt?.body?.includes('Enter the path to JDK 8'), true) @@ -151,7 +148,7 @@ describe('Amazon Q Code Transformation', function () { tab.addChatMessage({ prompt: '/dummy/path/to/jdk8' }) // 2 additional chat messages get sent after JDK path submitted; wait for both of them - await tab.waitForEvent(() => tab.getChatItems().length > 10, { + await tab.waitForEvent(() => tab.getChatItems().length > 12, { waitTimeoutInMs: 5000, waitIntervalInMs: 1000, }) @@ -173,7 +170,7 @@ describe('Amazon Q Code Transformation', function () { text: 'View summary', }) - await tab.waitForEvent(() => tab.getChatItems().length > 11, { + await tab.waitForEvent(() => tab.getChatItems().length > 13, { waitTimeoutInMs: 5000, waitIntervalInMs: 1000, }) diff --git a/packages/amazonq/test/unit/amazonq/apps/inline/completion.test.ts b/packages/amazonq/test/unit/amazonq/apps/inline/completion.test.ts index fbc28feefbb..417c8be1426 100644 --- a/packages/amazonq/test/unit/amazonq/apps/inline/completion.test.ts +++ b/packages/amazonq/test/unit/amazonq/apps/inline/completion.test.ts @@ -26,9 +26,9 @@ import { ReferenceLogViewProvider, vsCodeState, } from 'aws-core-vscode/codewhisperer' -import { InlineGeneratingMessage } from '../../../../../src/app/inline/inlineGeneratingMessage' import { LineTracker } from '../../../../../src/app/inline/stateTracker/lineTracker' import { InlineTutorialAnnotation } from '../../../../../src/app/inline/tutorials/inlineTutorialAnnotation' +import { DocumentEventListener } from '../../../../../src/app/inline/documentEventListener' describe('InlineCompletionManager', () => { let manager: InlineCompletionManager @@ -244,17 +244,19 @@ describe('InlineCompletionManager', () => { let getAllRecommendationsStub: sinon.SinonStub let recommendationService: RecommendationService let inlineTutorialAnnotation: InlineTutorialAnnotation + let documentEventListener: DocumentEventListener beforeEach(() => { const lineTracker = new LineTracker() - const activeStateController = new InlineGeneratingMessage(lineTracker) inlineTutorialAnnotation = new InlineTutorialAnnotation(lineTracker, mockSessionManager) - recommendationService = new RecommendationService(mockSessionManager, activeStateController) + recommendationService = new RecommendationService(mockSessionManager) + documentEventListener = new DocumentEventListener() vsCodeState.isRecommendationsActive = false mockSessionManager = { getActiveSession: getActiveSessionStub, getActiveRecommendation: getActiveRecommendationStub, clear: () => {}, + updateCodeReferenceAndImports: () => {}, } as unknown as SessionManager getActiveSessionStub.returns({ @@ -273,7 +275,8 @@ describe('InlineCompletionManager', () => { languageClient, recommendationService, mockSessionManager, - inlineTutorialAnnotation + inlineTutorialAnnotation, + documentEventListener ) const items = await provider.provideInlineCompletionItems( mockDocument, @@ -289,7 +292,8 @@ describe('InlineCompletionManager', () => { languageClient, recommendationService, mockSessionManager, - inlineTutorialAnnotation + inlineTutorialAnnotation, + documentEventListener ) await provider.provideInlineCompletionItems(mockDocument, mockPosition, mockContext, mockToken) }), @@ -298,7 +302,8 @@ describe('InlineCompletionManager', () => { languageClient, recommendationService, mockSessionManager, - inlineTutorialAnnotation + inlineTutorialAnnotation, + documentEventListener ) getActiveRecommendationStub.returns([ { @@ -328,7 +333,8 @@ describe('InlineCompletionManager', () => { languageClient, recommendationService, mockSessionManager, - inlineTutorialAnnotation + inlineTutorialAnnotation, + documentEventListener ) const expectedText = `${mockSuggestions[1].insertText}this is my text` getActiveRecommendationStub.returns([ @@ -354,7 +360,8 @@ describe('InlineCompletionManager', () => { languageClient, recommendationService, mockSessionManager, - inlineTutorialAnnotation + inlineTutorialAnnotation, + documentEventListener ) getActiveRecommendationStub.returns([]) const messageShown = new Promise((resolve) => @@ -371,7 +378,7 @@ describe('InlineCompletionManager', () => { ) await messageShown }) - describe('debounce behavior', function () { + describe.skip('debounce behavior', function () { let clock: ReturnType beforeEach(function () { @@ -382,12 +389,13 @@ describe('InlineCompletionManager', () => { clock.uninstall() }) - it('should only trigger once on rapid events', async () => { + it.skip('should only trigger once on rapid events', async () => { provider = new AmazonQInlineCompletionItemProvider( languageClient, recommendationService, mockSessionManager, - inlineTutorialAnnotation + inlineTutorialAnnotation, + documentEventListener ) const p1 = provider.provideInlineCompletionItems(mockDocument, mockPosition, mockContext, mockToken) const p2 = provider.provideInlineCompletionItems(mockDocument, mockPosition, mockContext, mockToken) diff --git a/packages/amazonq/test/unit/amazonq/apps/inline/recommendationService.test.ts b/packages/amazonq/test/unit/amazonq/apps/inline/recommendationService.test.ts index 57eca77b147..2a6496927d7 100644 --- a/packages/amazonq/test/unit/amazonq/apps/inline/recommendationService.test.ts +++ b/packages/amazonq/test/unit/amazonq/apps/inline/recommendationService.test.ts @@ -5,22 +5,38 @@ import sinon from 'sinon' import { LanguageClient } from 'vscode-languageclient' -import { Position, CancellationToken, InlineCompletionItem } from 'vscode' +import { Position, CancellationToken, InlineCompletionItem, InlineCompletionTriggerKind } from 'vscode' import assert from 'assert' import { RecommendationService } from '../../../../../src/app/inline/recommendationService' import { SessionManager } from '../../../../../src/app/inline/sessionManager' import { createMockDocument } from 'aws-core-vscode/test' -import { LineTracker } from '../../../../../src/app/inline/stateTracker/lineTracker' -import { InlineGeneratingMessage } from '../../../../../src/app/inline/inlineGeneratingMessage' +// Import CursorUpdateManager directly instead of the interface +import { CursorUpdateManager } from '../../../../../src/app/inline/cursorUpdateManager' +import { CodeWhispererStatusBarManager } from 'aws-core-vscode/codewhisperer' +import { globals } from 'aws-core-vscode/shared' +import { DocumentEventListener } from '../../../../../src/app/inline/documentEventListener' +import { EditSuggestionState } from '../../../../../src/app/inline/editSuggestionState' + +const completionApi = 'aws/textDocument/inlineCompletionWithReferences' +const editApi = 'aws/textDocument/editCompletion' describe('RecommendationService', () => { let languageClient: LanguageClient let sendRequestStub: sinon.SinonStub let sandbox: sinon.SinonSandbox + let sessionManager: SessionManager + let service: RecommendationService + let cursorUpdateManager: CursorUpdateManager + let statusBarStub: any + let clockStub: sinon.SinonFakeTimers const mockDocument = createMockDocument() const mockPosition = { line: 0, character: 0 } as Position - const mockContext = { triggerKind: 1, selectedCompletionInfo: undefined } + const mockContext = { triggerKind: InlineCompletionTriggerKind.Automatic, selectedCompletionInfo: undefined } const mockToken = { isCancellationRequested: false } as CancellationToken + const mockDocumentEventListener = { + isLastEventDeletion: (filepath: string) => false, + getLastDocumentChangeEvent: (filepath: string) => undefined, + } as DocumentEventListener const mockInlineCompletionItemOne = { insertText: 'ItemOne', } as InlineCompletionItem @@ -29,19 +45,59 @@ describe('RecommendationService', () => { insertText: 'ItemTwo', } as InlineCompletionItem const mockPartialResultToken = 'some-random-token' - const sessionManager = new SessionManager() - const lineTracker = new LineTracker() - const activeStateController = new InlineGeneratingMessage(lineTracker) - const service = new RecommendationService(sessionManager, activeStateController) - beforeEach(() => { + beforeEach(async () => { sandbox = sinon.createSandbox() + // Create a fake clock for testing time-based functionality + clockStub = sandbox.useFakeTimers({ + now: 1000, + shouldAdvanceTime: true, + }) + + // Stub globals.clock + sandbox.stub(globals, 'clock').value({ + Date: { + now: () => clockStub.now, + }, + setTimeout: clockStub.setTimeout.bind(clockStub), + clearTimeout: clockStub.clearTimeout.bind(clockStub), + setInterval: clockStub.setInterval.bind(clockStub), + clearInterval: clockStub.clearInterval.bind(clockStub), + }) + sendRequestStub = sandbox.stub() languageClient = { sendRequest: sendRequestStub, + warn: sandbox.stub(), } as unknown as LanguageClient + + sessionManager = new SessionManager() + + // Create cursor update manager mock + cursorUpdateManager = { + recordCompletionRequest: sandbox.stub(), + logger: { debug: sandbox.stub(), warn: sandbox.stub(), error: sandbox.stub() }, + updateIntervalMs: 250, + isActive: false, + lastRequestTime: 0, + dispose: sandbox.stub(), + start: sandbox.stub(), + stop: sandbox.stub(), + updatePosition: sandbox.stub(), + } as unknown as CursorUpdateManager + + // Create status bar stub + statusBarStub = { + setLoading: sandbox.stub().resolves(), + refreshStatusBar: sandbox.stub().resolves(), + } + + sandbox.stub(CodeWhispererStatusBarManager, 'instance').get(() => statusBarStub) + + // Create the service without cursor update recorder initially + service = new RecommendationService(sessionManager) }) afterEach(() => { @@ -49,6 +105,28 @@ describe('RecommendationService', () => { sessionManager.clear() }) + describe('constructor', () => { + it('should initialize with optional cursorUpdateRecorder', () => { + const serviceWithRecorder = new RecommendationService(sessionManager, cursorUpdateManager) + + // Verify the service was created with the recorder + assert.strictEqual(serviceWithRecorder['cursorUpdateRecorder'], cursorUpdateManager) + }) + }) + + describe('setCursorUpdateRecorder', () => { + it('should set the cursor update recorder', () => { + // Initially the recorder should be undefined + assert.strictEqual(service['cursorUpdateRecorder'], undefined) + + // Set the recorder + service.setCursorUpdateRecorder(cursorUpdateManager) + + // Verify it was set correctly + assert.strictEqual(service['cursorUpdateRecorder'], cursorUpdateManager) + }) + }) + describe('getAllRecommendations', () => { it('should handle single request with no partial result token', async () => { const mockFirstResult = { @@ -59,17 +137,33 @@ describe('RecommendationService', () => { sendRequestStub.resolves(mockFirstResult) - await service.getAllRecommendations(languageClient, mockDocument, mockPosition, mockContext, mockToken) + await service.getAllRecommendations( + languageClient, + mockDocument, + mockPosition, + mockContext, + mockToken, + true, + mockDocumentEventListener + ) // Verify sendRequest was called with correct parameters - assert(sendRequestStub.calledOnce) - const requestArgs = sendRequestStub.firstCall.args[1] + const cs = sendRequestStub.getCalls() + const completionCalls = cs.filter((c) => c.firstArg === completionApi) + const editCalls = cs.filter((c) => c.firstArg === editApi) + assert.strictEqual(cs.length, 2) + assert.strictEqual(completionCalls.length, 1) + assert.strictEqual(editCalls.length, 1) + + const requestArgs = completionCalls[0].args[1] assert.deepStrictEqual(requestArgs, { textDocument: { uri: 'file:///test.py', }, position: mockPosition, context: mockContext, + documentChangeParams: undefined, + openTabFilepaths: [], }) // Verify session management @@ -93,24 +187,216 @@ describe('RecommendationService', () => { sendRequestStub.onFirstCall().resolves(mockFirstResult) sendRequestStub.onSecondCall().resolves(mockSecondResult) - await service.getAllRecommendations(languageClient, mockDocument, mockPosition, mockContext, mockToken) + await service.getAllRecommendations( + languageClient, + mockDocument, + mockPosition, + mockContext, + mockToken, + true, + mockDocumentEventListener + ) // Verify sendRequest was called with correct parameters - assert(sendRequestStub.calledTwice) - const firstRequestArgs = sendRequestStub.firstCall.args[1] + const cs = sendRequestStub.getCalls() + const completionCalls = cs.filter((c) => c.firstArg === completionApi) + const editCalls = cs.filter((c) => c.firstArg === editApi) + assert.strictEqual(cs.length, 3) + assert.strictEqual(completionCalls.length, 2) + assert.strictEqual(editCalls.length, 1) + + const firstRequestArgs = completionCalls[0].args[1] const expectedRequestArgs = { textDocument: { uri: 'file:///test.py', }, position: mockPosition, context: mockContext, + documentChangeParams: undefined, + openTabFilepaths: [], } - const secondRequestArgs = sendRequestStub.secondCall.args[1] + const secondRequestArgs = completionCalls[1].args[1] assert.deepStrictEqual(firstRequestArgs, expectedRequestArgs) assert.deepStrictEqual(secondRequestArgs, { ...expectedRequestArgs, partialResultToken: mockPartialResultToken, }) }) + + it('should record completion request when cursorUpdateRecorder is set', async () => { + // Set the cursor update recorder + service.setCursorUpdateRecorder(cursorUpdateManager) + + const mockFirstResult = { + sessionId: 'test-session', + items: [mockInlineCompletionItemOne], + partialResultToken: undefined, + } + + sendRequestStub.resolves(mockFirstResult) + + await service.getAllRecommendations( + languageClient, + mockDocument, + mockPosition, + mockContext, + mockToken, + true, + mockDocumentEventListener + ) + + // Verify recordCompletionRequest was called + // eslint-disable-next-line @typescript-eslint/unbound-method + sinon.assert.calledOnce(cursorUpdateManager.recordCompletionRequest as sinon.SinonStub) + }) + + it('should not show UI indicators when showUi option is false', async () => { + // Call with showUi: false option + await service.getAllRecommendations( + languageClient, + mockDocument, + mockPosition, + mockContext, + mockToken, + true, + mockDocumentEventListener, + { + showUi: false, + emitTelemetry: true, + } + ) + + // Verify UI methods were not called + sinon.assert.notCalled(statusBarStub.setLoading) + sinon.assert.notCalled(statusBarStub.refreshStatusBar) + }) + + it('should show UI indicators when showUi option is true (default)', async () => { + // Call with default options (showUi: true) + await service.getAllRecommendations( + languageClient, + mockDocument, + mockPosition, + mockContext, + mockToken, + true, + mockDocumentEventListener + ) + + // Verify UI methods were called + sinon.assert.calledOnce(statusBarStub.setLoading) + sinon.assert.calledOnce(statusBarStub.refreshStatusBar) + }) + + it('should handle errors gracefully', async () => { + // Set the cursor update recorder + service.setCursorUpdateRecorder(cursorUpdateManager) + + // Make the request throw an error + const testError = new Error('Test error') + sendRequestStub.rejects(testError) + + // Set up UI options + const options = { showUi: true } + + // Temporarily replace console.error with a no-op function to prevent test failure + const originalConsoleError = console.error + console.error = () => {} + + try { + // Call the method and expect it to handle the error + const result = await service.getAllRecommendations( + languageClient, + mockDocument, + mockPosition, + mockContext, + mockToken, + true, + mockDocumentEventListener, + options + ) + + // Assert that error handling was done correctly + assert.deepStrictEqual(result, []) + + // Verify the UI indicators were hidden even when an error occurs + sinon.assert.calledOnce(statusBarStub.refreshStatusBar) + } finally { + // Restore the original console.error function + console.error = originalConsoleError + } + }) + + it('should not make completion request when edit suggestion is active', async () => { + // Mock EditSuggestionState to return true (edit suggestion is active) + const isEditSuggestionActiveStub = sandbox.stub(EditSuggestionState, 'isEditSuggestionActive').returns(true) + + const mockResult = { + sessionId: 'test-session', + items: [mockInlineCompletionItemOne], + partialResultToken: undefined, + } + + sendRequestStub.resolves(mockResult) + + await service.getAllRecommendations( + languageClient, + mockDocument, + mockPosition, + mockContext, + mockToken, + true, + mockDocumentEventListener + ) + + // Verify sendRequest was called only for edit API, not completion API + const cs = sendRequestStub.getCalls() + const completionCalls = cs.filter((c) => c.firstArg === completionApi) + const editCalls = cs.filter((c) => c.firstArg === editApi) + + assert.strictEqual(cs.length, 1) // Only edit call + assert.strictEqual(completionCalls.length, 0) // No completion calls + assert.strictEqual(editCalls.length, 1) // One edit call + + // Verify the stub was called + sinon.assert.calledOnce(isEditSuggestionActiveStub) + }) + + it('should make completion request when edit suggestion is not active', async () => { + // Mock EditSuggestionState to return false (no edit suggestion active) + const isEditSuggestionActiveStub = sandbox + .stub(EditSuggestionState, 'isEditSuggestionActive') + .returns(false) + + const mockResult = { + sessionId: 'test-session', + items: [mockInlineCompletionItemOne], + partialResultToken: undefined, + } + + sendRequestStub.resolves(mockResult) + + await service.getAllRecommendations( + languageClient, + mockDocument, + mockPosition, + mockContext, + mockToken, + true, + mockDocumentEventListener + ) + + // Verify sendRequest was called for both APIs + const cs = sendRequestStub.getCalls() + const completionCalls = cs.filter((c) => c.firstArg === completionApi) + const editCalls = cs.filter((c) => c.firstArg === editApi) + + assert.strictEqual(cs.length, 2) // Both calls + assert.strictEqual(completionCalls.length, 1) // One completion call + assert.strictEqual(editCalls.length, 1) // One edit call + + // Verify the stub was called + sinon.assert.calledOnce(isEditSuggestionActiveStub) + }) }) }) diff --git a/packages/amazonq/test/unit/amazonq/lsp/client.test.ts b/packages/amazonq/test/unit/amazonq/lsp/client.test.ts new file mode 100644 index 00000000000..7c99c47e0ea --- /dev/null +++ b/packages/amazonq/test/unit/amazonq/lsp/client.test.ts @@ -0,0 +1,268 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import assert from 'assert' +import sinon from 'sinon' +import { LanguageClient } from 'vscode-languageclient' +import { AuthUtil } from 'aws-core-vscode/codewhisperer' +import { AmazonQLspAuth } from '../../../../src/lsp/auth' + +// These tests verify the behavior of the authentication functions +// Since the actual functions are module-level and use real dependencies, +// we test the expected behavior through mock implementations + +describe('Language Server Client Authentication', function () { + let sandbox: sinon.SinonSandbox + let mockClient: any + let mockAuth: any + let authUtilStub: sinon.SinonStub + let loggerStub: any + let getLoggerStub: sinon.SinonStub + let pushConfigUpdateStub: sinon.SinonStub + + beforeEach(() => { + sandbox = sinon.createSandbox() + + // Mock LanguageClient + mockClient = { + sendRequest: sandbox.stub().resolves(), + sendNotification: sandbox.stub(), + onDidChangeState: sandbox.stub(), + } + + // Mock AmazonQLspAuth + mockAuth = { + refreshConnection: sandbox.stub().resolves(), + } + + // Mock AuthUtil + authUtilStub = sandbox.stub(AuthUtil, 'instance').get(() => ({ + isConnectionValid: sandbox.stub().returns(true), + regionProfileManager: { + activeRegionProfile: { arn: 'test-profile-arn' }, + }, + auth: { + getConnectionState: sandbox.stub().returns('valid'), + activeConnection: { id: 'test-connection' }, + }, + })) + + // Create logger stub + loggerStub = { + info: sandbox.stub(), + debug: sandbox.stub(), + warn: sandbox.stub(), + error: sandbox.stub(), + } + + // Clear all relevant module caches + const sharedModuleId = require.resolve('aws-core-vscode/shared') + const configModuleId = require.resolve('../../../../src/lsp/config') + delete require.cache[sharedModuleId] + delete require.cache[configModuleId] + + // jscpd:ignore-start + // Create getLogger stub + getLoggerStub = sandbox.stub().returns(loggerStub) + + // Create a mock shared module with stubbed getLogger + const mockSharedModule = { + getLogger: getLoggerStub, + } + + // Override the require cache with our mock + require.cache[sharedModuleId] = { + id: sharedModuleId, + filename: sharedModuleId, + loaded: true, + parent: undefined, + children: [], + exports: mockSharedModule, + paths: [], + } as any + // jscpd:ignore-end + + // Mock pushConfigUpdate + pushConfigUpdateStub = sandbox.stub().resolves() + const mockConfigModule = { + pushConfigUpdate: pushConfigUpdateStub, + } + + require.cache[configModuleId] = { + id: configModuleId, + filename: configModuleId, + loaded: true, + parent: undefined, + children: [], + exports: mockConfigModule, + paths: [], + } as any + }) + + afterEach(() => { + sandbox.restore() + }) + + describe('initializeLanguageServerConfiguration behavior', function () { + it('should initialize configuration when connection is valid', async function () { + // Test the expected behavior of the function + const mockInitializeFunction = async (client: LanguageClient, context: string) => { + const { getLogger } = require('aws-core-vscode/shared') + const { pushConfigUpdate } = require('../../../../src/lsp/config') + const logger = getLogger('amazonqLsp') + + if (AuthUtil.instance.isConnectionValid()) { + logger.info(`[${context}] Initializing language server configuration`) + + // Send profile configuration + logger.debug(`[${context}] Sending profile configuration to language server`) + await pushConfigUpdate(client, { + type: 'profile', + profileArn: AuthUtil.instance.regionProfileManager.activeRegionProfile?.arn, + }) + logger.debug(`[${context}] Profile configuration sent successfully`) + + // Send customization configuration + logger.debug(`[${context}] Sending customization configuration to language server`) + await pushConfigUpdate(client, { + type: 'customization', + customization: 'test-customization', + }) + logger.debug(`[${context}] Customization configuration sent successfully`) + + logger.info(`[${context}] Language server configuration completed successfully`) + } else { + logger.warn(`[${context}] Connection invalid, skipping configuration`) + } + } + + await mockInitializeFunction(mockClient as any, 'startup') + + // Verify logging + assert(loggerStub.info.calledWith('[startup] Initializing language server configuration')) + assert(loggerStub.debug.calledWith('[startup] Sending profile configuration to language server')) + assert(loggerStub.debug.calledWith('[startup] Profile configuration sent successfully')) + assert(loggerStub.debug.calledWith('[startup] Sending customization configuration to language server')) + assert(loggerStub.debug.calledWith('[startup] Customization configuration sent successfully')) + assert(loggerStub.info.calledWith('[startup] Language server configuration completed successfully')) + + // Verify pushConfigUpdate was called twice + assert.strictEqual(pushConfigUpdateStub.callCount, 2) + + // Verify profile configuration + assert( + pushConfigUpdateStub.calledWith(mockClient, { + type: 'profile', + profileArn: 'test-profile-arn', + }) + ) + + // Verify customization configuration + assert( + pushConfigUpdateStub.calledWith(mockClient, { + type: 'customization', + customization: 'test-customization', + }) + ) + }) + + it('should log warning when connection is invalid', async function () { + // Mock invalid connection + authUtilStub.get(() => ({ + isConnectionValid: sandbox.stub().returns(false), + auth: { + getConnectionState: sandbox.stub().returns('invalid'), + activeConnection: { id: 'test-connection' }, + }, + })) + + const mockInitializeFunction = async (client: LanguageClient, context: string) => { + const { getLogger } = require('aws-core-vscode/shared') + const logger = getLogger('amazonqLsp') + + // jscpd:ignore-start + if (AuthUtil.instance.isConnectionValid()) { + // Should not reach here + } else { + logger.warn( + `[${context}] Connection invalid, skipping language server configuration - this will cause authentication failures` + ) + const activeConnection = AuthUtil.instance.auth.activeConnection + const connectionState = activeConnection + ? AuthUtil.instance.auth.getConnectionState(activeConnection) + : 'no-connection' + logger.warn(`[${context}] Connection state: ${connectionState}`) + // jscpd:ignore-end + } + } + + await mockInitializeFunction(mockClient as any, 'crash-recovery') + + // Verify warning logs + assert( + loggerStub.warn.calledWith( + '[crash-recovery] Connection invalid, skipping language server configuration - this will cause authentication failures' + ) + ) + assert(loggerStub.warn.calledWith('[crash-recovery] Connection state: invalid')) + + // Verify pushConfigUpdate was not called + assert.strictEqual(pushConfigUpdateStub.callCount, 0) + }) + }) + + describe('crash recovery handler behavior', function () { + it('should reinitialize authentication after crash', async function () { + const mockCrashHandler = async (client: LanguageClient, auth: AmazonQLspAuth) => { + const { getLogger } = require('aws-core-vscode/shared') + const { pushConfigUpdate } = require('../../../../src/lsp/config') + const logger = getLogger('amazonqLsp') + + logger.info('[crash-recovery] Language server crash detected, reinitializing authentication') + + try { + logger.debug('[crash-recovery] Refreshing connection and sending bearer token') + await auth.refreshConnection(true) + logger.debug('[crash-recovery] Bearer token sent successfully') + + // Mock the configuration initialization + if (AuthUtil.instance.isConnectionValid()) { + await pushConfigUpdate(client, { + type: 'profile', + profileArn: AuthUtil.instance.regionProfileManager.activeRegionProfile?.arn, + }) + } + + logger.info('[crash-recovery] Authentication reinitialized successfully') + } catch (error) { + logger.error(`[crash-recovery] Failed to reinitialize after crash: ${error}`) + } + } + + await mockCrashHandler(mockClient as any, mockAuth as any) + + // Verify crash recovery logging + assert( + loggerStub.info.calledWith( + '[crash-recovery] Language server crash detected, reinitializing authentication' + ) + ) + assert(loggerStub.debug.calledWith('[crash-recovery] Refreshing connection and sending bearer token')) + assert(loggerStub.debug.calledWith('[crash-recovery] Bearer token sent successfully')) + assert(loggerStub.info.calledWith('[crash-recovery] Authentication reinitialized successfully')) + + // Verify auth.refreshConnection was called + assert(mockAuth.refreshConnection.calledWith(true)) + + // Verify profile configuration was sent + assert( + pushConfigUpdateStub.calledWith(mockClient, { + type: 'profile', + profileArn: 'test-profile-arn', + }) + ) + }) + }) +}) diff --git a/packages/amazonq/test/unit/amazonq/lsp/config.test.ts b/packages/amazonq/test/unit/amazonq/lsp/config.test.ts index 69b15d6e311..c31e873e181 100644 --- a/packages/amazonq/test/unit/amazonq/lsp/config.test.ts +++ b/packages/amazonq/test/unit/amazonq/lsp/config.test.ts @@ -77,3 +77,151 @@ describe('getAmazonQLspConfig', () => { delete process.env.__AMAZONQLSP_UI } }) + +describe('pushConfigUpdate', () => { + let sandbox: sinon.SinonSandbox + let mockClient: any + let loggerStub: any + let getLoggerStub: sinon.SinonStub + let pushConfigUpdate: any + + beforeEach(() => { + sandbox = sinon.createSandbox() + + // Mock LanguageClient + mockClient = { + sendRequest: sandbox.stub().resolves(), + sendNotification: sandbox.stub(), + } + + // Create logger stub + loggerStub = { + debug: sandbox.stub(), + } + + // Clear all relevant module caches + const configModuleId = require.resolve('../../../../src/lsp/config') + const sharedModuleId = require.resolve('aws-core-vscode/shared') + delete require.cache[configModuleId] + delete require.cache[sharedModuleId] + + // jscpd:ignore-start + // Create getLogger stub and store reference for test verification + getLoggerStub = sandbox.stub().returns(loggerStub) + + // Create a mock shared module with stubbed getLogger + const mockSharedModule = { + getLogger: getLoggerStub, + } + + // Override the require cache with our mock + require.cache[sharedModuleId] = { + id: sharedModuleId, + filename: sharedModuleId, + loaded: true, + parent: undefined, + children: [], + exports: mockSharedModule, + paths: [], + } as any + + // Now require the module - it should use our mocked getLogger + // jscpd:ignore-end + const configModule = require('../../../../src/lsp/config') + pushConfigUpdate = configModule.pushConfigUpdate + }) + + afterEach(() => { + sandbox.restore() + }) + + it('should send profile configuration with logging', async () => { + const config = { + type: 'profile' as const, + profileArn: 'test-profile-arn', + } + + await pushConfigUpdate(mockClient, config) + + // Verify logging + assert(loggerStub.debug.calledWith('Pushing profile configuration: test-profile-arn')) + assert(loggerStub.debug.calledWith('Profile configuration pushed successfully')) + + // Verify client call + assert(mockClient.sendRequest.calledOnce) + assert( + mockClient.sendRequest.calledWith(sinon.match.string, { + section: 'aws.q', + settings: { profileArn: 'test-profile-arn' }, + }) + ) + }) + + it('should send customization configuration with logging', async () => { + const config = { + type: 'customization' as const, + customization: 'test-customization-arn', + } + + await pushConfigUpdate(mockClient, config) + + // Verify logging + assert(loggerStub.debug.calledWith('Pushing customization configuration: test-customization-arn')) + assert(loggerStub.debug.calledWith('Customization configuration pushed successfully')) + + // Verify client call + assert(mockClient.sendNotification.calledOnce) + assert( + mockClient.sendNotification.calledWith(sinon.match.string, { + section: 'aws.q', + settings: { customization: 'test-customization-arn' }, + }) + ) + }) + + it('should handle undefined profile ARN', async () => { + const config = { + type: 'profile' as const, + profileArn: undefined, + } + + await pushConfigUpdate(mockClient, config) + + // Verify logging with undefined + assert(loggerStub.debug.calledWith('Pushing profile configuration: undefined')) + assert(loggerStub.debug.calledWith('Profile configuration pushed successfully')) + }) + + it('should handle undefined customization ARN', async () => { + const config = { + type: 'customization' as const, + customization: undefined, + } + + await pushConfigUpdate(mockClient, config) + + // Verify logging with undefined + assert(loggerStub.debug.calledWith('Pushing customization configuration: undefined')) + assert(loggerStub.debug.calledWith('Customization configuration pushed successfully')) + }) + + it('should send logLevel configuration with logging', async () => { + const config = { + type: 'logLevel' as const, + } + + await pushConfigUpdate(mockClient, config) + + // Verify logging + assert(loggerStub.debug.calledWith('Pushing log level configuration')) + assert(loggerStub.debug.calledWith('Log level configuration pushed successfully')) + + // Verify client call + assert(mockClient.sendNotification.calledOnce) + assert( + mockClient.sendNotification.calledWith(sinon.match.string, { + section: 'aws.logLevel', + }) + ) + }) +}) diff --git a/packages/amazonq/test/unit/amazonqFeatureDev/session/chatSessionStorage.test.ts b/packages/amazonq/test/unit/amazonqFeatureDev/session/chatSessionStorage.test.ts deleted file mode 100644 index 4c6073114f8..00000000000 --- a/packages/amazonq/test/unit/amazonqFeatureDev/session/chatSessionStorage.test.ts +++ /dev/null @@ -1,25 +0,0 @@ -/*! - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ -import * as assert from 'assert' -import { FeatureDevChatSessionStorage } from 'aws-core-vscode/amazonqFeatureDev' -import { Messenger } from 'aws-core-vscode/amazonq' -import { createMessenger } from 'aws-core-vscode/test' - -describe('chatSession', () => { - const tabID = '1234' - let chatStorage: FeatureDevChatSessionStorage - let messenger: Messenger - - beforeEach(() => { - messenger = createMessenger() - chatStorage = new FeatureDevChatSessionStorage(messenger) - }) - - it('locks getSession', async () => { - const results = await Promise.allSettled([chatStorage.getSession(tabID), chatStorage.getSession(tabID)]) - assert.equal(results.length, 2) - assert.deepStrictEqual(results[0], results[1]) - }) -}) diff --git a/packages/amazonq/test/unit/amazonqFeatureDev/session/session.test.ts b/packages/amazonq/test/unit/amazonqFeatureDev/session/session.test.ts deleted file mode 100644 index 39c38de555f..00000000000 --- a/packages/amazonq/test/unit/amazonqFeatureDev/session/session.test.ts +++ /dev/null @@ -1,129 +0,0 @@ -/*! - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -import * as vscode from 'vscode' -import * as assert from 'assert' - -import sinon from 'sinon' - -import { - ControllerSetup, - createController, - createMessenger, - createSession, - generateVirtualMemoryUri, - sessionRegisterProvider, - sessionWriteFile, - assertTelemetry, -} from 'aws-core-vscode/test' -import { FeatureDevClient, featureDevScheme, FeatureDevCodeGenState } from 'aws-core-vscode/amazonqFeatureDev' -import { Messenger, CurrentWsFolders } from 'aws-core-vscode/amazonq' -import path from 'path' -import { fs } from 'aws-core-vscode/shared' - -describe('session', () => { - const conversationID = '12345' - let messenger: Messenger - - beforeEach(() => { - messenger = createMessenger() - }) - - afterEach(() => { - sinon.restore() - }) - - describe('preloader', () => { - it('emits start chat telemetry', async () => { - const session = await createSession({ messenger, conversationID, scheme: featureDevScheme }) - session.latestMessage = 'implement twosum in typescript' - - await session.preloader() - - assertTelemetry('amazonq_startConversationInvoke', { - amazonqConversationId: conversationID, - }) - }) - }) - describe('insertChanges', async () => { - afterEach(() => { - sinon.restore() - }) - - let workspaceFolderUriFsPath: string - const notRejectedFileName = 'notRejectedFile.js' - const notRejectedFileContent = 'notrejectedFileContent' - let uri: vscode.Uri - let encodedContent: Uint8Array - - async function createCodeGenState() { - const controllerSetup: ControllerSetup = await createController() - - const uploadID = '789' - const tabID = '123' - const workspaceFolders = [controllerSetup.workspaceFolder] as CurrentWsFolders - workspaceFolderUriFsPath = controllerSetup.workspaceFolder.uri.fsPath - uri = generateVirtualMemoryUri(uploadID, notRejectedFileName, featureDevScheme) - - const testConfig = { - conversationId: conversationID, - proxyClient: {} as unknown as FeatureDevClient, - workspaceRoots: [''], - uploadId: uploadID, - workspaceFolders, - } - - const codeGenState = new FeatureDevCodeGenState( - testConfig, - [ - { - zipFilePath: notRejectedFileName, - relativePath: notRejectedFileName, - fileContent: notRejectedFileContent, - rejected: false, - virtualMemoryUri: uri, - workspaceFolder: controllerSetup.workspaceFolder, - changeApplied: false, - }, - { - zipFilePath: 'rejectedFile.js', - relativePath: 'rejectedFile.js', - fileContent: 'rejectedFileContent', - rejected: true, - virtualMemoryUri: generateVirtualMemoryUri(uploadID, 'rejectedFile.js', featureDevScheme), - workspaceFolder: controllerSetup.workspaceFolder, - changeApplied: false, - }, - ], - [], - [], - tabID, - 0, - {} - ) - const session = await createSession({ - messenger, - sessionState: codeGenState, - conversationID, - scheme: featureDevScheme, - }) - encodedContent = new TextEncoder().encode(notRejectedFileContent) - await sessionRegisterProvider(session, uri, encodedContent) - return session - } - it('only insert non rejected files', async () => { - const fsSpyWriteFile = sinon.spy(fs, 'writeFile') - const session = await createCodeGenState() - sinon.stub(session, 'sendLinesOfCodeAcceptedTelemetry').resolves() - await sessionWriteFile(session, uri, encodedContent) - await session.insertChanges() - - const absolutePath = path.join(workspaceFolderUriFsPath, notRejectedFileName) - - assert.ok(fsSpyWriteFile.calledOnce) - assert.ok(fsSpyWriteFile.calledWith(absolutePath, notRejectedFileContent)) - }) - }) -}) diff --git a/packages/amazonq/test/unit/amazonqFeatureDev/util/files.test.ts b/packages/amazonq/test/unit/amazonqFeatureDev/util/files.test.ts deleted file mode 100644 index 574d0a25a19..00000000000 --- a/packages/amazonq/test/unit/amazonqFeatureDev/util/files.test.ts +++ /dev/null @@ -1,172 +0,0 @@ -/*! - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ -import * as vscode from 'vscode' -import assert from 'assert' -import { - prepareRepoData, - PrepareRepoDataOptions, - TelemetryHelper, - maxRepoSizeBytes, -} from 'aws-core-vscode/amazonqFeatureDev' -import { assertTelemetry, getWorkspaceFolder, TestFolder } from 'aws-core-vscode/test' -import { fs, AmazonqCreateUpload, ZipStream, ContentLengthError } from 'aws-core-vscode/shared' -import { MetricName, Span } from 'aws-core-vscode/telemetry' -import sinon from 'sinon' -import { CodeWhispererSettings } from 'aws-core-vscode/codewhisperer' -import { CurrentWsFolders } from 'aws-core-vscode/amazonq' -import path from 'path' - -const testDevfilePrepareRepo = async (devfileEnabled: boolean) => { - const files: Record = { - 'file.md': 'test content', - // only include when execution is enabled - 'devfile.yaml': 'test', - // .git folder is always dropped (because of vscode global exclude rules) - '.git/ref': '####', - // .gitignore should always be included - '.gitignore': 'node_models/*', - // non code files only when dev execution is enabled - 'abc.jar': 'jar-content', - 'data/logo.ico': 'binary-content', - } - const folder = await TestFolder.create() - - for (const [fileName, content] of Object.entries(files)) { - await folder.write(fileName, content) - } - - const expectedFiles = !devfileEnabled - ? ['file.md', '.gitignore'] - : ['devfile.yaml', 'file.md', '.gitignore', 'abc.jar', 'data/logo.ico'] - - const workspace = getWorkspaceFolder(folder.path) - sinon - .stub(CodeWhispererSettings.instance, 'getAutoBuildSetting') - .returns(devfileEnabled ? { [workspace.uri.fsPath]: true } : {}) - - await testPrepareRepoData([workspace], expectedFiles, { telemetry: new TelemetryHelper() }) -} - -const testPrepareRepoData = async ( - workspaces: vscode.WorkspaceFolder[], - expectedFiles: string[], - prepareRepoDataOptions: PrepareRepoDataOptions, - expectedTelemetryMetrics?: Array<{ metricName: MetricName; value: any }> -) => { - expectedFiles.sort((a, b) => a.localeCompare(b)) - const result = await prepareRepoData( - workspaces.map((ws) => ws.uri.fsPath), - workspaces as CurrentWsFolders, - { - record: () => {}, - } as unknown as Span, - prepareRepoDataOptions - ) - - assert.strictEqual(Buffer.isBuffer(result.zipFileBuffer), true) - // checksum is not the same across different test executions because some unique random folder names are generated - assert.strictEqual(result.zipFileChecksum.length, 44) - - if (expectedTelemetryMetrics) { - for (const metric of expectedTelemetryMetrics) { - assertTelemetry(metric.metricName, metric.value) - } - } - - // Unzip the buffer and compare the entry names - const zipEntries = await ZipStream.unzip(result.zipFileBuffer) - const actualZipEntries = zipEntries.map((entry) => entry.filename) - actualZipEntries.sort((a, b) => a.localeCompare(b)) - assert.deepStrictEqual(actualZipEntries, expectedFiles) -} - -describe('file utils', () => { - describe('prepareRepoData', function () { - const defaultPrepareRepoDataOptions: PrepareRepoDataOptions = { telemetry: new TelemetryHelper() } - - afterEach(() => { - sinon.restore() - }) - - it('returns files in the workspace as a zip', async function () { - const folder = await TestFolder.create() - await folder.write('file1.md', 'test content') - await folder.write('file2.md', 'test content') - await folder.write('docs/infra.svg', 'test content') - const workspace = getWorkspaceFolder(folder.path) - - await testPrepareRepoData([workspace], ['file1.md', 'file2.md'], defaultPrepareRepoDataOptions) - }) - - it('infrastructure diagram is included', async function () { - const folder = await TestFolder.create() - await folder.write('file1.md', 'test content') - await folder.write('file2.svg', 'test content') - await folder.write('docs/infra.svg', 'test content') - const workspace = getWorkspaceFolder(folder.path) - - await testPrepareRepoData([workspace], ['file1.md', 'docs/infra.svg'], { - telemetry: new TelemetryHelper(), - isIncludeInfraDiagram: true, - }) - }) - - it('prepareRepoData ignores denied file extensions', async function () { - const folder = await TestFolder.create() - await folder.write('file.mp4', 'test content') - const workspace = getWorkspaceFolder(folder.path) - - await testPrepareRepoData([workspace], [], defaultPrepareRepoDataOptions, [ - { metricName: 'amazonq_bundleExtensionIgnored', value: { filenameExt: 'mp4', count: 1 } }, - ]) - }) - - it('should ignore devfile.yaml when setting is disabled', async function () { - await testDevfilePrepareRepo(false) - }) - - it('should include devfile.yaml when setting is enabled', async function () { - await testDevfilePrepareRepo(true) - }) - - // Test the logic that allows the customer to modify root source folder - it('prepareRepoData throws a ContentLengthError code when repo is too big', async function () { - const folder = await TestFolder.create() - await folder.write('file.md', 'test content') - const workspace = getWorkspaceFolder(folder.path) - - sinon.stub(fs, 'stat').resolves({ size: 2 * maxRepoSizeBytes } as vscode.FileStat) - await assert.rejects( - () => - prepareRepoData( - [workspace.uri.fsPath], - [workspace], - { - record: () => {}, - } as unknown as Span, - defaultPrepareRepoDataOptions - ), - ContentLengthError - ) - }) - - it('prepareRepoData properly handles multi-root workspaces', async function () { - const folder = await TestFolder.create() - const testFilePath = 'innerFolder/file.md' - await folder.write(testFilePath, 'test content') - - // Add a folder and its subfolder to the workspace - const workspace1 = getWorkspaceFolder(folder.path) - const workspace2 = getWorkspaceFolder(folder.path + '/innerFolder') - const folderName = path.basename(folder.path) - - await testPrepareRepoData( - [workspace1, workspace2], - [`${folderName}_${workspace1.name}/${testFilePath}`], - defaultPrepareRepoDataOptions - ) - }) - }) -}) diff --git a/packages/amazonq/test/unit/app/inline/EditRendering/diffUtils.test.ts b/packages/amazonq/test/unit/app/inline/EditRendering/diffUtils.test.ts new file mode 100644 index 00000000000..dee096d7f57 --- /dev/null +++ b/packages/amazonq/test/unit/app/inline/EditRendering/diffUtils.test.ts @@ -0,0 +1,83 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as assert from 'assert' +import { applyUnifiedDiff } from '../../../../../src/app/inline/EditRendering/diffUtils' + +describe('diffUtils', function () { + describe('applyUnifiedDiff', function () { + it('should correctly apply a unified diff to original text', function () { + // Original code + const originalCode = 'function add(a, b) {\n return a + b;\n}' + + // Unified diff that adds a comment and modifies the return statement + const unifiedDiff = + '--- a/file.js\n' + + '+++ b/file.js\n' + + '@@ -1,3 +1,4 @@\n' + + ' function add(a, b) {\n' + + '+ // Add two numbers\n' + + '- return a + b;\n' + + '+ return a + b; // Return the sum\n' + + ' }' + + // Expected result after applying the diff + const expectedResult = 'function add(a, b) {\n // Add two numbers\n return a + b; // Return the sum\n}' + + // Apply the diff + const appliedCode = applyUnifiedDiff(originalCode, unifiedDiff) + + // Verify the result + assert.strictEqual(appliedCode, expectedResult) + }) + }) + + describe('applyUnifiedDiff with complex changes', function () { + it('should handle multiple hunks in a diff', function () { + // Original code with multiple functions + const originalCode = + 'function add(a, b) {\n' + + ' return a + b;\n' + + '}\n' + + '\n' + + 'function subtract(a, b) {\n' + + ' return a - b;\n' + + '}' + + // Unified diff that modifies both functions + const unifiedDiff = + '--- a/file.js\n' + + '+++ b/file.js\n' + + '@@ -1,3 +1,4 @@\n' + + ' function add(a, b) {\n' + + '+ // Addition function\n' + + ' return a + b;\n' + + ' }\n' + + '@@ -5,3 +6,4 @@\n' + + ' function subtract(a, b) {\n' + + '+ // Subtraction function\n' + + ' return a - b;\n' + + ' }' + + // Expected result after applying the diff + const expectedResult = + 'function add(a, b) {\n' + + ' // Addition function\n' + + ' return a + b;\n' + + '}\n' + + '\n' + + 'function subtract(a, b) {\n' + + ' // Subtraction function\n' + + ' return a - b;\n' + + '}' + + // Apply the diff + const appliedCode = applyUnifiedDiff(originalCode, unifiedDiff) + + // Verify the result + assert.strictEqual(appliedCode, expectedResult) + }) + }) +}) diff --git a/packages/amazonq/test/unit/app/inline/EditRendering/displayImage.test.ts b/packages/amazonq/test/unit/app/inline/EditRendering/displayImage.test.ts new file mode 100644 index 00000000000..b88e30487a5 --- /dev/null +++ b/packages/amazonq/test/unit/app/inline/EditRendering/displayImage.test.ts @@ -0,0 +1,176 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' +import * as sinon from 'sinon' +import assert from 'assert' +import { EditDecorationManager } from '../../../../../src/app/inline/EditRendering/displayImage' + +describe('EditDecorationManager', function () { + let sandbox: sinon.SinonSandbox + let editorStub: sinon.SinonStubbedInstance + let documentStub: sinon.SinonStubbedInstance + let windowStub: sinon.SinonStubbedInstance + let commandsStub: sinon.SinonStubbedInstance + let decorationTypeStub: sinon.SinonStubbedInstance + let manager: EditDecorationManager + + beforeEach(function () { + sandbox = sinon.createSandbox() + + // Create stubs for vscode objects + decorationTypeStub = { + dispose: sandbox.stub(), + } as unknown as sinon.SinonStubbedInstance + + documentStub = { + getText: sandbox.stub().returns('Original code content'), + lineCount: 5, + lineAt: sandbox.stub().returns({ + text: 'Line text content', + range: new vscode.Range(0, 0, 0, 18), + rangeIncludingLineBreak: new vscode.Range(0, 0, 0, 19), + firstNonWhitespaceCharacterIndex: 0, + isEmptyOrWhitespace: false, + }), + } as unknown as sinon.SinonStubbedInstance + + editorStub = { + document: documentStub, + setDecorations: sandbox.stub(), + edit: sandbox.stub().resolves(true), + } as unknown as sinon.SinonStubbedInstance + + windowStub = sandbox.stub(vscode.window) + windowStub.createTextEditorDecorationType.returns(decorationTypeStub as any) + + commandsStub = sandbox.stub(vscode.commands) + commandsStub.registerCommand.returns({ dispose: sandbox.stub() }) + + // Create a new instance of EditDecorationManager for each test + manager = new EditDecorationManager() + }) + + afterEach(function () { + sandbox.restore() + }) + + it('should display SVG decorations in the editor', async function () { + // Create a fake SVG image URI + const svgUri = vscode.Uri.parse('file:///path/to/image.svg') + + // Create accept and reject handlers + const acceptHandler = sandbox.stub() + const rejectHandler = sandbox.stub() + + // Reset the setDecorations stub to clear any previous calls + editorStub.setDecorations.reset() + + // Call displayEditSuggestion + await manager.displayEditSuggestion( + editorStub as unknown as vscode.TextEditor, + svgUri, + 0, + acceptHandler, + rejectHandler, + 'Original code', + 'New code', + [{ line: 0, start: 0, end: 0 }] + ) + + // Verify decorations were set (we expect 4 calls because clearDecorations is called first) + assert.strictEqual(editorStub.setDecorations.callCount, 4) + + // Verify the third call is for the image decoration (after clearDecorations) + const imageCall = editorStub.setDecorations.getCall(2) + assert.strictEqual(imageCall.args[0], manager['imageDecorationType']) + assert.strictEqual(imageCall.args[1].length, 1) + + // Verify the fourth call is for the removed code decoration + const removedCodeCall = editorStub.setDecorations.getCall(3) + assert.strictEqual(removedCodeCall.args[0], manager['removedCodeDecorationType']) + }) + + // Helper function to setup edit suggestion test + async function setupEditSuggestionTest() { + // Create a fake SVG image URI + const svgUri = vscode.Uri.parse('file:///path/to/image.svg') + + // Create accept and reject handlers + const acceptHandler = sandbox.stub() + const rejectHandler = sandbox.stub() + + // Display the edit suggestion + await manager.displayEditSuggestion( + editorStub as unknown as vscode.TextEditor, + svgUri, + 0, + acceptHandler, + rejectHandler, + 'Original code', + 'New code', + [{ line: 0, start: 0, end: 0 }] + ) + + return { acceptHandler, rejectHandler } + } + + it('should trigger accept handler when command is executed', async function () { + const { acceptHandler, rejectHandler } = await setupEditSuggestionTest() + + // Find the command handler that was registered for accept + const acceptCommandArgs = commandsStub.registerCommand.args.find( + (args) => args[0] === 'aws.amazonq.inline.acceptEdit' + ) + + // Execute the accept command handler if found + if (acceptCommandArgs && acceptCommandArgs[1]) { + const acceptCommandHandler = acceptCommandArgs[1] + acceptCommandHandler() + + // Verify the accept handler was called + sinon.assert.calledOnce(acceptHandler) + sinon.assert.notCalled(rejectHandler) + } else { + assert.fail('Accept command handler not found') + } + }) + + it('should trigger reject handler when command is executed', async function () { + const { acceptHandler, rejectHandler } = await setupEditSuggestionTest() + + // Find the command handler that was registered for reject + const rejectCommandArgs = commandsStub.registerCommand.args.find( + (args) => args[0] === 'aws.amazonq.inline.rejectEdit' + ) + + // Execute the reject command handler if found + if (rejectCommandArgs && rejectCommandArgs[1]) { + const rejectCommandHandler = rejectCommandArgs[1] + rejectCommandHandler() + + // Verify the reject handler was called + sinon.assert.calledOnce(rejectHandler) + sinon.assert.notCalled(acceptHandler) + } else { + assert.fail('Reject command handler not found') + } + }) + + it('should clear decorations when requested', async function () { + // Reset the setDecorations stub to clear any previous calls + editorStub.setDecorations.reset() + + // Call clearDecorations + await manager.clearDecorations(editorStub as unknown as vscode.TextEditor) + + // Verify decorations were cleared + assert.strictEqual(editorStub.setDecorations.callCount, 2) + + // Verify both decoration types were cleared + sinon.assert.calledWith(editorStub.setDecorations.firstCall, manager['imageDecorationType'], []) + sinon.assert.calledWith(editorStub.setDecorations.secondCall, manager['removedCodeDecorationType'], []) + }) +}) diff --git a/packages/amazonq/test/unit/app/inline/EditRendering/imageRenderer.test.ts b/packages/amazonq/test/unit/app/inline/EditRendering/imageRenderer.test.ts new file mode 100644 index 00000000000..e1c32778d83 --- /dev/null +++ b/packages/amazonq/test/unit/app/inline/EditRendering/imageRenderer.test.ts @@ -0,0 +1,269 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' +import * as sinon from 'sinon' +import assert from 'assert' +// Remove static import - we'll use dynamic import instead +// import { showEdits } from '../../../../../src/app/inline/EditRendering/imageRenderer' +import { SvgGenerationService } from '../../../../../src/app/inline/EditRendering/svgGenerator' +import { InlineCompletionItemWithReferences } from '@aws/language-server-runtimes/protocol' + +describe('showEdits', function () { + let sandbox: sinon.SinonSandbox + let editorStub: sinon.SinonStubbedInstance + let documentStub: sinon.SinonStubbedInstance + let svgGenerationServiceStub: sinon.SinonStubbedInstance + let displaySvgDecorationStub: sinon.SinonStub + let loggerStub: sinon.SinonStubbedInstance + let getLoggerStub: sinon.SinonStub + let showEdits: any // Will be dynamically imported + let languageClientStub: any + let sessionStub: any + let itemStub: InlineCompletionItemWithReferences + + // Helper function to create mock SVG result + function createMockSvgResult(overrides: Partial = {}) { + return { + svgImage: vscode.Uri.file('/path/to/generated.svg'), + startLine: 5, + newCode: 'console.log("Hello World");', + originalCodeHighlightRange: [{ line: 5, start: 0, end: 10 }], + ...overrides, + } + } + + beforeEach(function () { + sandbox = sinon.createSandbox() + + // Create logger stub + loggerStub = { + error: sandbox.stub(), + info: sandbox.stub(), + debug: sandbox.stub(), + warn: sandbox.stub(), + } + + // Clear all relevant module caches + const moduleId = require.resolve('../../../../../src/app/inline/EditRendering/imageRenderer') + const sharedModuleId = require.resolve('aws-core-vscode/shared') + delete require.cache[moduleId] + delete require.cache[sharedModuleId] + + // jscpd:ignore-start + // Create getLogger stub and store reference for test verification + getLoggerStub = sandbox.stub().returns(loggerStub) + + // Create a mock shared module with stubbed getLogger + const mockSharedModule = { + getLogger: getLoggerStub, + } + + // Override the require cache with our mock + require.cache[sharedModuleId] = { + id: sharedModuleId, + filename: sharedModuleId, + loaded: true, + parent: undefined, + children: [], + exports: mockSharedModule, + paths: [], + } as any + + // Now require the module - it should use our mocked getLogger + // jscpd:ignore-end + const imageRendererModule = require('../../../../../src/app/inline/EditRendering/imageRenderer') + showEdits = imageRendererModule.showEdits + + // Create document stub + documentStub = { + uri: { + fsPath: '/path/to/test/file.ts', + }, + getText: sandbox.stub().returns('Original code content'), + lineCount: 5, + } as unknown as sinon.SinonStubbedInstance + + // Create editor stub + editorStub = { + document: documentStub, + setDecorations: sandbox.stub(), + edit: sandbox.stub().resolves(true), + } as unknown as sinon.SinonStubbedInstance + + // Create SVG generation service stub + svgGenerationServiceStub = { + generateDiffSvg: sandbox.stub(), + } as unknown as sinon.SinonStubbedInstance + + // Stub the SvgGenerationService constructor + sandbox + .stub(SvgGenerationService.prototype, 'generateDiffSvg') + .callsFake(svgGenerationServiceStub.generateDiffSvg) + + // Create display SVG decoration stub + displaySvgDecorationStub = sandbox.stub() + sandbox.replace( + require('../../../../../src/app/inline/EditRendering/displayImage'), + 'displaySvgDecoration', + displaySvgDecorationStub + ) + + // Create language client stub + languageClientStub = {} as any + + // Create session stub + sessionStub = { + sessionId: 'test-session-id', + suggestions: [], + isRequestInProgress: false, + requestStartTime: Date.now(), + startPosition: new vscode.Position(0, 0), + } as any + + // Create item stub + itemStub = { + insertText: 'console.log("Hello World");', + range: new vscode.Range(0, 0, 0, 0), + itemId: 'test-item-id', + } as any + }) + + afterEach(function () { + sandbox.restore() + }) + + it('should return early when editor is undefined', async function () { + await showEdits(itemStub, undefined, sessionStub, languageClientStub) + + // Verify that no SVG generation or display methods were called + sinon.assert.notCalled(svgGenerationServiceStub.generateDiffSvg) + sinon.assert.notCalled(displaySvgDecorationStub) + sinon.assert.notCalled(loggerStub.error) + }) + + it('should successfully generate and display SVG when all parameters are valid', async function () { + // Setup successful SVG generation + const mockSvgResult = createMockSvgResult() + svgGenerationServiceStub.generateDiffSvg.resolves(mockSvgResult) + + await showEdits(itemStub, editorStub as unknown as vscode.TextEditor, sessionStub, languageClientStub) + + // Verify SVG generation was called with correct parameters + sinon.assert.calledOnce(svgGenerationServiceStub.generateDiffSvg) + sinon.assert.calledWith( + svgGenerationServiceStub.generateDiffSvg, + '/path/to/test/file.ts', + 'console.log("Hello World");' + ) + + // Verify display decoration was called with correct parameters + sinon.assert.calledOnce(displaySvgDecorationStub) + sinon.assert.calledWith( + displaySvgDecorationStub, + editorStub, + mockSvgResult.svgImage, + mockSvgResult.startLine, + mockSvgResult.newCode, + mockSvgResult.originalCodeHighlightRange, + sessionStub, + languageClientStub, + itemStub + ) + + // Verify no errors were logged + sinon.assert.notCalled(loggerStub.error) + }) + + it('should log error when SVG generation returns empty result', async function () { + // Setup SVG generation to return undefined svgImage + const mockSvgResult = createMockSvgResult({ svgImage: undefined as any }) + svgGenerationServiceStub.generateDiffSvg.resolves(mockSvgResult) + + await showEdits(itemStub, editorStub as unknown as vscode.TextEditor, sessionStub, languageClientStub) + + // Verify SVG generation was called + sinon.assert.calledOnce(svgGenerationServiceStub.generateDiffSvg) + + // Verify display decoration was NOT called + sinon.assert.notCalled(displaySvgDecorationStub) + + // Verify error was logged + sinon.assert.calledOnce(loggerStub.error) + sinon.assert.calledWith(loggerStub.error, 'SVG image generation returned an empty result.') + }) + + it('should catch and log error when SVG generation throws exception', async function () { + // Setup SVG generation to throw an error + const testError = new Error('SVG generation failed') + svgGenerationServiceStub.generateDiffSvg.rejects(testError) + + await showEdits(itemStub, editorStub as unknown as vscode.TextEditor, sessionStub, languageClientStub) + + // Verify SVG generation was called + sinon.assert.calledOnce(svgGenerationServiceStub.generateDiffSvg) + + // Verify display decoration was NOT called + sinon.assert.notCalled(displaySvgDecorationStub) + + // Verify error was logged with correct message + sinon.assert.calledOnce(loggerStub.error) + const errorCall = loggerStub.error.getCall(0) + assert.strictEqual(errorCall.args[0], `Error generating SVG image: ${testError}`) + }) + + it('should catch and log error when displaySvgDecoration throws exception', async function () { + // Setup successful SVG generation + const mockSvgResult = createMockSvgResult() + svgGenerationServiceStub.generateDiffSvg.resolves(mockSvgResult) + + // Setup displaySvgDecoration to throw an error + const testError = new Error('Display decoration failed') + displaySvgDecorationStub.rejects(testError) + + await showEdits(itemStub, editorStub as unknown as vscode.TextEditor, sessionStub, languageClientStub) + + // Verify SVG generation was called + sinon.assert.calledOnce(svgGenerationServiceStub.generateDiffSvg) + + // Verify display decoration was called + sinon.assert.calledOnce(displaySvgDecorationStub) + + // Verify error was logged with correct message + sinon.assert.calledOnce(loggerStub.error) + const errorCall = loggerStub.error.getCall(0) + assert.strictEqual(errorCall.args[0], `Error generating SVG image: ${testError}`) + }) + + it('should use correct logger name', async function () { + await showEdits(itemStub, editorStub as unknown as vscode.TextEditor, sessionStub, languageClientStub) + + // Verify getLogger was called with correct name + sinon.assert.calledWith(getLoggerStub, 'nextEditPrediction') + }) + + it('should handle item with undefined insertText', async function () { + // Create item with undefined insertText + const itemWithUndefinedText = { + ...itemStub, + insertText: undefined, + } as any + + // Setup successful SVG generation + const mockSvgResult = createMockSvgResult() + svgGenerationServiceStub.generateDiffSvg.resolves(mockSvgResult) + + await showEdits( + itemWithUndefinedText, + editorStub as unknown as vscode.TextEditor, + sessionStub, + languageClientStub + ) + + // Verify SVG generation was called with undefined as string + sinon.assert.calledOnce(svgGenerationServiceStub.generateDiffSvg) + sinon.assert.calledWith(svgGenerationServiceStub.generateDiffSvg, '/path/to/test/file.ts', undefined) + }) +}) diff --git a/packages/amazonq/test/unit/app/inline/EditRendering/svgGenerator.test.ts b/packages/amazonq/test/unit/app/inline/EditRendering/svgGenerator.test.ts new file mode 100644 index 00000000000..657ff5c2915 --- /dev/null +++ b/packages/amazonq/test/unit/app/inline/EditRendering/svgGenerator.test.ts @@ -0,0 +1,252 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' +import * as sinon from 'sinon' +import assert from 'assert' +import { SvgGenerationService } from '../../../../../src/app/inline/EditRendering/svgGenerator' + +describe('SvgGenerationService', function () { + let sandbox: sinon.SinonSandbox + let service: SvgGenerationService + let documentStub: sinon.SinonStubbedInstance + let workspaceStub: sinon.SinonStubbedInstance + let editorConfigStub: any + + beforeEach(function () { + sandbox = sinon.createSandbox() + + // Create stubs for vscode objects and utilities + documentStub = { + getText: sandbox.stub().returns('function example() {\n return 42;\n}'), + lineCount: 3, + lineAt: sandbox.stub().returns({ + text: 'Line content', + range: new vscode.Range(0, 0, 0, 12), + }), + } as unknown as sinon.SinonStubbedInstance + + workspaceStub = sandbox.stub(vscode.workspace) + workspaceStub.openTextDocument.resolves(documentStub as unknown as vscode.TextDocument) + workspaceStub.getConfiguration = sandbox.stub() + + editorConfigStub = { + get: sandbox.stub(), + } + editorConfigStub.get.withArgs('fontSize').returns(14) + editorConfigStub.get.withArgs('lineHeight').returns(0) + + // Create the service instance + service = new SvgGenerationService() + }) + + afterEach(function () { + sandbox.restore() + }) + + describe('generateDiffSvg', function () { + it('should handle empty original code', async function () { + // Create a new document stub for this test with empty content + const emptyDocStub = { + getText: sandbox.stub().returns(''), + lineCount: 0, + lineAt: sandbox.stub().returns({ + text: '', + range: new vscode.Range(0, 0, 0, 0), + }), + } as unknown as vscode.TextDocument + + // Make openTextDocument return our empty document + workspaceStub.openTextDocument.resolves(emptyDocStub as unknown as vscode.TextDocument) + + // A simple unified diff + const udiff = '--- a/example.js\n+++ b/example.js\n@@ -0,0 +1,1 @@\n+function example() {}\n' + + // Expect an error to be thrown + try { + await service.generateDiffSvg('example.js', udiff) + assert.fail('Expected an error to be thrown') + } catch (error) { + assert.ok(error) + assert.strictEqual((error as Error).message, 'udiff format error') + } + }) + }) + + describe('theme handling', function () { + it('should generate correct styles for dark theme', function () { + // Configure for dark theme + workspaceStub.getConfiguration.withArgs('editor').returns(editorConfigStub) + workspaceStub.getConfiguration.withArgs('workbench').returns({ + get: sandbox.stub().withArgs('colorTheme', 'Default').returns('Dark+ (default dark)'), + } as any) + + const getEditorTheme = (service as any).getEditorTheme.bind(service) + const theme = getEditorTheme() + + assert.strictEqual(theme.fontSize, 14) + assert.strictEqual(theme.lingHeight, 21) // 1.5 * 14 + assert.strictEqual(theme.foreground, 'rgba(212, 212, 212, 1)') + assert.strictEqual(theme.background, 'rgba(30, 30, 30, 1)') + }) + + it('should generate correct styles for light theme', function () { + // Reconfigure for light theme + editorConfigStub.get.withArgs('fontSize', 12).returns(12) + + workspaceStub.getConfiguration.withArgs('editor').returns(editorConfigStub) + workspaceStub.getConfiguration.withArgs('workbench').returns({ + get: sandbox.stub().withArgs('colorTheme', 'Default').returns('Light+ (default light)'), + } as any) + + const getEditorTheme = (service as any).getEditorTheme.bind(service) + const theme = getEditorTheme() + + assert.strictEqual(theme.fontSize, 12) + assert.strictEqual(theme.lingHeight, 18) // 1.5 * 12 + assert.strictEqual(theme.foreground, 'rgba(0, 0, 0, 1)') + assert.strictEqual(theme.background, 'rgba(255, 255, 255, 1)') + }) + + it('should handle custom line height settings', function () { + // Reconfigure for custom line height + editorConfigStub.get.withArgs('fontSize').returns(16) + editorConfigStub.get.withArgs('lineHeight').returns(2.5) + + workspaceStub.getConfiguration.withArgs('editor').returns(editorConfigStub) + workspaceStub.getConfiguration.withArgs('workbench').returns({ + get: sandbox.stub().withArgs('colorTheme', 'Default').returns('Dark+ (default dark)'), + } as any) + + const getEditorTheme = (service as any).getEditorTheme.bind(service) + const theme = getEditorTheme() + + assert.strictEqual(theme.fontSize, 16) + assert.strictEqual(theme.lingHeight, 40) // 2.5 * 16 + }) + + it('should generate CSS styles correctly', function () { + const theme = { + fontSize: 14, + lingHeight: 21, + foreground: 'rgba(212, 212, 212, 1)', + background: 'rgba(30, 30, 30, 1)', + diffAdded: 'rgba(231, 245, 231, 0.2)', + diffRemoved: 'rgba(255, 0, 0, 0.2)', + } + + const generateStyles = (service as any).generateStyles.bind(service) + const styles = generateStyles(theme) + + assert.ok(styles.includes('font-size: 14px')) + assert.ok(styles.includes('line-height: 21px')) + assert.ok(styles.includes('color: rgba(212, 212, 212, 1)')) + assert.ok(styles.includes('background-color: rgba(30, 30, 30, 1)')) + assert.ok(styles.includes('.diff-changed')) + assert.ok(styles.includes('.diff-removed')) + }) + }) + + describe('highlight ranges', function () { + it('should generate highlight ranges for word-level changes', function () { + const originalCode = ['function test() {', ' return 42;', '}'] + const afterCode = ['function test() {', ' return 100;', '}'] + const modifiedLines = new Map([[' return 42;', ' return 100;']]) + + const generateHighlightRanges = (service as any).generateHighlightRanges.bind(service) + const result = generateHighlightRanges(originalCode, afterCode, modifiedLines) + + // Should have ranges for the changed characters + assert.ok(result.removedRanges.length > 0) + assert.ok(result.addedRanges.length > 0) + + // Check that ranges are properly formatted + const removedRange = result.removedRanges[0] + assert.ok(removedRange.line >= 0) + assert.ok(removedRange.start >= 0) + assert.ok(removedRange.end > removedRange.start) + + const addedRange = result.addedRanges[0] + assert.ok(addedRange.line >= 0) + assert.ok(addedRange.start >= 0) + assert.ok(addedRange.end > addedRange.start) + }) + + it('should handle HTML escaping in highlight edits', function () { + const newLines = ['function test() {', ' return "";', '}'] + const highlightRanges = [{ line: 1, start: 10, end: 35 }] + + const getHighlightEdit = (service as any).getHighlightEdit.bind(service) + const result = getHighlightEdit(newLines, highlightRanges) + + assert.ok(result[1].includes('<script>')) + assert.ok(result[1].includes('</script>')) + assert.ok(result[1].includes('diff-changed')) + }) + }) + + describe('dimensions and positioning', function () { + it('should calculate dimensions correctly', function () { + const newLines = ['function test() {', ' return 42;', '}'] + const theme = { + fontSize: 14, + lingHeight: 21, + foreground: 'rgba(212, 212, 212, 1)', + background: 'rgba(30, 30, 30, 1)', + } + + const calculateDimensions = (service as any).calculateDimensions.bind(service) + const result = calculateDimensions(newLines, theme) + + assert.strictEqual(result.width, 287) + assert.strictEqual(result.height, 109) + assert.ok(result.height >= (newLines.length + 1) * theme.lingHeight) + }) + + it('should calculate position offset correctly', function () { + const originalLines = ['function test() {', ' return 42;', '}'] + const newLines = ['function test() {', ' return 100;', '}'] + const diffLines = [' return 100;'] + const theme = { + fontSize: 14, + lingHeight: 21, + foreground: 'rgba(212, 212, 212, 1)', + background: 'rgba(30, 30, 30, 1)', + } + + const calculatePosition = (service as any).calculatePosition.bind(service) + const result = calculatePosition(originalLines, newLines, diffLines, theme) + + assert.strictEqual(result.offset, 10) + assert.strictEqual(result.editStartLine, 1) + }) + }) + + describe('HTML content generation', function () { + it('should generate HTML content with proper structure', function () { + const diffLines = ['function test() {', ' return 42;', '}'] + const styles = '.code-container { color: white; }' + const offset = 20 + + const generateHtmlContent = (service as any).generateHtmlContent.bind(service) + const result = generateHtmlContent(diffLines, styles, offset) + + assert.ok(result.includes('
')) + assert.ok(result.includes(' + + +
+
+
${title}
+
${message}
+
+ +` + + const filePath = join(os.tmpdir(), `sagemaker-error-${randomUUID()}.html`) + await fs.writeFile(filePath, html, 'utf8') + await open(filePath) +} diff --git a/packages/core/src/awsService/sagemaker/detached-server/routes/getSession.ts b/packages/core/src/awsService/sagemaker/detached-server/routes/getSession.ts new file mode 100644 index 00000000000..a39b4c1c812 --- /dev/null +++ b/packages/core/src/awsService/sagemaker/detached-server/routes/getSession.ts @@ -0,0 +1,57 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +// Disabled: detached server files cannot import vscode. +/* eslint-disable aws-toolkits/no-console-log */ +import { IncomingMessage, ServerResponse } from 'http' +import { startSagemakerSession, parseArn } from '../utils' +import { resolveCredentialsFor } from '../credentials' +import url from 'url' +import { SageMakerServiceException } from '@amzn/sagemaker-client' +import { getVSCodeErrorText, getVSCodeErrorTitle, openErrorPage } from '../errorPage' + +export async function handleGetSession(req: IncomingMessage, res: ServerResponse): Promise { + const parsedUrl = url.parse(req.url || '', true) + const connectionIdentifier = parsedUrl.query.connection_identifier as string + + if (!connectionIdentifier) { + res.writeHead(400, { 'Content-Type': 'text/plain' }) + res.end(`Missing required query parameter: "connection_identifier" (${connectionIdentifier})`) + return + } + + let credentials + try { + credentials = await resolveCredentialsFor(connectionIdentifier) + } catch (err) { + console.error('Failed to resolve credentials:', err) + res.writeHead(500, { 'Content-Type': 'text/plain' }) + res.end((err as Error).message) + return + } + + const { region } = parseArn(connectionIdentifier) + + try { + const session = await startSagemakerSession({ region, connectionIdentifier, credentials }) + res.writeHead(200, { 'Content-Type': 'application/json' }) + res.end( + JSON.stringify({ + SessionId: session.SessionId, + StreamUrl: session.StreamUrl, + TokenValue: session.TokenValue, + }) + ) + } catch (err) { + const error = err as SageMakerServiceException + console.error(`Failed to start SageMaker session for ${connectionIdentifier}:`, err) + const errorTitle = getVSCodeErrorTitle(error) + const errorText = getVSCodeErrorText(error) + await openErrorPage(errorTitle, errorText) + res.writeHead(500, { 'Content-Type': 'text/plain' }) + res.end('Failed to start SageMaker session') + return + } +} diff --git a/packages/core/src/awsService/sagemaker/detached-server/routes/getSessionAsync.ts b/packages/core/src/awsService/sagemaker/detached-server/routes/getSessionAsync.ts new file mode 100644 index 00000000000..f8dad504067 --- /dev/null +++ b/packages/core/src/awsService/sagemaker/detached-server/routes/getSessionAsync.ts @@ -0,0 +1,70 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +// Disabled: detached server files cannot import vscode. +/* eslint-disable aws-toolkits/no-console-log */ +import { IncomingMessage, ServerResponse } from 'http' +import url from 'url' +import { SessionStore } from '../sessionStore' +import { open, parseArn, readServerInfo } from '../utils' + +export async function handleGetSessionAsync(req: IncomingMessage, res: ServerResponse): Promise { + const parsedUrl = url.parse(req.url || '', true) + const connectionIdentifier = parsedUrl.query.connection_identifier as string + const requestId = parsedUrl.query.request_id as string + + if (!connectionIdentifier || !requestId) { + res.writeHead(400, { 'Content-Type': 'text/plain' }) + res.end( + `Missing required query parameters: "connection_identifier" (${connectionIdentifier}), "request_id" (${requestId})` + ) + return + } + + const store = new SessionStore() + + try { + const freshEntry = await store.getFreshEntry(connectionIdentifier, requestId) + + if (freshEntry) { + res.writeHead(200, { 'Content-Type': 'application/json' }) + res.end( + JSON.stringify({ + SessionId: freshEntry.sessionId, + StreamUrl: freshEntry.url, + TokenValue: freshEntry.token, + }) + ) + return + } + + const status = await store.getStatus(connectionIdentifier, requestId) + if (status === 'pending') { + res.writeHead(204) + res.end() + return + } else if (status === 'not-started') { + const serverInfo = await readServerInfo() + const refreshUrl = await store.getRefreshUrl(connectionIdentifier) + const { spaceName } = parseArn(connectionIdentifier) + + const url = `${refreshUrl}/${encodeURIComponent(spaceName)}?remote_access_token_refresh=true&reconnect_identifier=${encodeURIComponent( + connectionIdentifier + )}&reconnect_request_id=${encodeURIComponent(requestId)}&reconnect_callback_url=${encodeURIComponent( + `http://localhost:${serverInfo.port}/refresh_token` + )}` + + await open(url) + res.writeHead(202, { 'Content-Type': 'text/plain' }) + res.end('Session is not ready yet. Please retry in a few seconds.') + await store.markPending(connectionIdentifier, requestId) + return + } + } catch (err) { + console.error('Error handling session async request:', err) + res.writeHead(500, { 'Content-Type': 'text/plain' }) + res.end('Unexpected error') + } +} diff --git a/packages/core/src/awsService/sagemaker/detached-server/routes/refreshToken.ts b/packages/core/src/awsService/sagemaker/detached-server/routes/refreshToken.ts new file mode 100644 index 00000000000..34152aa0423 --- /dev/null +++ b/packages/core/src/awsService/sagemaker/detached-server/routes/refreshToken.ts @@ -0,0 +1,46 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +// Disabled: detached server files cannot import vscode. +/* eslint-disable aws-toolkits/no-console-log */ +import { IncomingMessage, ServerResponse } from 'http' +import url from 'url' +import { SessionStore } from '../sessionStore' + +export async function handleRefreshToken(req: IncomingMessage, res: ServerResponse): Promise { + const parsedUrl = url.parse(req.url || '', true) + const connectionIdentifier = parsedUrl.query.connection_identifier as string + const requestId = parsedUrl.query.request_id as string + const wsUrl = parsedUrl.query.ws_url as string + const token = parsedUrl.query.token as string + const sessionId = parsedUrl.query.session as string + + const store = new SessionStore() + + if (!connectionIdentifier || !requestId || !wsUrl || !token || !sessionId) { + res.writeHead(400, { 'Content-Type': 'text/plain' }) + res.end( + `Missing required parameters:\n` + + ` connection_identifier: ${connectionIdentifier ?? 'undefined'}\n` + + ` request_id: ${requestId ?? 'undefined'}\n` + + ` url: ${wsUrl ?? 'undefined'}\n` + + ` token: ${token ?? 'undefined'}\n` + + ` sessionId: ${sessionId ?? 'undefined'}` + ) + return + } + + try { + await store.setSession(connectionIdentifier, requestId, { sessionId, token, url: wsUrl }) + } catch (err) { + console.error('Failed to save session token:', err) + res.writeHead(500, { 'Content-Type': 'text/plain' }) + res.end('Failed to save session token') + return + } + + res.writeHead(200) + res.end('Session token refreshed successfully') +} diff --git a/packages/core/src/awsService/sagemaker/detached-server/server.ts b/packages/core/src/awsService/sagemaker/detached-server/server.ts new file mode 100644 index 00000000000..e785516146c --- /dev/null +++ b/packages/core/src/awsService/sagemaker/detached-server/server.ts @@ -0,0 +1,107 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +// Disabled: detached server files cannot import vscode. +/* eslint-disable aws-toolkits/no-console-log */ +/* eslint-disable no-restricted-imports */ +import http, { IncomingMessage, ServerResponse } from 'http' +import { handleGetSession } from './routes/getSession' +import { handleGetSessionAsync } from './routes/getSessionAsync' +import { handleRefreshToken } from './routes/refreshToken' +import url from 'url' +import * as os from 'os' +import fs from 'fs' +import { execFile } from 'child_process' + +const pollInterval = 30 * 60 * 100 // 30 minutes + +const server = http.createServer((req: IncomingMessage, res: ServerResponse) => { + const parsedUrl = url.parse(req.url || '', true) + + switch (parsedUrl.pathname) { + case '/get_session': + return handleGetSession(req, res) + case '/get_session_async': + return handleGetSessionAsync(req, res) + case '/refresh_token': + return handleRefreshToken(req, res) + default: + res.writeHead(404, { 'Content-Type': 'text/plain' }) + res.end(`Not Found: ${req.url}`) + } +}) + +server.listen(0, '127.0.0.1', async () => { + const address = server.address() + if (address && typeof address === 'object') { + const port = address.port + const pid = process.pid + + console.log(`Detached server listening on http://127.0.0.1:${port} (pid: ${pid})`) + + const filePath = process.env.SAGEMAKER_LOCAL_SERVER_FILE_PATH + if (!filePath) { + throw new Error('SAGEMAKER_LOCAL_SERVER_FILE_PATH environment variable is not set') + } + + const data = { pid, port } + console.log(`Writing local endpoint info to ${filePath}`) + + fs.writeFileSync(filePath, JSON.stringify(data, undefined, 2), 'utf-8') + } else { + console.error('Failed to retrieve assigned port') + process.exit(0) + } + await monitorVSCodeAndExit() +}) + +function checkVSCodeWindows(): Promise { + return new Promise((resolve) => { + const platform = os.platform() + + if (platform === 'win32') { + execFile('tasklist', ['/FI', 'IMAGENAME eq Code.exe'], (err, stdout) => { + if (err) { + resolve(false) + return + } + resolve(/Code\.exe/i.test(stdout)) + }) + } else if (platform === 'darwin') { + execFile('ps', ['aux'], (err, stdout) => { + if (err) { + resolve(false) + return + } + + const found = stdout + .split('\n') + .some((line) => /Visual Studio Code( - Insiders)?\.app\/Contents\/MacOS\/Electron/.test(line)) + resolve(found) + }) + } else { + execFile('ps', ['-A', '-o', 'comm'], (err, stdout) => { + if (err) { + resolve(false) + return + } + + const found = stdout.split('\n').some((line) => /^(code(-insiders)?|electron)$/i.test(line.trim())) + resolve(found) + }) + } + }) +} + +async function monitorVSCodeAndExit() { + while (true) { + const found = await checkVSCodeWindows() + if (!found) { + console.log('No VSCode windows found. Shutting down detached server.') + process.exit(0) + } + await new Promise((r) => setTimeout(r, pollInterval)) + } +} diff --git a/packages/core/src/awsService/sagemaker/detached-server/sessionStore.ts b/packages/core/src/awsService/sagemaker/detached-server/sessionStore.ts new file mode 100644 index 00000000000..04098f68c89 --- /dev/null +++ b/packages/core/src/awsService/sagemaker/detached-server/sessionStore.ts @@ -0,0 +1,136 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import { SsmConnectionInfo } from '../types' +import { readMapping, writeMapping } from './utils' + +export type SessionStatus = 'pending' | 'fresh' | 'consumed' | 'not-started' + +export class SessionStore { + async getRefreshUrl(connectionId: string) { + const mapping = await readMapping() + + if (!mapping.deepLink) { + throw new Error('No deepLink mapping found') + } + + const entry = mapping.deepLink[connectionId] + if (!entry) { + throw new Error(`No mapping found for connectionId: "${connectionId}"`) + } + + if (!entry.refreshUrl) { + throw new Error(`No refreshUrl found for connectionId: "${connectionId}"`) + } + + return entry.refreshUrl + } + + async getFreshEntry(connectionId: string, requestId: string) { + const mapping = await readMapping() + + if (!mapping.deepLink) { + throw new Error('No deepLink mapping found') + } + + const entry = mapping.deepLink[connectionId] + if (!entry) { + throw new Error(`No mapping found for connectionId: "${connectionId}"`) + } + + const requests = entry.requests + const initialEntry = requests['initial-connection'] + if (initialEntry?.status === 'fresh') { + await this.markConsumed(connectionId, 'initial-connection') + return initialEntry + } + + const asyncEntry = requests[requestId] + if (asyncEntry?.status === 'fresh') { + delete requests[requestId] + await writeMapping(mapping) + return asyncEntry + } + + return undefined + } + + async getStatus(connectionId: string, requestId: string) { + const mapping = await readMapping() + + if (!mapping.deepLink) { + throw new Error('No deepLink mapping found') + } + const entry = mapping.deepLink[connectionId] + if (!entry) { + throw new Error(`No mapping found for connectionId: "${connectionId}"`) + } + + const status = entry.requests?.[requestId]?.status + return status ?? 'not-started' + } + + async markConsumed(connectionId: string, requestId: string) { + const mapping = await readMapping() + + if (!mapping.deepLink) { + throw new Error('No deepLink mapping found') + } + const entry = mapping.deepLink[connectionId] + if (!entry) { + throw new Error(`No mapping found for connectionId: "${connectionId}"`) + } + + const requests = entry.requests + if (!requests[requestId]) { + throw new Error(`No request entry found for requestId: "${requestId}"`) + } + + requests[requestId].status = 'consumed' + await writeMapping(mapping) + } + + async markPending(connectionId: string, requestId: string) { + const mapping = await readMapping() + + if (!mapping.deepLink) { + throw new Error('No deepLink mapping found') + } + const entry = mapping.deepLink[connectionId] + if (!entry) { + throw new Error(`No mapping found for connectionId: "${connectionId}"`) + } + + entry.requests[requestId] = { + sessionId: '', + token: '', + url: '', + status: 'pending', + } + + await writeMapping(mapping) + } + + async setSession(connectionId: string, requestId: string, ssmConnectionInfo: SsmConnectionInfo) { + const mapping = await readMapping() + + if (!mapping.deepLink) { + throw new Error('No deepLink mapping found') + } + const entry = mapping.deepLink[connectionId] + if (!entry) { + throw new Error(`No mapping found for connectionId: "${connectionId}"`) + } + + entry.requests[requestId] = { + sessionId: ssmConnectionInfo.sessionId, + token: ssmConnectionInfo.token, + url: ssmConnectionInfo.url, + status: ssmConnectionInfo.status ?? 'fresh', + } + + await writeMapping(mapping) + } +} diff --git a/packages/core/src/awsService/sagemaker/detached-server/utils.ts b/packages/core/src/awsService/sagemaker/detached-server/utils.ts new file mode 100644 index 00000000000..de01041d4ad --- /dev/null +++ b/packages/core/src/awsService/sagemaker/detached-server/utils.ts @@ -0,0 +1,151 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +// Disabled: detached server files cannot import vscode. +/* eslint-disable aws-toolkits/no-console-log */ +/* eslint-disable no-restricted-imports */ +import { ServerInfo } from '../types' +import { promises as fs } from 'fs' +import { SageMakerClient, StartSessionCommand } from '@amzn/sagemaker-client' +import os from 'os' +import { join } from 'path' +import { SpaceMappings } from '../types' +import open from 'open' +export { open } + +export const mappingFilePath = join(os.homedir(), '.aws', '.sagemaker-space-profiles') +const tempFilePath = `${mappingFilePath}.tmp` + +// Simple file lock to prevent concurrent writes +let isWriting = false +const writeQueue: Array<() => Promise> = [] + +/** + * Reads the local endpoint info file (default or via env) and returns pid & port. + * @throws Error if the file is missing, invalid JSON, or missing fields + */ +export async function readServerInfo(): Promise { + const filePath = process.env.SAGEMAKER_LOCAL_SERVER_FILE_PATH + if (!filePath) { + throw new Error('Environment variable SAGEMAKER_LOCAL_SERVER_FILE_PATH is not set') + } + + try { + const content = await fs.readFile(filePath, 'utf-8') + const data = JSON.parse(content) + if (typeof data.pid !== 'number' || typeof data.port !== 'number') { + throw new TypeError(`Invalid server info format in ${filePath}`) + } + return { pid: data.pid, port: data.port } + } catch (err: any) { + if (err.code === 'ENOENT') { + throw new Error(`Server info file not found at ${filePath}`) + } + throw new Error(`Failed to read server info: ${err.message ?? String(err)}`) + } +} + +/** + * Parses a SageMaker ARN to extract region, account ID, and space name. + * Supports formats like: + * arn:aws:sagemaker:::space// + * or sm_lc_arn:aws:sagemaker:::space__d-xxxx__ + * + * If the input is prefixed with an identifier (e.g. "sagemaker-user@"), the function will strip it. + * + * @param arn - The full SageMaker ARN string + * @returns An object containing the region, accountId, and spaceName + * @throws If the ARN format is invalid + */ +export function parseArn(arn: string): { region: string; accountId: string; spaceName: string } { + const cleanedArn = arn.includes('@') ? arn.split('@')[1] : arn + const regex = /^arn:aws:sagemaker:(?[^:]+):(?\d+):space[/:].+$/i + const match = cleanedArn.match(regex) + + if (!match?.groups) { + throw new Error(`Invalid SageMaker ARN format: "${arn}"`) + } + + // Extract space name from the end of the ARN (after the last forward slash) + const spaceName = cleanedArn.split('/').pop() + if (!spaceName) { + throw new Error(`Could not extract space name from ARN: "${arn}"`) + } + + return { + region: match.groups.region, + accountId: match.groups.account_id, + spaceName: spaceName, + } +} + +export async function startSagemakerSession({ region, connectionIdentifier, credentials }: any) { + const endpoint = process.env.SAGEMAKER_ENDPOINT || `https://sagemaker.${region}.amazonaws.com` + const client = new SageMakerClient({ region, credentials, endpoint }) + const command = new StartSessionCommand({ ResourceIdentifier: connectionIdentifier }) + return client.send(command) +} + +/** + * Reads the mapping file and parses it as JSON. + * Throws if the file doesn't exist or is malformed. + */ +export async function readMapping() { + try { + const content = await fs.readFile(mappingFilePath, 'utf-8') + console.log(`Mapping file path: ${mappingFilePath}`) + console.log(`Conents: ${content}`) + return JSON.parse(content) + } catch (err) { + throw new Error(`Failed to read mapping file: ${err instanceof Error ? err.message : String(err)}`) + } +} + +/** + * Processes the write queue to ensure only one write operation happens at a time. + */ +async function processWriteQueue() { + if (isWriting || writeQueue.length === 0) { + return + } + + isWriting = true + try { + while (writeQueue.length > 0) { + const writeOperation = writeQueue.shift()! + await writeOperation() + } + } finally { + isWriting = false + } +} + +/** + * Writes the mapping to a temp file and atomically renames it to the target path. + * Uses a queue to prevent race conditions when multiple requests try to write simultaneously. + */ +export async function writeMapping(mapping: SpaceMappings) { + return new Promise((resolve, reject) => { + const writeOperation = async () => { + try { + // Generate unique temp file name to avoid conflicts + const uniqueTempPath = `${tempFilePath}.${process.pid}.${Date.now()}` + + const json = JSON.stringify(mapping, undefined, 2) + await fs.writeFile(uniqueTempPath, json) + await fs.rename(uniqueTempPath, mappingFilePath) + resolve() + } catch (err) { + reject(new Error(`Failed to write mapping file: ${err instanceof Error ? err.message : String(err)}`)) + } + } + + writeQueue.push(writeOperation) + + // ProcessWriteQueue handles its own errors via individual operation callbacks + // eslint-disable-next-line @typescript-eslint/no-floating-promises + processWriteQueue() + }) +} diff --git a/packages/core/src/awsService/sagemaker/explorer/constants.ts b/packages/core/src/awsService/sagemaker/explorer/constants.ts new file mode 100644 index 00000000000..b9d7c3348b5 --- /dev/null +++ b/packages/core/src/awsService/sagemaker/explorer/constants.ts @@ -0,0 +1,20 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +export abstract class SagemakerConstants { + static readonly PlaceHolderMessage = '[No Sagemaker Spaces Found]' + static readonly EnableIdentityFilteringSetting = 'aws.sagemaker.studio.spaces.enableIdentityFiltering' + static readonly SelectedDomainUsersState = 'aws.sagemaker.selectedDomainUsers' + static readonly FilterPlaceholderKey = 'aws.filterSagemakerSpacesPlaceholder' + static readonly FilterPlaceholderMessage = 'Filter spaces by user profile or domain (unselect to hide)' + static readonly NoSpaceToFilter = 'No spaces to filter' + + static readonly IamUserArnRegex = /^arn:aws[a-z\-]*:iam::\d{12}:user\/?([a-zA-Z_0-9+=,.@\-_]+)$/ + static readonly IamSessionArnRegex = + /^arn:aws[a-z\-]*:sts::\d{12}:assumed-role\/?[a-zA-Z_0-9+=,.@\-_]+\/([a-zA-Z_0-9+=,.@\-_]+)$/ + static readonly IdentityCenterArnRegex = + /^arn:aws[a-z\-]*:sts::\d{12}:assumed-role\/?AWSReservedSSO[a-zA-Z_0-9+=,.@\-_]+\/([a-zA-Z_0-9+=,.@\-_]+)$/ + static readonly SpecialCharacterRegex = /[+=,.@\-_]/g +} diff --git a/packages/core/src/awsService/sagemaker/explorer/sagemakerParentNode.ts b/packages/core/src/awsService/sagemaker/explorer/sagemakerParentNode.ts new file mode 100644 index 00000000000..dd445f344fb --- /dev/null +++ b/packages/core/src/awsService/sagemaker/explorer/sagemakerParentNode.ts @@ -0,0 +1,214 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' +import { GetCallerIdentityResponse } from 'aws-sdk/clients/sts' +import { DescribeDomainResponse } from '@amzn/sagemaker-client' +import { SagemakerClient, SagemakerSpaceApp } from '../../../shared/clients/sagemaker' +import { DefaultStsClient } from '../../../shared/clients/stsClient' +import globals from '../../../shared/extensionGlobals' +import { AWSTreeNodeBase } from '../../../shared/treeview/nodes/awsTreeNodeBase' +import { PlaceholderNode } from '../../../shared/treeview/nodes/placeholderNode' +import { makeChildrenNodes } from '../../../shared/treeview/utils' +import { updateInPlace } from '../../../shared/utilities/collectionUtils' +import { isRemoteWorkspace } from '../../../shared/vscode/env' +import { SagemakerConstants } from './constants' +import { SagemakerSpaceNode } from './sagemakerSpaceNode' +import { getDomainSpaceKey, getDomainUserProfileKey, getSpaceAppsForUserProfile } from '../utils' +import { PollingSet } from '../../../shared/utilities/pollingSet' +import { getRemoteAppMetadata } from '../remoteUtils' + +export const parentContextValue = 'awsSagemakerParentNode' + +export type SelectedDomainUsers = [string, string[]][] +export type SelectedDomainUsersByRegion = [string, SelectedDomainUsers][] + +export interface UserProfileMetadata { + domain: DescribeDomainResponse +} +export class SagemakerParentNode extends AWSTreeNodeBase { + protected sagemakerSpaceNodes: Map + protected stsClient: DefaultStsClient + public override readonly contextValue: string = parentContextValue + domainUserProfiles: Map = new Map() + spaceApps: Map = new Map() + callerIdentity: GetCallerIdentityResponse = {} + public readonly pollingSet: PollingSet = new PollingSet(5000, this.updatePendingNodes.bind(this)) + + public constructor( + public override readonly regionCode: string, + protected readonly sagemakerClient: SagemakerClient + ) { + super('SageMaker AI', vscode.TreeItemCollapsibleState.Collapsed) + this.sagemakerSpaceNodes = new Map() + this.stsClient = new DefaultStsClient(regionCode) + } + + public override async getChildren(): Promise { + const result = await makeChildrenNodes({ + getChildNodes: async () => { + await this.updateChildren() + return [...this.sagemakerSpaceNodes.values()] + }, + getNoChildrenPlaceholderNode: async () => new PlaceholderNode(this, SagemakerConstants.PlaceHolderMessage), + sort: (nodeA, nodeB) => nodeA.name.localeCompare(nodeB.name), + }) + + return result + } + + public trackPendingNode(domainSpaceKey: string) { + this.pollingSet.add(domainSpaceKey) + } + + private async updatePendingNodes() { + for (const spaceKey of this.pollingSet.values()) { + const childNode = this.getSpaceNodes(spaceKey) + await this.updatePendingSpaceNode(childNode) + } + } + + private async updatePendingSpaceNode(node: SagemakerSpaceNode) { + await node.updateSpaceAppStatus() + if (!node.isPending()) { + this.pollingSet.delete(node.DomainSpaceKey) + await node.refreshNode() + } + } + + public getSpaceNodes(spaceKey: string): SagemakerSpaceNode { + const childNode = this.sagemakerSpaceNodes.get(spaceKey) + if (childNode) { + return childNode + } else { + throw new Error(`Node with id ${spaceKey} from polling set not found`) + } + } + + public async getLocalSelectedDomainUsers(): Promise { + /** + * By default, filter userProfileNames that match the detected IAM user, IAM assumed role + * session name, or Identity Center username + * */ + const iamMatches = + this.callerIdentity.Arn?.match(SagemakerConstants.IamUserArnRegex) || + this.callerIdentity.Arn?.match(SagemakerConstants.IamSessionArnRegex) + const idcMatches = this.callerIdentity.Arn?.match(SagemakerConstants.IdentityCenterArnRegex) + + const matches = + /** + * Only filter IAM users / assumed-role sessions if the user has enabled this option + * Or filter Identity Center username if user is authenticated via IdC + * */ + iamMatches && vscode.workspace.getConfiguration().get(SagemakerConstants.EnableIdentityFilteringSetting) + ? iamMatches + : idcMatches + ? idcMatches + : undefined + + const userProfilePrefix = + matches && matches.length >= 2 + ? `${matches[1].replaceAll(SagemakerConstants.SpecialCharacterRegex, '-')}-` + : '' + + return getSpaceAppsForUserProfile([...this.spaceApps.values()], userProfilePrefix) + } + + public async getRemoteSelectedDomainUsers(): Promise { + const remoteAppMetadata = await getRemoteAppMetadata() + return getSpaceAppsForUserProfile( + [...this.spaceApps.values()], + remoteAppMetadata.UserProfileName, + remoteAppMetadata.DomainId + ) + } + + public async getDefaultSelectedDomainUsers(): Promise { + if (isRemoteWorkspace()) { + return this.getRemoteSelectedDomainUsers() + } else { + return this.getLocalSelectedDomainUsers() + } + } + + public async getSelectedDomainUsers(): Promise> { + const selectedDomainUsersByRegionMap = new Map( + globals.globalState.get(SagemakerConstants.SelectedDomainUsersState, []) + ) + + const selectedDomainUsersMap = new Map(selectedDomainUsersByRegionMap.get(this.regionCode)) + const defaultSelectedDomainUsers = await this.getDefaultSelectedDomainUsers() + const cachedDomainUsers = selectedDomainUsersMap.get(this.callerIdentity.Arn || '') + + if (cachedDomainUsers && cachedDomainUsers.length > 0) { + return new Set(cachedDomainUsers) + } else { + return new Set(defaultSelectedDomainUsers) + } + } + + public saveSelectedDomainUsers(selectedDomainUsers: string[]) { + const selectedDomainUsersByRegionMap = new Map( + globals.globalState.get(SagemakerConstants.SelectedDomainUsersState, []) + ) + + const selectedDomainUsersMap = new Map(selectedDomainUsersByRegionMap.get(this.regionCode)) + + if (this.callerIdentity.Arn) { + selectedDomainUsersMap?.set(this.callerIdentity.Arn, selectedDomainUsers) + selectedDomainUsersByRegionMap?.set(this.regionCode, [...selectedDomainUsersMap]) + + globals.globalState.tryUpdate(SagemakerConstants.SelectedDomainUsersState, [ + ...selectedDomainUsersByRegionMap, + ]) + } + } + + public async updateChildren(): Promise { + const [spaceApps, domains] = await this.sagemakerClient.fetchSpaceAppsAndDomains() + this.spaceApps = spaceApps + + this.callerIdentity = await this.stsClient.getCallerIdentity() + const selectedDomainUsers = await this.getSelectedDomainUsers() + this.domainUserProfiles.clear() + + for (const app of spaceApps.values()) { + const domainId = app.DomainId + const userProfile = app.OwnershipSettingsSummary?.OwnerUserProfileName + if (!domainId || !userProfile) { + continue + } + + // populate domainUserProfiles for filtering + const domainUserProfileKey = getDomainUserProfileKey(domainId, userProfile) + const domainSpaceKey = getDomainSpaceKey(domainId, app.SpaceName || '') + + this.domainUserProfiles.set(domainUserProfileKey, { + domain: domains.get(domainId) as DescribeDomainResponse, + }) + + if (!selectedDomainUsers.has(domainUserProfileKey) && app.SpaceName) { + spaceApps.delete(domainSpaceKey) + continue + } + } + + updateInPlace( + this.sagemakerSpaceNodes, + spaceApps.keys(), + (key) => this.sagemakerSpaceNodes.get(key)!.updateSpace(spaceApps.get(key)!), + (key) => new SagemakerSpaceNode(this, this.sagemakerClient, this.regionCode, spaceApps.get(key)!) + ) + } + + public async clearChildren() { + this.sagemakerSpaceNodes = new Map() + } + + public async refreshNode(): Promise { + await this.clearChildren() + await vscode.commands.executeCommand('aws.refreshAwsExplorerNode', this) + } +} diff --git a/packages/core/src/awsService/sagemaker/explorer/sagemakerSpaceNode.ts b/packages/core/src/awsService/sagemaker/explorer/sagemakerSpaceNode.ts new file mode 100644 index 00000000000..6151224a510 --- /dev/null +++ b/packages/core/src/awsService/sagemaker/explorer/sagemakerSpaceNode.ts @@ -0,0 +1,180 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' +import { AppType } from '@aws-sdk/client-sagemaker' +import { SagemakerClient, SagemakerSpaceApp } from '../../../shared/clients/sagemaker' +import { AWSResourceNode } from '../../../shared/treeview/nodes/awsResourceNode' +import { AWSTreeNodeBase } from '../../../shared/treeview/nodes/awsTreeNodeBase' +import { SagemakerParentNode } from './sagemakerParentNode' +import { generateSpaceStatus } from '../utils' +import { getIcon } from '../../../shared/icons' +import { getLogger } from '../../../shared/logger/logger' + +export class SagemakerSpaceNode extends AWSTreeNodeBase implements AWSResourceNode { + public constructor( + public readonly parent: SagemakerParentNode, + public readonly client: SagemakerClient, + public override readonly regionCode: string, + public readonly spaceApp: SagemakerSpaceApp + ) { + super('') + this.updateSpace(spaceApp) + this.contextValue = this.getContext() + } + + public updateSpace(spaceApp: SagemakerSpaceApp) { + this.setSpaceStatus(spaceApp.Status ?? '', spaceApp.App?.Status ?? '') + this.label = this.buildLabel() + this.description = this.buildDescription() + this.tooltip = new vscode.MarkdownString(this.buildTooltip()) + this.iconPath = this.getAppIcon() + + if (this.isPending()) { + this.parent.trackPendingNode(this.DomainSpaceKey) + } + } + + public setSpaceStatus(spaceStatus: string, appStatus: string) { + this.spaceApp.Status = spaceStatus + if (this.spaceApp.App) { + this.spaceApp.App.Status = appStatus + } + } + + public isPending(): boolean { + return this.getStatus() !== 'Running' && this.getStatus() !== 'Stopped' + } + + public getStatus(): string { + return generateSpaceStatus(this.spaceApp.Status, this.spaceApp.App?.Status) + } + + public async getAppStatus() { + const app = await this.client.describeApp({ + DomainId: this.spaceApp.DomainId, + AppName: this.spaceApp.App?.AppName, + AppType: this.spaceApp.SpaceSettingsSummary?.AppType, + SpaceName: this.spaceApp.SpaceName, + }) + + return app.Status ?? 'Unknown' + } + + public get name(): string { + return this.spaceApp.SpaceName ?? `(no name)` + } + + public get arn(): string { + return 'placeholder-arn' + } + + public async getAppArn() { + const appDetails = await this.client.describeApp({ + DomainId: this.spaceApp.DomainId, + AppName: this.spaceApp.App?.AppName, + AppType: this.spaceApp.SpaceSettingsSummary?.AppType, + SpaceName: this.spaceApp.SpaceName, + }) + + return appDetails.AppArn + } + + public async getSpaceArn() { + const appDetails = await this.client.describeSpace({ + DomainId: this.spaceApp.DomainId, + SpaceName: this.spaceApp.SpaceName, + }) + + return appDetails.SpaceArn + } + + public async updateSpaceAppStatus() { + const space = await this.client.describeSpace({ + DomainId: this.spaceApp.DomainId, + SpaceName: this.spaceApp.SpaceName, + }) + + const app = await this.client.describeApp({ + DomainId: this.spaceApp.DomainId, + AppName: this.spaceApp.App?.AppName, + AppType: this.spaceApp.SpaceSettingsSummary?.AppType, + SpaceName: this.spaceApp.SpaceName, + }) + + this.updateSpace({ + ...space, + App: app, + DomainSpaceKey: this.spaceApp.DomainSpaceKey, + }) + } + + private buildLabel(): string { + const status = generateSpaceStatus(this.spaceApp.Status, this.spaceApp.App?.Status) + return `${this.name} (${status})` + } + + private buildDescription(): string { + return `${this.spaceApp.SpaceSharingSettingsSummary?.SharingType ?? 'Unknown'} space` + } + private buildTooltip() { + const spaceName = this.spaceApp?.SpaceName ?? '-' + const appType = this.spaceApp?.SpaceSettingsSummary?.AppType ?? '-' + const domainId = this.spaceApp?.DomainId ?? '-' + const owner = this.spaceApp?.OwnershipSettingsSummary?.OwnerUserProfileName ?? '-' + + return `**Space:** ${spaceName} \n\n**Application:** ${appType} \n\n**Domain ID:** ${domainId} \n\n**User Profile:** ${owner}` + } + + private getAppIcon() { + if (this.spaceApp.SpaceSettingsSummary?.AppType === AppType.CodeEditor) { + return getIcon('aws-sagemaker-code-editor') + } + + if (this.spaceApp.SpaceSettingsSummary?.AppType === AppType.JupyterLab) { + return getIcon('aws-sagemaker-jupyter-lab') + } + } + + private getContext() { + const status = this.getStatus() + if (status === 'Running' && this.spaceApp.SpaceSettingsSummary?.RemoteAccess === 'ENABLED') { + return 'awsSagemakerSpaceRunningRemoteEnabledNode' + } else if (status === 'Running' && this.spaceApp.SpaceSettingsSummary?.RemoteAccess === 'DISABLED') { + return 'awsSagemakerSpaceRunningRemoteDisabledNode' + } else if (status === 'Stopped' && this.spaceApp.SpaceSettingsSummary?.RemoteAccess === 'ENABLED') { + return 'awsSagemakerSpaceStoppedRemoteEnabledNode' + } else if ( + status === 'Stopped' && + (!this.spaceApp.SpaceSettingsSummary?.RemoteAccess || + this.spaceApp.SpaceSettingsSummary?.RemoteAccess === 'DISABLED') + ) { + return 'awsSagemakerSpaceStoppedRemoteDisabledNode' + } + return 'awsSagemakerSpaceNode' + } + + public get DomainSpaceKey(): string { + return this.spaceApp.DomainSpaceKey! + } + + public async refreshNode(): Promise { + await this.updateSpaceAppStatus() + await vscode.commands.executeCommand('aws.refreshAwsExplorerNode', this) + } +} + +export async function tryRefreshNode(node?: SagemakerSpaceNode) { + if (node) { + try { + // For SageMaker spaces, refresh just the individual space node to avoid expensive + // operation of refreshing all spaces in the domain + await node.updateSpaceAppStatus() + await vscode.commands.executeCommand('aws.refreshAwsExplorerNode', node) + } catch (e) { + getLogger().error('refreshNode failed: %s', (e as Error).message) + } + } +} diff --git a/packages/core/src/awsService/sagemaker/model.ts b/packages/core/src/awsService/sagemaker/model.ts new file mode 100644 index 00000000000..20a667a0bfa --- /dev/null +++ b/packages/core/src/awsService/sagemaker/model.ts @@ -0,0 +1,228 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +// Disabled: detached server files cannot import vscode. +/* eslint-disable no-restricted-imports */ +import * as vscode from 'vscode' +import { sshAgentSocketVariable, startSshAgent, startVscodeRemote } from '../../shared/extensions/ssh' +import { createBoundProcess, ensureDependencies } from '../../shared/remoteSession' +import { SshConfig } from '../../shared/sshConfig' +import * as path from 'path' +import { persistLocalCredentials, persistSSMConnection } from './credentialMapping' +import * as os from 'os' +import _ from 'lodash' +import { fs } from '../../shared/fs/fs' +import * as nodefs from 'fs' +import { getSmSsmEnv, spawnDetachedServer } from './utils' +import { getLogger } from '../../shared/logger/logger' +import { DevSettings } from '../../shared/settings' +import { ToolkitError } from '../../shared/errors' +import { SagemakerSpaceNode } from './explorer/sagemakerSpaceNode' +import { sleep } from '../../shared/utilities/timeoutUtils' + +const logger = getLogger('sagemaker') + +export async function tryRemoteConnection(node: SagemakerSpaceNode, ctx: vscode.ExtensionContext) { + const spaceArn = (await node.getSpaceArn()) as string + const remoteEnv = await prepareDevEnvConnection(spaceArn, ctx, 'sm_lc') + + try { + await startVscodeRemote( + remoteEnv.SessionProcess, + remoteEnv.hostname, + '/home/sagemaker-user', + remoteEnv.vscPath, + 'sagemaker-user' + ) + } catch (err) { + getLogger().info( + `sm:OpenRemoteConnect: Unable to connect to target space with arn: ${await node.getAppArn()} error: ${err}` + ) + } +} + +export async function prepareDevEnvConnection( + appArn: string, + ctx: vscode.ExtensionContext, + connectionType: string, + session?: string, + wsUrl?: string, + token?: string, + domain?: string +) { + const remoteLogger = configureRemoteConnectionLogger() + const { ssm, vsc, ssh } = (await ensureDependencies()).unwrap() + + // Check timeout setting for remote SSH connections + const remoteSshConfig = vscode.workspace.getConfiguration('remote.SSH') + const current = remoteSshConfig.get('connectTimeout') + if (typeof current === 'number' && current < 120) { + await remoteSshConfig.update('connectTimeout', 120, vscode.ConfigurationTarget.Global) + void vscode.window.showInformationMessage( + 'Updated "remote.SSH.connectTimeout" to 120 seconds to improve stability.' + ) + } + + const hostnamePrefix = connectionType + const hostname = `${hostnamePrefix}_${appArn.replace(/\//g, '__').replace(/:/g, '_._')}` + + // save space credential mapping + if (connectionType === 'sm_lc') { + await persistLocalCredentials(appArn) + } else if (connectionType === 'sm_dl') { + await persistSSMConnection(appArn, domain ?? '', session, wsUrl, token) + } + + await startLocalServer(ctx) + await removeKnownHost(hostname) + + const sshConfig = new SshConfig(ssh, 'sm_', 'sagemaker_connect') + const config = await sshConfig.ensureValid() + if (config.isErr()) { + const err = config.err() + logger.error(`sagemaker: failed to add ssh config section: ${err.message}`) + throw err + } + + // set envirionment variables + const vars = getSmSsmEnv(ssm, path.join(ctx.globalStorageUri.fsPath, 'sagemaker-local-server-info.json')) + logger.info(`connect script logs at ${vars.LOG_FILE_LOCATION}`) + + const envProvider = async () => { + return { [sshAgentSocketVariable]: await startSshAgent(), ...vars } + } + const SessionProcess = createBoundProcess(envProvider).extend({ + onStdout: remoteLogger, + onStderr: remoteLogger, + rejectOnErrorCode: true, + }) + + return { + hostname, + envProvider, + sshPath: ssh, + vscPath: vsc, + SessionProcess, + } +} + +export function configureRemoteConnectionLogger() { + const logPrefix = 'sagemaker:' + const logger = (data: string) => getLogger().info(`${logPrefix}: ${data}`) + return logger +} + +export async function startLocalServer(ctx: vscode.ExtensionContext) { + const storagePath = ctx.globalStorageUri.fsPath + const serverPath = ctx.asAbsolutePath(path.join('dist/src/awsService/sagemaker/detached-server/', 'server.js')) + const outLog = path.join(storagePath, 'sagemaker-local-server.out.log') + const errLog = path.join(storagePath, 'sagemaker-local-server.err.log') + const infoFilePath = path.join(storagePath, 'sagemaker-local-server-info.json') + + logger.info(`sagemaker-local-server.*.log at ${storagePath}`) + + const customEndpoint = DevSettings.instance.get('endpoints', {})['sagemaker'] + + await stopLocalServer(ctx) + + const child = spawnDetachedServer(process.execPath, [serverPath], { + cwd: path.dirname(serverPath), + detached: true, + stdio: ['ignore', nodefs.openSync(outLog, 'a'), nodefs.openSync(errLog, 'a')], + env: { + ...process.env, + SAGEMAKER_ENDPOINT: customEndpoint, + SAGEMAKER_LOCAL_SERVER_FILE_PATH: infoFilePath, + }, + }) + + child.unref() + + // Wait for the info file to appear (timeout after 10 seconds) + const maxRetries = 20 + const delayMs = 500 + for (let i = 0; i < maxRetries; i++) { + if (await fs.existsFile(infoFilePath)) { + logger.debug('Detected server info file.') + return + } + await sleep(delayMs) + } + + throw new ToolkitError(`Timed out waiting for local server info file: ${infoFilePath}`) +} + +interface LocalServerInfo { + pid: number + port: string +} + +export async function stopLocalServer(ctx: vscode.ExtensionContext): Promise { + const infoFilePath = path.join(ctx.globalStorageUri.fsPath, 'sagemaker-local-server-info.json') + + if (!(await fs.existsFile(infoFilePath))) { + logger.debug('no server info file found. nothing to stop.') + return + } + + let pid: number | undefined + try { + const content = await fs.readFileText(infoFilePath) + const infoJson = JSON.parse(content) as LocalServerInfo + pid = infoJson.pid + } catch (err: any) { + throw ToolkitError.chain(err, 'failed to parse server info file') + } + + if (typeof pid === 'number' && !isNaN(pid)) { + try { + process.kill(pid) + logger.debug(`stopped local server with PID ${pid}`) + } catch (err: any) { + if (err.code === 'ESRCH') { + logger.warn(`no process found with PID ${pid}. It may have already exited.`) + } else { + throw ToolkitError.chain(err, 'failed to stop local server') + } + } + } else { + logger.warn('no valid PID found in info file.') + } + + try { + await fs.delete(infoFilePath) + logger.debug('removed server info file.') + } catch (err: any) { + logger.warn(`could not delete info file: ${err.message ?? err}`) + } +} + +export async function removeKnownHost(hostname: string): Promise { + const knownHostsPath = path.join(os.homedir(), '.ssh', 'known_hosts') + + if (!(await fs.existsFile(knownHostsPath))) { + logger.warn(`known_hosts not found at ${knownHostsPath}`) + return + } + + let lines: string[] + try { + const content = await fs.readFileText(knownHostsPath) + lines = content.split('\n') + } catch (err: any) { + throw ToolkitError.chain(err, 'Failed to read known_hosts file') + } + + const updatedLines = lines.filter((line) => !line.split(' ')[0].split(',').includes(hostname)) + + if (updatedLines.length !== lines.length) { + try { + await fs.writeFile(knownHostsPath, updatedLines.join('\n'), { atomic: true }) + logger.debug(`Removed '${hostname}' from known_hosts`) + } catch (err: any) { + throw ToolkitError.chain(err, 'Failed to write updated known_hosts file') + } + } +} diff --git a/packages/core/src/awsService/sagemaker/remoteUtils.ts b/packages/core/src/awsService/sagemaker/remoteUtils.ts new file mode 100644 index 00000000000..9ff8d8ca177 --- /dev/null +++ b/packages/core/src/awsService/sagemaker/remoteUtils.ts @@ -0,0 +1,48 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import { fs } from '../../shared/fs/fs' +import { SagemakerClient } from '../../shared/clients/sagemaker' +import { RemoteAppMetadata } from './utils' +import { getLogger } from '../../shared/logger/logger' +import { parseArn } from './detached-server/utils' + +export async function getRemoteAppMetadata(): Promise { + try { + const metadataPath = '/opt/ml/metadata/resource-metadata.json' + const metadataContent = await fs.readFileText(metadataPath) + const metadata = JSON.parse(metadataContent) + + const domainId = metadata.DomainId + const spaceName = metadata.SpaceName + + if (!domainId || !spaceName) { + throw new Error('DomainId or SpaceName not found in metadata file') + } + + const { region } = parseArn(metadata.ResourceArn) + + const client = new SagemakerClient(region) + const spaceDetails = await client.describeSpace({ DomainId: domainId, SpaceName: spaceName }) + + const userProfileName = spaceDetails.OwnershipSettings?.OwnerUserProfileName + + if (!userProfileName) { + throw new Error('OwnerUserProfileName not found in space details') + } + + return { + DomainId: domainId, + UserProfileName: userProfileName, + } + } catch (error) { + const logger = getLogger() + logger.error(`getRemoteAppMetadata: Failed to read metadata file, using fallback values: ${error}`) + return { + DomainId: '', + UserProfileName: '', + } + } +} diff --git a/packages/core/src/awsService/sagemaker/types.ts b/packages/core/src/awsService/sagemaker/types.ts new file mode 100644 index 00000000000..9b06058ef62 --- /dev/null +++ b/packages/core/src/awsService/sagemaker/types.ts @@ -0,0 +1,30 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +export interface SpaceMappings { + localCredential?: { [spaceName: string]: LocalCredentialProfile } + deepLink?: { [spaceName: string]: DeeplinkSession } +} + +export type LocalCredentialProfile = + | { type: 'iam'; profileName: string } + | { type: 'sso'; accessKey: string; secret: string; token: string } + +export interface DeeplinkSession { + requests: Record + refreshUrl?: string +} + +export interface SsmConnectionInfo { + sessionId: string + url: string + token: string + status?: 'fresh' | 'consumed' | 'pending' +} + +export interface ServerInfo { + pid: number + port: number +} diff --git a/packages/core/src/awsService/sagemaker/uriHandlers.ts b/packages/core/src/awsService/sagemaker/uriHandlers.ts new file mode 100644 index 00000000000..17c3c512272 --- /dev/null +++ b/packages/core/src/awsService/sagemaker/uriHandlers.ts @@ -0,0 +1,40 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' +import { SearchParams } from '../../shared/vscode/uriHandler' +import { deeplinkConnect } from './commands' +import { ExtContext } from '../../shared/extensions' +import { telemetry } from '../../shared/telemetry/telemetry' + +export function register(ctx: ExtContext) { + async function connectHandler(params: ReturnType) { + await telemetry.sagemaker_deeplinkConnect.run(async () => { + await deeplinkConnect( + ctx, + params.connection_identifier, + params.session, + `${params.ws_url}&cell-number=${params['cell-number']}`, + params.token, + params.domain + ) + }) + } + + return vscode.Disposable.from(ctx.uriHandler.onPath('/connect/sagemaker', connectHandler, parseConnectParams)) +} + +export function parseConnectParams(query: SearchParams) { + const params = query.getFromKeysOrThrow( + 'connection_identifier', + 'domain', + 'user_profile', + 'session', + 'ws_url', + 'cell-number', + 'token' + ) + return params +} diff --git a/packages/core/src/awsService/sagemaker/utils.ts b/packages/core/src/awsService/sagemaker/utils.ts new file mode 100644 index 00000000000..33cc5880bee --- /dev/null +++ b/packages/core/src/awsService/sagemaker/utils.ts @@ -0,0 +1,156 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as cp from 'child_process' // eslint-disable-line no-restricted-imports +import * as path from 'path' +import { AppStatus, SpaceStatus } from '@aws-sdk/client-sagemaker' +import { SagemakerSpaceApp } from '../../shared/clients/sagemaker' +import { sshLogFileLocation } from '../../shared/sshConfig' +import { fs } from '../../shared/fs/fs' +import { getLogger } from '../../shared/logger/logger' + +export const DomainKeyDelimiter = '__' + +export function getDomainSpaceKey(domainId: string, spaceName: string): string { + return `${domainId}${DomainKeyDelimiter}${spaceName}` +} + +export function getDomainUserProfileKey(domainId: string, userProfileName: string): string { + return `${domainId}${DomainKeyDelimiter}${userProfileName}` +} + +export function generateSpaceStatus(spaceStatus?: string, appStatus?: string) { + if ( + spaceStatus === SpaceStatus.Failed || + spaceStatus === SpaceStatus.Delete_Failed || + spaceStatus === SpaceStatus.Update_Failed || + (appStatus === AppStatus.Failed && spaceStatus !== SpaceStatus.Updating) + ) { + return 'Failed' + } + + if (spaceStatus === SpaceStatus.InService && appStatus === AppStatus.InService) { + return 'Running' + } + + if (spaceStatus === SpaceStatus.InService && appStatus === AppStatus.Pending) { + return 'Starting' + } + + if (spaceStatus === SpaceStatus.Updating) { + return 'Updating' + } + + if (spaceStatus === SpaceStatus.InService && appStatus === AppStatus.Deleting) { + return 'Stopping' + } + + if (spaceStatus === SpaceStatus.InService && (appStatus === AppStatus.Deleted || !appStatus)) { + return 'Stopped' + } + + if (spaceStatus === SpaceStatus.Deleting) { + return 'Deleting' + } + + return 'Unknown' +} + +export interface RemoteAppMetadata { + DomainId: string + UserProfileName: string +} + +export function getSpaceAppsForUserProfile( + spaceApps: SagemakerSpaceApp[], + userProfilePrefix: string, + domainId?: string +): string[] { + return spaceApps.reduce((result: string[], app: SagemakerSpaceApp) => { + if (app.OwnershipSettingsSummary?.OwnerUserProfileName?.startsWith(userProfilePrefix)) { + if (domainId && app.DomainId !== domainId) { + return result + } + result.push( + getDomainUserProfileKey(app.DomainId || '', app.OwnershipSettingsSummary?.OwnerUserProfileName || '') + ) + } + + return result + }, [] as string[]) +} + +export function getSmSsmEnv(ssmPath: string, sagemakerLocalServerPath: string): NodeJS.ProcessEnv { + return Object.assign( + { + AWS_SSM_CLI: ssmPath, + SAGEMAKER_LOCAL_SERVER_FILE_PATH: sagemakerLocalServerPath, + LOF_FILE_LOCATION: sshLogFileLocation('sagemaker', 'blah'), + }, + process.env + ) +} + +export function spawnDetachedServer(...args: Parameters) { + return cp.spawn(...args) +} + +export const ActivityCheckInterval = 60000 + +/** + * Updates the idle file with the current timestamp + */ +export async function updateIdleFile(idleFilePath: string): Promise { + try { + const timestamp = new Date().toISOString() + await fs.writeFile(idleFilePath, timestamp) + } catch (error) { + getLogger().error(`Failed to update SMAI idle file: ${error}`) + } +} + +/** + * Checks for terminal activity by reading the /dev/pts directory and comparing modification times of the files. + * + * The /dev/pts directory is used in Unix-like operating systems to represent pseudo-terminal (PTY) devices. + * Each active terminal session is assigned a PTY device. These devices are represented as files within the /dev/pts directory. + * When a terminal session has activity, such as when a user inputs commands or output is written to the terminal, + * the modification time (mtime) of the corresponding PTY device file is updated. By monitoring the modification + * times of the files in the /dev/pts directory, we can detect terminal activity. + * + * If activity is detected (i.e., if any PTY device file was modified within the CHECK_INTERVAL), this function + * updates the last activity timestamp. + */ +export async function checkTerminalActivity(idleFilePath: string): Promise { + try { + const files = await fs.readdir('/dev/pts') + const now = Date.now() + + for (const [fileName] of files) { + const filePath = path.join('/dev/pts', fileName) + try { + const stats = await fs.stat(filePath) + const mtime = new Date(stats.mtime).getTime() + if (now - mtime < ActivityCheckInterval) { + await updateIdleFile(idleFilePath) + return + } + } catch (err) { + getLogger().error(`Error reading file stats:`, err) + } + } + } catch (err) { + getLogger().error(`Error reading /dev/pts directory:`, err) + } +} + +/** + * Starts monitoring terminal activity by setting an interval to check for activity in the /dev/pts directory. + */ +export function startMonitoringTerminalActivity(idleFilePath: string): NodeJS.Timeout { + return setInterval(async () => { + await checkTerminalActivity(idleFilePath) + }, ActivityCheckInterval) +} diff --git a/packages/core/src/awsexplorer/activation.ts b/packages/core/src/awsexplorer/activation.ts index f904658fcaa..ec4c23ccd79 100644 --- a/packages/core/src/awsexplorer/activation.ts +++ b/packages/core/src/awsexplorer/activation.ts @@ -36,6 +36,7 @@ import { TreeNode } from '../shared/treeview/resourceTreeDataProvider' import { getSourceNode } from '../shared/utilities/treeNodeUtils' import { openAwsCFNConsoleCommand, openAwsConsoleCommand } from '../shared/awsConsole' import { StackNameNode } from '../awsService/appBuilder/explorer/nodes/deployedStack' +import { LambdaFunctionNodeDecorationProvider } from '../lambda/explorer/lambdaFunctionNodeDecorationProvider' /** * Activates the AWS Explorer UI and related functionality. @@ -65,7 +66,10 @@ export async function activate(args: { telemetry.aws_expandExplorerNode.emit({ serviceType: element.element.serviceId, result: 'Succeeded' }) } }) - globals.context.subscriptions.push(view) + globals.context.subscriptions.push( + view, + vscode.window.registerFileDecorationProvider(LambdaFunctionNodeDecorationProvider.getInstance()) + ) await registerAwsExplorerCommands(args.context, awsExplorer, args.toolkitOutputChannel) diff --git a/packages/core/src/awsexplorer/regionNode.ts b/packages/core/src/awsexplorer/regionNode.ts index 10e8d975fe8..d78bcbec2a4 100644 --- a/packages/core/src/awsexplorer/regionNode.ts +++ b/packages/core/src/awsexplorer/regionNode.ts @@ -32,6 +32,8 @@ import { getEcsRootNode } from '../awsService/ecs/model' import { compareTreeItems, TreeShim } from '../shared/treeview/utils' import { Ec2ParentNode } from '../awsService/ec2/explorer/ec2ParentNode' import { Ec2Client } from '../shared/clients/ec2' +import { SagemakerParentNode } from '../awsService/sagemaker/explorer/sagemakerParentNode' +import { SagemakerClient } from '../shared/clients/sagemaker' interface ServiceNode { allRegions?: boolean @@ -96,6 +98,10 @@ const serviceCandidates: ServiceNode[] = [ serviceId: 's3', createFn: (regionCode: string) => new S3Node(new S3Client(regionCode)), }, + { + serviceId: 'api.sagemaker', + createFn: (regionCode: string) => new SagemakerParentNode(regionCode, new SagemakerClient(regionCode)), + }, { serviceId: 'schemas', createFn: (regionCode: string) => new SchemasNode(new DefaultSchemaClient(regionCode)), diff --git a/packages/core/src/codewhisperer/activation.ts b/packages/core/src/codewhisperer/activation.ts index d6dd7fdc61d..941156a0d2e 100644 --- a/packages/core/src/codewhisperer/activation.ts +++ b/packages/core/src/codewhisperer/activation.ts @@ -23,6 +23,7 @@ import { enableCodeSuggestions, toggleCodeSuggestions, showReferenceLog, + showLogs, showSecurityScan, showLearnMore, showSsoSignIn, @@ -48,7 +49,6 @@ import { regenerateFix, ignoreAllIssues, focusIssue, - showExploreAgentsView, showCodeIssueGroupingQuickPick, selectRegionProfileCommand, } from './commands/basicCommands' @@ -299,7 +299,7 @@ export async function activate(context: ExtContext): Promise { ), vscode.window.registerWebviewViewProvider(ReferenceLogViewProvider.viewType, ReferenceLogViewProvider.instance), showReferenceLog.register(), - showExploreAgentsView.register(), + showLogs.register(), vscode.languages.registerCodeLensProvider( [...CodeWhispererConstants.platformLanguageIds], ReferenceInlineProvider.instance diff --git a/packages/core/src/codewhisperer/client/codewhisperer.ts b/packages/core/src/codewhisperer/client/codewhisperer.ts index 35f699b24c2..051254d1873 100644 --- a/packages/core/src/codewhisperer/client/codewhisperer.ts +++ b/packages/core/src/codewhisperer/client/codewhisperer.ts @@ -262,7 +262,7 @@ export class DefaultCodeWhispererClient { /** * @description Use this function to get the status of the code transformation. We should * be polling this function periodically to get updated results. When this function - * returns COMPLETED we know the transformation is done. + * returns PARTIALLY_COMPLETED or COMPLETED we know the transformation is done. */ public async codeModernizerGetCodeTransformation( request: CodeWhispererUserClient.GetTransformationRequest @@ -272,15 +272,15 @@ export class DefaultCodeWhispererClient { } /** - * @description After the job has been PAUSED we need to get user intervention. Once that user - * intervention has been handled we can resume the transformation job. + * @description During client-side build, or after the job has been PAUSED we need to get user intervention. + * Once that user action has been handled we can resume the transformation job. * @params transformationJobId - String id returned from StartCodeTransformationResponse * @params userActionStatus - String to determine what action the user took, if any. */ public async codeModernizerResumeTransformation( request: CodeWhispererUserClient.ResumeTransformationRequest ): Promise> { - return (await this.createUserSdkClient()).resumeTransformation(request).promise() + return (await this.createUserSdkClient(8)).resumeTransformation(request).promise() } /** diff --git a/packages/core/src/codewhisperer/commands/basicCommands.ts b/packages/core/src/codewhisperer/commands/basicCommands.ts index f2b67c49593..ec1b5ae6e63 100644 --- a/packages/core/src/codewhisperer/commands/basicCommands.ts +++ b/packages/core/src/codewhisperer/commands/basicCommands.ts @@ -12,7 +12,6 @@ import { DefaultCodeWhispererClient } from '../client/codewhisperer' import { confirmStopSecurityScan, startSecurityScan } from './startSecurityScan' import { SecurityPanelViewProvider } from '../views/securityPanelViewProvider' import { - codeFixState, CodeScanIssue, CodeScansState, codeScanState, @@ -50,7 +49,7 @@ import { once } from '../../shared/utilities/functionUtils' import { focusAmazonQPanel } from '../../codewhispererChat/commands/registerCommands' import { removeDiagnostic } from '../service/diagnosticsProvider' import { SsoAccessTokenProvider } from '../../auth/sso/ssoAccessTokenProvider' -import { ToolkitError, getErrorMsg, getTelemetryReason, getTelemetryReasonDesc } from '../../shared/errors' +import { ToolkitError, getTelemetryReason, getTelemetryReasonDesc } from '../../shared/errors' import { isRemoteWorkspace } from '../../shared/vscode/env' import { isBuilderIdConnection } from '../../auth/connection' import globals from '../../shared/extensionGlobals' @@ -61,8 +60,6 @@ import { SecurityIssueProvider } from '../service/securityIssueProvider' import { CodeWhispererSettings } from '../util/codewhispererSettings' import { closeDiff, getPatchedCode } from '../../shared/utilities/diffUtils' import { insertCommentAboveLine } from '../../shared/utilities/commentUtils' -import { startCodeFixGeneration } from './startCodeFixGeneration' -import { DefaultAmazonQAppInitContext } from '../../amazonq/apps/initContext' import path from 'path' import { UserWrittenCodeTracker } from '../tracker/userWrittenCodeTracker' import { parsePatch } from 'diff' @@ -149,17 +146,29 @@ export const showReferenceLog = Commands.declare( } ) -export const showExploreAgentsView = Commands.declare( - { id: 'aws.amazonq.exploreAgents', compositeKey: { 1: 'source' } }, +export const showLogs = Commands.declare( + { id: 'aws.amazonq.showLogs', compositeKey: { 1: 'source' } }, () => async (_: VsCodeCommandArg, source: CodeWhispererSource) => { if (_ !== placeholder) { source = 'ellipsesMenu' } - DefaultAmazonQAppInitContext.instance.getAppsToWebViewMessagePublisher().publish({ - sender: 'amazonqCore', - command: 'showExploreAgentsView', - }) + // Show warning message without buttons - just informational + void vscode.window.showWarningMessage( + 'Log files may contain sensitive information such as account IDs, resource names, and other data. Be careful when sharing these logs.' + ) + + // Get the log directory path + const logFolderPath = globals.context.logUri?.fsPath + const path = require('path') + const logFilePath = path.join(logFolderPath, 'Amazon Q Logs.log') + if (logFilePath) { + // Open the log directory in the OS file explorer directly + await vscode.commands.executeCommand('revealFileInOS', vscode.Uri.file(logFilePath)) + } else { + // Fallback: show error if log path is not available + void vscode.window.showErrorMessage('Log location not available.') + } } ) @@ -368,10 +377,6 @@ export const openSecurityIssuePanel = Commands.declare( const targetIssue: CodeScanIssue = issue instanceof IssueItem ? issue.issue : issue const targetFilePath: string = issue instanceof IssueItem ? issue.filePath : filePath await showSecurityIssueWebview(context.extensionContext, targetIssue, targetFilePath) - - if (targetIssue.suggestedFixes.length === 0) { - await generateFix.execute(targetIssue, targetFilePath, 'webview', true, false) - } telemetry.codewhisperer_codeScanIssueViewDetails.emit({ findingId: targetIssue.findingId, detectorId: targetIssue.detectorId, @@ -640,6 +645,12 @@ const registerToolkitApiCallbackOnce = once(() => { export const registerToolkitApiCallback = Commands.declare( { id: 'aws.amazonq.refreshConnectionCallback' }, () => async (toolkitApi?: any) => { + // Early return if already registered to avoid duplicate work + if (_toolkitApi) { + getLogger().debug('Toolkit API callback already registered, skipping') + return + } + // While the Q/CW exposes an API for the Toolkit to register callbacks on auth changes, // we need to do it manually here because the Toolkit would have been unable to call // this API if the Q/CW extension started afterwards (and this code block is running). @@ -685,116 +696,13 @@ export const generateFix = Commands.declare( { id: 'aws.amazonq.security.generateFix' }, (client: DefaultCodeWhispererClient, context: ExtContext) => async ( - issue: CodeScanIssue | IssueItem | undefined, + issueItem: IssueItem, filePath: string, source: Component, refresh: boolean = false, shouldOpenSecurityIssuePanel: boolean = true ) => { - const targetIssue: CodeScanIssue | undefined = issue instanceof IssueItem ? issue.issue : issue - const targetFilePath: string = issue instanceof IssueItem ? issue.filePath : filePath - const targetSource: Component = issue instanceof IssueItem ? 'tree' : source - if (!targetIssue) { - return - } - if (targetIssue.ruleId === CodeWhispererConstants.sasRuleId) { - getLogger().warn('GenerateFix is not available for SAS findings.') - return - } - await telemetry.codewhisperer_codeScanIssueGenerateFix.run(async () => { - try { - if (shouldOpenSecurityIssuePanel) { - await vscode.commands - .executeCommand('aws.amazonq.openSecurityIssuePanel', targetIssue, targetFilePath) - .then(undefined, (e) => { - getLogger().error('Failed to open security issue panel: %s', e.message) - }) - } - await updateSecurityIssueWebview({ - isGenerateFixLoading: true, - // eslint-disable-next-line unicorn/no-null - generateFixError: null, - context: context.extensionContext, - filePath: targetFilePath, - shouldRefreshView: false, - }) - - codeFixState.setToRunning() - let hasSuggestedFix = false - const { suggestedFix, jobId } = await startCodeFixGeneration( - client, - targetIssue, - targetFilePath, - targetIssue.findingId - ) - // redact the fix if the user disabled references and there is a reference - if ( - // TODO: enable references later for scans - // !CodeWhispererSettings.instance.isSuggestionsWithCodeReferencesEnabled() && - suggestedFix?.references && - suggestedFix?.references?.length > 0 - ) { - getLogger().debug( - `Received fix with reference and user settings disallow references. Job ID: ${jobId}` - ) - // TODO: re-enable notifications once references published - // void vscode.window.showInformationMessage( - // 'Your settings do not allow code generation with references.' - // ) - hasSuggestedFix = false - } else { - hasSuggestedFix = suggestedFix !== undefined - } - telemetry.record({ includesFix: hasSuggestedFix }) - const updatedIssue: CodeScanIssue = { - ...targetIssue, - fixJobId: jobId, - suggestedFixes: - hasSuggestedFix && suggestedFix - ? [ - { - code: suggestedFix.codeDiff, - description: suggestedFix.description ?? '', - references: suggestedFix.references, - }, - ] - : [], - } - await updateSecurityIssueWebview({ - issue: updatedIssue, - isGenerateFixLoading: false, - filePath: targetFilePath, - context: context.extensionContext, - shouldRefreshView: true, - }) - - SecurityIssueProvider.instance.updateIssue(updatedIssue, targetFilePath) - SecurityIssueTreeViewProvider.instance.refresh() - } catch (err) { - const error = err instanceof Error ? err : new TypeError('Unexpected error') - await updateSecurityIssueWebview({ - issue: targetIssue, - isGenerateFixLoading: false, - generateFixError: getErrorMsg(error, true), - filePath: targetFilePath, - context: context.extensionContext, - shouldRefreshView: false, - }) - SecurityIssueProvider.instance.updateIssue(targetIssue, targetFilePath) - SecurityIssueTreeViewProvider.instance.refresh() - throw err - } finally { - telemetry.record({ - component: targetSource, - detectorId: targetIssue.detectorId, - findingId: targetIssue.findingId, - ruleId: targetIssue.ruleId, - variant: refresh ? 'refresh' : undefined, - autoDetected: targetIssue.autoDetected, - codewhispererCodeScanJobId: targetIssue.scanJobId, - }) - } - }) + await vscode.commands.executeCommand('aws.amazonq.generateFix', issueItem.issue, issueItem.filePath) } ) @@ -824,19 +732,13 @@ export const rejectFix = Commands.declare( export const regenerateFix = Commands.declare( { id: 'aws.amazonq.security.regenerateFix' }, - () => async (issue: CodeScanIssue | IssueItem | undefined, filePath: string, source: Component) => { - const targetIssue: CodeScanIssue | undefined = issue instanceof IssueItem ? issue.issue : issue - const targetFilePath: string = issue instanceof IssueItem ? issue.filePath : filePath - const targetSource: Component = issue instanceof IssueItem ? 'tree' : source - const updatedIssue = await rejectFix.execute(targetIssue, targetFilePath) - await generateFix.execute(updatedIssue, targetFilePath, targetSource, true) - } + () => async (issue: CodeScanIssue | IssueItem | undefined, filePath: string, source: Component) => {} ) export const explainIssue = Commands.declare( { id: 'aws.amazonq.security.explain' }, () => async (issueItem: IssueItem) => { - await vscode.commands.executeCommand('aws.amazonq.explainIssue', issueItem.issue) + await vscode.commands.executeCommand('aws.amazonq.explainIssue', issueItem.issue, issueItem.filePath) } ) diff --git a/packages/core/src/codewhisperer/commands/startSecurityScan.ts b/packages/core/src/codewhisperer/commands/startSecurityScan.ts index d04fe6effc3..bd081face38 100644 --- a/packages/core/src/codewhisperer/commands/startSecurityScan.ts +++ b/packages/core/src/codewhisperer/commands/startSecurityScan.ts @@ -108,6 +108,9 @@ export async function startSecurityScan( zipUtil: ZipUtil = new ZipUtil(), scanUuid?: string ) { + if (scope === CodeAnalysisScope.AGENTIC) { + throw new CreateCodeScanFailedError('Cannot use Agentic scope') + } const profile = AuthUtil.instance.regionProfileManager.activeRegionProfile const logger = getLoggerForScope(scope) /** @@ -401,7 +404,7 @@ export function showSecurityScanResults( zipMetadata: ZipMetadata, totalIssues: number ) { - initSecurityScanRender(securityRecommendationCollection, context, editor, scope) + initSecurityScanRender(securityRecommendationCollection, editor, scope) if (scope === CodeWhispererConstants.CodeAnalysisScope.PROJECT) { populateCodeScanLogStream(zipMetadata.scannedFiles) @@ -439,7 +442,7 @@ export function showScanResultsInChat( break } - initSecurityScanRender(securityRecommendationCollection, context, editor, scope) + initSecurityScanRender(securityRecommendationCollection, editor, scope) if (totalIssues > 0) { SecurityIssueTreeViewProvider.focus() } diff --git a/packages/core/src/codewhisperer/commands/startTestGeneration.ts b/packages/core/src/codewhisperer/commands/startTestGeneration.ts deleted file mode 100644 index e99fd499e5a..00000000000 --- a/packages/core/src/codewhisperer/commands/startTestGeneration.ts +++ /dev/null @@ -1,259 +0,0 @@ -/*! - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -import { getLogger } from '../../shared/logger/logger' -import { ZipUtil } from '../util/zipUtil' -import { ArtifactMap } from '../client/codewhisperer' -import { testGenerationLogsDir } from '../../shared/filesystemUtilities' -import { - createTestJob, - exportResultsArchive, - getPresignedUrlAndUploadTestGen, - pollTestJobStatus, - throwIfCancelled, -} from '../service/testGenHandler' -import path from 'path' -import { testGenState } from '../models/model' -import { ChatSessionManager } from '../../amazonqTest/chat/storages/chatSession' -import { ChildProcess, spawn } from 'child_process' // eslint-disable-line no-restricted-imports -import { BuildStatus } from '../../amazonqTest/chat/session/session' -import { fs } from '../../shared/fs/fs' -import { Range } from '../client/codewhispereruserclient' -import { AuthUtil } from '../indexNode' - -// eslint-disable-next-line unicorn/no-null -let spawnResult: ChildProcess | null = null -let isCancelled = false -export async function startTestGenerationProcess( - filePath: string, - userInputPrompt: string, - tabID: string, - initialExecution: boolean, - selectionRange?: Range -) { - const logger = getLogger() - const session = ChatSessionManager.Instance.getSession() - const profile = AuthUtil.instance.regionProfileManager.activeRegionProfile - // TODO: Step 0: Initial Test Gen telemetry - try { - logger.verbose(`Starting Test Generation `) - logger.verbose(`Tab ID: ${tabID} !== ${session.tabID}`) - if (tabID !== session.tabID) { - logger.verbose(`Tab ID mismatch: ${tabID} !== ${session.tabID}`) - return - } - /** - * Step 1: Zip the project - */ - - const zipUtil = new ZipUtil() - if (initialExecution) { - const projectPath = zipUtil.getProjectPath(filePath) ?? '' - const relativeTargetPath = path.relative(projectPath, filePath) - session.listOfTestGenerationJobId = [] - session.shortAnswer = undefined - session.sourceFilePath = relativeTargetPath - session.projectRootPath = projectPath - session.listOfTestGenerationJobId = [] - } - const zipMetadata = await zipUtil.generateZipTestGen(session.projectRootPath, initialExecution) - session.srcPayloadSize = zipMetadata.buildPayloadSizeInBytes - session.srcZipFileSize = zipMetadata.zipFileSizeInBytes - - /** - * Step 2: Get presigned Url, upload and clean up - */ - throwIfCancelled() - if (!shouldContinueRunning(tabID)) { - return - } - let artifactMap: ArtifactMap = {} - const uploadStartTime = performance.now() - try { - artifactMap = await getPresignedUrlAndUploadTestGen(zipMetadata, profile) - } finally { - const outputLogPath = path.join(testGenerationLogsDir, 'output.log') - if (await fs.existsFile(outputLogPath)) { - await fs.delete(outputLogPath) - } - await zipUtil.removeTmpFiles(zipMetadata) - session.artifactsUploadDuration = performance.now() - uploadStartTime - } - - /** - * Step 3: Create scan job with startTestGeneration - */ - throwIfCancelled() - if (!shouldContinueRunning(tabID)) { - return - } - const sessionFilePath = session.sourceFilePath - const testJob = await createTestJob( - artifactMap, - [ - { - relativeTargetPath: sessionFilePath, - targetLineRangeList: selectionRange ? [selectionRange] : [], - }, - ], - userInputPrompt, - undefined, - profile - ) - if (!testJob.testGenerationJob) { - throw Error('Test job not found') - } - session.testGenerationJob = testJob.testGenerationJob - - /** - * Step 4: Polling mechanism on test job status with getTestGenStatus - */ - throwIfCancelled() - if (!shouldContinueRunning(tabID)) { - return - } - await pollTestJobStatus( - testJob.testGenerationJob.testGenerationJobId, - testJob.testGenerationJob.testGenerationJobGroupName, - filePath, - initialExecution, - profile - ) - // TODO: Send status to test summary - throwIfCancelled() - if (!shouldContinueRunning(tabID)) { - return - } - /** - * Step 5: Process and show the view diff by getting the results from exportResultsArchive - */ - // https://github.com/aws/aws-toolkit-vscode/blob/0164d4145e58ae036ddf3815455ea12a159d491d/packages/core/src/codewhisperer/service/transformByQ/transformationResultsViewProvider.ts#L314-L405 - await exportResultsArchive( - artifactMap.SourceCode, - testJob.testGenerationJob.testGenerationJobGroupName, - testJob.testGenerationJob.testGenerationJobId, - path.basename(session.projectRootPath), - session.projectRootPath, - initialExecution - ) - } catch (error) { - logger.error(`startTestGenerationProcess failed: %O`, error) - // TODO: Send error message to Chat - testGenState.getChatControllers()?.errorThrown.fire({ - tabID: session.tabID, - error: error, - }) - } finally { - testGenState.setToNotStarted() - } -} - -export function shouldContinueRunning(tabID: string): boolean { - if (tabID !== ChatSessionManager.Instance.getSession().tabID) { - getLogger().verbose(`Tab ID mismatch: ${tabID} !== ${ChatSessionManager.Instance.getSession().tabID}`) - return false - } - return true -} - -/** - * Run client side build with given build commands - */ -export async function runBuildCommand(listofBuildCommand: string[]): Promise { - for (const buildCommand of listofBuildCommand) { - try { - await fs.mkdir(testGenerationLogsDir) - const tmpFile = path.join(testGenerationLogsDir, 'output.log') - const result = await runLocalBuild(buildCommand, tmpFile) - if (result.isCancelled) { - return BuildStatus.CANCELLED - } - if (result.code !== 0) { - return BuildStatus.FAILURE - } - } catch (error) { - getLogger().error(`Build process error`) - return BuildStatus.FAILURE - } - } - return BuildStatus.SUCCESS -} - -function runLocalBuild( - buildCommand: string, - tmpFile: string -): Promise<{ code: number | null; isCancelled: boolean; message: string }> { - return new Promise(async (resolve, reject) => { - const environment = process.env - const repositoryPath = ChatSessionManager.Instance.getSession().projectRootPath - const [command, ...args] = buildCommand.split(' ') - getLogger().info(`Build process started for command: ${buildCommand}, for path: ${repositoryPath}`) - - let buildLogs = '' - - spawnResult = spawn(command, args, { - cwd: repositoryPath, - shell: true, - env: environment, - }) - - if (spawnResult.stdout) { - spawnResult.stdout.on('data', async (data) => { - const output = data.toString().trim() - getLogger().info(`BUILD OUTPUT: ${output}`) - buildLogs += output - }) - } - - if (spawnResult.stderr) { - spawnResult.stderr.on('data', async (data) => { - const output = data.toString().trim() - getLogger().warn(`BUILD ERROR: ${output}`) - buildLogs += output - }) - } - - spawnResult.on('close', async (code) => { - let message = '' - if (isCancelled) { - message = 'Build cancelled' - getLogger().info('BUILD CANCELLED') - } else if (code === 0) { - message = 'Build successful' - getLogger().info('BUILD SUCCESSFUL') - } else { - message = `Build failed with exit code ${code}` - getLogger().info(`BUILD FAILED with exit code ${code}`) - } - - try { - await fs.writeFile(tmpFile, buildLogs) - getLogger().info(`Build logs written to ${tmpFile}`) - } catch (error) { - getLogger().error(`Failed to write build logs to ${tmpFile}: ${error}`) - } - - resolve({ code, isCancelled, message }) - - // eslint-disable-next-line unicorn/no-null - spawnResult = null - isCancelled = false - }) - - spawnResult.on('error', (error) => { - reject(new Error(`Failed to start build process: ${error.message}`)) - }) - }) -} - -export function cancelBuild() { - if (spawnResult) { - isCancelled = true - spawnResult.kill() - getLogger().info('Build cancellation requested') - } else { - getLogger().info('No active build to cancel') - } -} diff --git a/packages/core/src/codewhisperer/commands/startTransformByQ.ts b/packages/core/src/codewhisperer/commands/startTransformByQ.ts index 74e50f0890e..aa8bea11da2 100644 --- a/packages/core/src/codewhisperer/commands/startTransformByQ.ts +++ b/packages/core/src/codewhisperer/commands/startTransformByQ.ts @@ -16,10 +16,10 @@ import { jobPlanProgress, FolderInfo, ZipManifest, - TransformByQStatus, TransformationType, TransformationCandidateProject, RegionProfile, + sessionJobHistory, } from '../models/model' import { createZipManifest, @@ -43,7 +43,6 @@ import { validateOpenProjects, } from '../service/transformByQ/transformProjectValidationHandler' import { - getVersionData, prepareProjectDependencies, runMavenDependencyUpdateCommands, } from '../service/transformByQ/transformMavenHandler' @@ -79,10 +78,16 @@ import { convertDateToTimestamp } from '../../shared/datetime' import { findStringInDirectory } from '../../shared/utilities/workspaceUtils' import { makeTemporaryToolkitFolder } from '../../shared/filesystemUtilities' import { AuthUtil } from '../util/authUtil' +import { + cleanupTempJobFiles, + createMetadataFile, + JobMetadata, + writeToHistoryFile, +} from '../service/transformByQ/transformationHistoryHandler' export function getFeedbackCommentData() { const jobId = transformByQState.getJobId() - const s = `Q CodeTransform jobId: ${jobId ? jobId : 'none'}` + const s = `Q CodeTransformation jobId: ${jobId ? jobId : 'none'}` return s } @@ -110,10 +115,10 @@ export async function processSQLConversionTransformFormInput(pathToProject: stri export async function compileProject() { try { - const dependenciesFolder: FolderInfo = getDependenciesFolderInfo() + const dependenciesFolder: FolderInfo = await getDependenciesFolderInfo() transformByQState.setDependencyFolderInfo(dependenciesFolder) - const modulePath = transformByQState.getProjectPath() - await prepareProjectDependencies(dependenciesFolder, modulePath) + const projectPath = transformByQState.getProjectPath() + await prepareProjectDependencies(dependenciesFolder.path, projectPath) } catch (err) { // open build-logs.txt file to show user error logs await writeAndShowBuildLogs(true) @@ -175,8 +180,7 @@ export async function humanInTheLoopRetryLogic(jobId: string, profile: RegionPro if (status === 'PAUSED') { const hilStatusFailure = await initiateHumanInTheLoopPrompt(jobId) if (hilStatusFailure) { - // We rejected the changes and resumed the job and should - // try to resume normal polling asynchronously + // resume polling void humanInTheLoopRetryLogic(jobId, profile) } } else { @@ -184,9 +188,7 @@ export async function humanInTheLoopRetryLogic(jobId: string, profile: RegionPro } } catch (error) { status = 'FAILED' - // TODO if we encounter error in HIL, do we stop job? await finalizeTransformByQ(status) - // bubble up error to callee function throw error } } @@ -225,11 +227,9 @@ export async function preTransformationUploadCode() { const payloadFilePath = zipCodeResult.tempFilePath const zipSize = zipCodeResult.fileSize - const dependenciesCopied = zipCodeResult.dependenciesCopied telemetry.record({ codeTransformTotalByteSize: zipSize, - codeTransformDependenciesCopied: dependenciesCopied, }) transformByQState.setPayloadFilePath(payloadFilePath) @@ -408,7 +408,7 @@ export async function finishHumanInTheLoop(selectedDependency?: string) { // 7) We need to take that output of maven and use CreateUploadUrl const uploadFolderInfo = humanInTheLoopManager.getUploadFolderInfo() - await prepareProjectDependencies(uploadFolderInfo, uploadFolderInfo.path) + await prepareProjectDependencies(uploadFolderInfo.path, uploadFolderInfo.path) // zipCode side effects deletes the uploadFolderInfo right away const uploadResult = await zipCode({ dependenciesFolder: uploadFolderInfo, @@ -449,13 +449,11 @@ export async function finishHumanInTheLoop(selectedDependency?: string) { await terminateHILEarly(jobId) void humanInTheLoopRetryLogic(jobId, profile) } finally { - // Always delete the dependency directories telemetry.codeTransform_humanInTheLoop.emit({ codeTransformSessionId: CodeTransformTelemetryState.instance.getSessionId(), codeTransformJobId: jobId, codeTransformMetadata: CodeTransformTelemetryState.instance.getCodeTransformMetaDataString(), result: hilResult, - // TODO: make a generic reason field for telemetry logging so we don't log sensitive PII data reason: hilResult === MetadataResult.Fail ? 'Runtime error occurred' : undefined, }) await HumanInTheLoopManager.instance.cleanUpArtifacts() @@ -482,6 +480,23 @@ export async function startTransformationJob( codeTransformRunTimeLatency: calculateTotalLatency(transformStartTime), }) }) + + // create local history folder(s) and store metadata + const metadata: JobMetadata = { + jobId: jobId, + projectName: transformByQState.getProjectName(), + transformationType: transformByQState.getTransformationType() ?? TransformationType.LANGUAGE_UPGRADE, + sourceJDKVersion: transformByQState.getSourceJDKVersion() ?? JDKVersion.JDK8, + targetJDKVersion: transformByQState.getTargetJDKVersion() ?? JDKVersion.JDK17, + customDependencyVersionFilePath: transformByQState.getCustomDependencyVersionFilePath(), + customBuildCommand: transformByQState.getCustomBuildCommand(), + targetJavaHome: transformByQState.getTargetJavaHome() ?? '', + projectPath: transformByQState.getProjectPath(), + startTime: transformByQState.getStartTime(), + } + + const jobHistoryPath = await createMetadataFile(transformByQState.getPayloadFilePath(), metadata) + transformByQState.setJobHistoryPath(jobHistoryPath) } catch (error) { getLogger().error(`CodeTransformation: ${CodeWhispererConstants.failedToStartJobNotification}`, error) const errorMessage = (error as Error).message.toLowerCase() @@ -504,7 +519,7 @@ export async function startTransformationJob( throw new JobStartError() } - await sleep(2000) // sleep before polling job to prevent ThrottlingException + await sleep(5000) // sleep before polling job status to prevent ThrottlingException throwIfCancelled() return jobId @@ -523,9 +538,7 @@ export async function pollTransformationStatusUntilPlanReady(jobId: string, prof transformByQState.setJobFailureErrorChatMessage(CodeWhispererConstants.failedToCompleteJobChatMessage) } - // Since we don't yet have a good way of knowing what the error was, - // we try to fetch any build failure artifacts that may exist so that we can optionally - // show them to the user if they exist. + // try to download pre-build error logs if available let pathToLog = '' try { const tempToolkitFolder = await makeTemporaryToolkitFolder() @@ -651,6 +664,7 @@ export async function setTransformationToRunningState() { transformByQState.resetSessionJobHistory() transformByQState.setJobId('') // so that details for last job are not overwritten when running one job after another transformByQState.setPolledJobStatus('') // so that previous job's status does not display at very beginning of this job + transformByQState.setHasSeenTransforming(false) CodeTransformTelemetryState.instance.setStartTime() transformByQState.setStartTime( @@ -693,23 +707,17 @@ export async function postTransformationJob() { const durationInMs = calculateTotalLatency(CodeTransformTelemetryState.instance.getStartTime()) const resultStatusMessage = transformByQState.getStatus() - if (transformByQState.getTransformationType() !== TransformationType.SQL_CONVERSION) { - // the below is only applicable when user is doing a Java 8/11 language upgrade - const versionInfo = await getVersionData() - const mavenVersionInfoMessage = `${versionInfo[0]} (${transformByQState.getMavenName()})` - const javaVersionInfoMessage = `${versionInfo[1]} (${transformByQState.getMavenName()})` - - telemetry.codeTransform_totalRunTime.emit({ - buildSystemVersion: mavenVersionInfoMessage, - codeTransformSessionId: CodeTransformTelemetryState.instance.getSessionId(), - codeTransformJobId: transformByQState.getJobId(), - codeTransformResultStatusMessage: resultStatusMessage, - codeTransformRunTimeLatency: durationInMs, - codeTransformLocalJavaVersion: javaVersionInfoMessage, - result: resultStatusMessage === TransformByQStatus.Succeeded ? MetadataResult.Pass : MetadataResult.Fail, - reason: `${resultStatusMessage}-${chatMessage}`, - }) - } + telemetry.codeTransform_totalRunTime.emit({ + codeTransformSessionId: CodeTransformTelemetryState.instance.getSessionId(), + codeTransformJobId: transformByQState.getJobId(), + codeTransformResultStatusMessage: resultStatusMessage, + codeTransformRunTimeLatency: durationInMs, + reason: transformByQState.getPolledJobStatus(), + result: + transformByQState.isSucceeded() || transformByQState.isPartiallySucceeded() + ? MetadataResult.Pass + : MetadataResult.Fail, + }) let notificationMessage = '' @@ -739,16 +747,31 @@ export async function postTransformationJob() { }) } - if (transformByQState.getPayloadFilePath() !== '') { - // delete original upload ZIP at very end of transformation - fs.rmSync(transformByQState.getPayloadFilePath(), { recursive: true, force: true }) - } + await cleanupTempJobFiles( + transformByQState.getJobHistoryPath(), + transformByQState.getPolledJobStatus(), + transformByQState.getPayloadFilePath() + ) // attempt download for user // TODO: refactor as explained here https://github.com/aws/aws-toolkit-vscode/pull/6519/files#r1946873107 if (transformByQState.isSucceeded() || transformByQState.isPartiallySucceeded()) { await vscode.commands.executeCommand('aws.amazonq.transformationHub.reviewChanges.startReview') } + + // store job details and diff path locally (history) + // TODO: ideally when job is cancelled, should be stored as CANCELLED instead of FAILED (remove this if statement after bug is fixed) + if (!transformByQState.isCancelled()) { + const latest = sessionJobHistory[transformByQState.getJobId()] + await writeToHistoryFile( + latest.startTime, + latest.projectName, + latest.status, + latest.duration, + transformByQState.getJobId(), + transformByQState.getJobHistoryPath() + ) + } } export async function transformationJobErrorHandler(error: any) { @@ -757,25 +780,9 @@ export async function transformationJobErrorHandler(error: any) { transformByQState.setToFailed() transformByQState.setPolledJobStatus('FAILED') // jobFailureErrorNotification should always be defined here - let displayedErrorMessage = - transformByQState.getJobFailureErrorNotification() ?? CodeWhispererConstants.failedToCompleteJobNotification - if (transformByQState.getJobFailureMetadata() !== '') { - displayedErrorMessage += ` ${transformByQState.getJobFailureMetadata()}` - transformByQState.setJobFailureErrorChatMessage( - `${transformByQState.getJobFailureErrorChatMessage()} ${transformByQState.getJobFailureMetadata()}` - ) - } - void vscode.window - .showErrorMessage(displayedErrorMessage, CodeWhispererConstants.amazonQFeedbackText) - .then((choice) => { - if (choice === CodeWhispererConstants.amazonQFeedbackText) { - void submitFeedback( - placeholder, - CodeWhispererConstants.amazonQFeedbackKey, - getFeedbackCommentData() - ) - } - }) + transformByQState.setJobFailureErrorChatMessage( + transformByQState.getJobFailureErrorChatMessage() ?? CodeWhispererConstants.failedToCompleteJobChatMessage + ) } else { transformByQState.setToCancelled() transformByQState.setPolledJobStatus('CANCELLED') diff --git a/packages/core/src/codewhisperer/index.ts b/packages/core/src/codewhisperer/index.ts index d782b2abefe..ac43fba46aa 100644 --- a/packages/core/src/codewhisperer/index.ts +++ b/packages/core/src/codewhisperer/index.ts @@ -68,6 +68,7 @@ export * from './util/importAdderUtil' export * from './util/zipUtil' export * from './util/diagnosticsUtil' export * from './util/commonUtil' +export * from './util/closingBracketUtil' export * from './util/codewhispererSettings' export * from './service/diagnosticsProvider' export * as diagnosticsProvider from './service/diagnosticsProvider' diff --git a/packages/core/src/codewhisperer/models/constants.ts b/packages/core/src/codewhisperer/models/constants.ts index 319127cba20..f3bbfb07d85 100644 --- a/packages/core/src/codewhisperer/models/constants.ts +++ b/packages/core/src/codewhisperer/models/constants.ts @@ -184,6 +184,9 @@ export const identityPoolID = 'us-east-1:70717e99-906f-4add-908c-bd9074a2f5b9' */ export const inlineCompletionsDebounceDelay = 200 +// add 200ms more delay on top of inline default 30-50ms +export const inlineSuggestionShowDelay = 200 + export const referenceLog = 'Code Reference Log' export const suggestionDetailReferenceText = (licenses: string) => @@ -515,7 +518,7 @@ If you'd like to update and test your code with fewer changes at a time, I can d export const uploadingCodeStepMessage = 'Upload your code' -export const buildCodeStepMessage = 'Build uploaded code in secure build environment' +export const buildCodeStepMessage = 'Analyze uploaded code in secure environment' export const generatePlanStepMessage = 'Generate transformation plan' @@ -544,7 +547,7 @@ export const noChangesMadeMessage = "I didn't make any changes for this transfor export const noOngoingJobMessage = 'No ongoing job.' -export const nothingToShowMessage = 'Nothing to show' +export const noJobHistoryMessage = 'No job history' export const jobStartedNotification = 'Amazon Q is transforming your code. It can take 10 to 30 minutes to upgrade your code, depending on the size of your project. To monitor progress, go to the Transformation Hub.' @@ -579,8 +582,8 @@ export const invalidMetadataFileUnsupportedSourceDB = export const invalidMetadataFileUnsupportedTargetDB = 'I can only convert SQL for migrations to Aurora PostgreSQL or Amazon RDS for PostgreSQL target databases. The provided .sct file indicates another target database for this migration.' -export const invalidCustomVersionsFileMessage = - 'Your .YAML file is not formatted correctly. Make sure that the .YAML file you upload follows the format of the sample file provided.' +export const invalidCustomVersionsFileMessage = (missingKey: string) => + `The dependency upgrade file provided is missing required field \`${missingKey}\`. Check that it is configured properly and try again. For an example of the required dependency upgrade file format, see the [documentation](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/code-transformation.html#dependency-upgrade-file).` export const invalidMetadataFileErrorParsing = "It looks like the .sct file you provided isn't valid. Make sure that you've uploaded the .zip file you retrieved from your schema conversion in AWS DMS." @@ -640,10 +643,17 @@ export const jobCancelledNotification = 'You cancelled the transformation.' export const continueWithoutHilMessage = 'I will continue transforming your code without upgrading this dependency.' -export const continueWithoutYamlMessage = 'Ok, I will continue without this information.' +export const continueWithoutConfigFileMessage = + 'Ok, I will continue the transformation without additional dependency upgrade information.' + +export const receivedValidConfigFileMessage = + 'The dependency upgrade file looks good. I will use this information to upgrade the dependencies you specified.' + +export const chooseConfigFileMessageJdkUpgrade = + 'Would you like to provide a dependency upgrade file? You can specify first party dependencies and their versions in a YAML file, and I will upgrade them during the JDK upgrade transformation. For an example dependency upgrade file, see the [documentation](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/code-transformation.html#dependency-upgrade-file).' -export const chooseYamlMessage = - 'You can optionally upload a YAML file to specify which dependency versions to upgrade to.' +export const chooseConfigFileMessageLibraryUpgrade = + 'Would you like to provide a dependency upgrade file? You can specify third party dependencies and their versions in a YAML file, and I will only upgrade these dependencies during the library upgrade transformation. For an example dependency upgrade file, see the [documentation](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/code-transformation.html#dependency-upgrade-file).' export const enterJavaHomePlaceholder = 'Enter the path to your Java installation' @@ -656,7 +666,7 @@ export const jobCompletedNotification = 'Amazon Q transformed your code. You can review the diff to see my proposed changes and accept or reject them. The transformation summary has details about the changes. ' export const upgradeLibrariesMessage = - 'After successfully building in Java 17 or 21, an additional transformation is required to upgrade your libraries and dependencies. Choose the same source code version and target code version (for example, 17 to 17) to do this.' + 'After successfully transforming to Java 17 or 21, an additional transformation is required to upgrade your libraries and dependencies. Choose the same source code version and target code version (for example, 17 to 17) to do this.' export const jobPartiallyCompletedChatMessage = `I transformed part of your code. You can review the diff to see my proposed changes and accept or reject them. The transformation summary has details about the files I updated and the errors that prevented a complete transformation. ` @@ -720,14 +730,14 @@ export const linkToBillingInfo = 'https://aws.amazon.com/q/developer/pricing/' export const dependencyFolderName = 'transformation_dependencies_temp_' -export const cleanInstallErrorChatMessage = `Sorry, I couldn\'t run the Maven clean install command to build your project. For more information, see the [Amazon Q documentation](${codeTransformTroubleshootMvnFailure}).` +export const cleanTestCompileErrorChatMessage = `I could not run \`mvn clean test-compile\` to build your project. For more information, see the [Amazon Q documentation](${codeTransformTroubleshootMvnFailure}).` -export const cleanInstallErrorNotification = `Amazon Q could not run the Maven clean install command to build your project. For more information, see the [Amazon Q documentation](${codeTransformTroubleshootMvnFailure}).` +export const cleanTestCompileErrorNotification = `Amazon Q could not run \`mvn clean test-compile\` to build your project. For more information, see the [Amazon Q documentation](${codeTransformTroubleshootMvnFailure}).` export const enterJavaHomeChatMessage = 'Enter the path to JDK' export const projectPromptChatMessage = - 'I can upgrade your Java project. To start the transformation, I need some information from you. Choose the project you want to upgrade and the target code version to upgrade to. Then, choose Confirm.\n\nAfter successfully building in Java 17 or 21, an additional transformation is required to upgrade your libraries and dependencies. Choose the same source code version and target code version (for example, 17 to 17) to do this.' + "I can upgrade your Java project. To start the transformation, I need some information from you. Choose the project you want to upgrade and the target code version to upgrade to. Then, choose Confirm.\n\nAfter successfully transforming to Java 17 or 21, an additional transformation is required to upgrade your libraries and dependencies. Choose the same source code version and target code version (for example, 17 to 17) to do this.\n\nI will perform the transformation based on your project's requests, descriptions, and content. To maintain security, avoid including external, unvetted artifacts in your project repository prior to starting the transformation and always validate transformed code for both functionality and security. Do not turn off or close your machine during the transformation because a stable network connection is required." export const windowsJavaHomeHelpChatMessage = 'To find the JDK path, run the following commands in a new terminal: `cd "C:/Program Files/Java"` and then `dir`. If you see your JDK version, run `cd ` and then `cd` to show the path.' @@ -738,10 +748,6 @@ export const macJavaVersionHomeHelpChatMessage = (version: number) => export const linuxJavaHomeHelpChatMessage = 'To find the JDK path, run the following command in a new terminal: `update-java-alternatives --list`' -export const projectSizeTooLargeChatMessage = `Sorry, your project size exceeds the Amazon Q Code Transformation upload limit of 2GB. For more information, see the [Amazon Q documentation](${codeTransformTroubleshootProjectSize}).` - -export const projectSizeTooLargeNotification = `Your project size exceeds the Amazon Q Code Transformation upload limit of 2GB. For more information, see the [Amazon Q documentation](${codeTransformTroubleshootProjectSize}).` - export const JDK8VersionNumber = '52' export const JDK11VersionNumber = '55' @@ -759,7 +765,7 @@ export const chooseProjectSchemaFormMessage = 'To continue, choose the project a export const skipUnitTestsFormTitle = 'Choose to skip unit tests' export const skipUnitTestsFormMessage = - 'I will build your project using `mvn clean test` by default. If you would like me to build your project without running unit tests, I will use `mvn clean test-compile`.' + 'I will build generated code in your local environment, not on the server side. For information on how I scan code to reduce security risks associated with building the code in your local environment, see the [documentation](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/code-transformation.html#java-local-builds).\n\nI will build your project using `mvn clean test` by default. If you would like me to build your project without running unit tests, I will use `mvn clean test-compile`.' export const runUnitTestsMessage = 'Run unit tests' @@ -793,6 +799,34 @@ export const formattedStringMap = new Map([ ['numChangedFiles', 'Files to be changed'], ]) +export const refreshInProgressChatMessage = 'A job refresh is currently in progress. Please wait for it to complete.' + +export const refreshingJobChatMessage = (jobId: string) => + `I am now resuming your job (id: ${jobId}). This can take 10 to 30 minutes to complete.` + +export const jobHistoryButtonText = 'Open job history' + +export const viewHistoryMessage = (numInProgress: number) => + numInProgress > 0 + ? `You have ${numInProgress} job${numInProgress > 1 ? 's' : ''} in progress. You can resume ${numInProgress > 1 ? 'them' : 'it'} in the transformation history table.` + : 'View previous transformations run from the IDE' + +export const transformationHistoryTableDescription = + 'This table lists the most recent jobs that you have run in the past 30 days. To open the diff patch and summary files, click the provided links. To get an updated job status, click the refresh icon. The diff patch and summary will appear once they are available.

' + + 'Jobs with a status of FAILED may still be in progress. Resume these jobs within 12 hours of starting the job to get an updated job status and artifacts.' + +export const refreshErrorChatMessage = + "Sorry, I couldn't refresh the job. Please try again or start a new transformation." + +export const refreshErrorNotification = (jobId: string) => `There was an error refreshing this job. Job Id: ${jobId}` + +export const refreshCompletedChatMessage = + 'Job refresh completed. Please see the transformation history table for the updated status and artifacts.' + +export const refreshCompletedNotification = (jobId: string) => `Job refresh completed. (Job Id: ${jobId})` + +export const refreshNoUpdatesNotification = (jobId: string) => `No updates. (Job Id: ${jobId})` + // end of QCT Strings export enum UserGroup { @@ -835,6 +869,7 @@ export enum CodeAnalysisScope { FILE_AUTO = 'FILE_AUTO', FILE_ON_DEMAND = 'FILE_ON_DEMAND', PROJECT = 'PROJECT', + AGENTIC = 'AGENTIC', } export enum TestGenerationJobStatus { @@ -900,3 +935,9 @@ export const predictionTrackerDefaultConfig = { maxAgeMs: 30000, maxSupplementalContext: 15, } + +export const codeReviewFindingsSuffix = '_codeReviewFindings' +export const displayFindingsSuffix = '_displayFindings' + +export const displayFindingsDetectorName = 'DisplayFindings' +export const findingsSuffix = '_codeReviewFindings' diff --git a/packages/core/src/codewhisperer/models/model.ts b/packages/core/src/codewhisperer/models/model.ts index 279469353fb..bcfa50c6a71 100644 --- a/packages/core/src/codewhisperer/models/model.ts +++ b/packages/core/src/codewhisperer/models/model.ts @@ -18,7 +18,6 @@ import globals from '../../shared/extensionGlobals' import { ChatControllerEventEmitters } from '../../amazonqGumby/chat/controller/controller' import { TransformationSteps } from '../client/codewhispereruserclient' import { Messenger } from '../../amazonqGumby/chat/controller/messenger/messenger' -import { TestChatControllerEventEmitters } from '../../amazonqTest/chat/controller/controller' import { ScanChatControllerEventEmitters } from '../../amazonqScan/controller' import { localize } from '../../shared/utilities/vsCodeUtils' @@ -43,6 +42,8 @@ interface VsCodeState { lastUserModificationTime: number isFreeTierLimitReached: boolean + + lastManualTriggerTime: number } export const vsCodeState: VsCodeState = { @@ -53,6 +54,7 @@ export const vsCodeState: VsCodeState = { isRecommendationsActive: false, lastUserModificationTime: 0, isFreeTierLimitReached: false, + lastManualTriggerTime: 0, } export interface CodeWhispererConfig { @@ -372,55 +374,6 @@ export interface CodeLine { number: number } -/** - * Unit Test Generation - */ -enum TestGenStatus { - NotStarted, - Running, - Cancelling, -} -// TODO: Refactor model of /scan and /test -export class TestGenState { - // Define a constructor for this class - private testGenState: TestGenStatus = TestGenStatus.NotStarted - - protected chatControllers: TestChatControllerEventEmitters | undefined = undefined - - public isNotStarted() { - return this.testGenState === TestGenStatus.NotStarted - } - - public isRunning() { - return this.testGenState === TestGenStatus.Running - } - - public isCancelling() { - return this.testGenState === TestGenStatus.Cancelling - } - - public setToNotStarted() { - this.testGenState = TestGenStatus.NotStarted - } - - public setToCancelling() { - this.testGenState = TestGenStatus.Cancelling - } - - public setToRunning() { - this.testGenState = TestGenStatus.Running - } - - public setChatControllers(controllers: TestChatControllerEventEmitters) { - this.chatControllers = controllers - } - public getChatControllers() { - return this.chatControllers - } -} - -export const testGenState: TestGenState = new TestGenState() - enum CodeFixStatus { NotStarted, Running, @@ -675,16 +628,15 @@ export enum BuildSystem { Unknown = 'Unknown', } -// TO-DO: include the custom YAML file path here somewhere? export class ZipManifest { sourcesRoot: string = 'sources/' dependenciesRoot: string = 'dependencies/' - buildLogs: string = 'build-logs.txt' version: string = '1.0' hilCapabilities: string[] = ['HIL_1pDependency_VersionUpgrade'] - // TO-DO: add 'CLIENT_SIDE_BUILD' here when releasing - transformCapabilities: string[] = ['EXPLAINABILITY_V1', 'SELECTIVE_TRANSFORMATION_V2'] + transformCapabilities: string[] = ['EXPLAINABILITY_V1', 'SELECTIVE_TRANSFORMATION_V2', 'CLIENT_SIDE_BUILD', 'IDE'] noInteractiveMode: boolean = true + dependencyUpgradeConfigFile?: string = undefined + compilationsJsonFile: string = 'compilations.json' customBuildCommand: string = 'clean test' requestedConversions?: { sqlConversion?: { @@ -755,6 +707,8 @@ export class TransformByQState { private targetJDKVersion: JDKVersion | undefined = undefined + private jdkVersionToPath: Map = new Map() + private customBuildCommand: string = '' private sourceDB: DB | undefined = undefined @@ -776,13 +730,14 @@ export class TransformByQState { private planFilePath: string = '' private summaryFilePath: string = '' private preBuildLogFilePath: string = '' + private jobHistoryPath: string = '' private resultArchiveFilePath: string = '' private projectCopyFilePath: string = '' private polledJobStatus: string = '' - private jobFailureMetadata: string = '' + private hasSeenTransforming: boolean = false private payloadFilePath: string = '' @@ -807,6 +762,8 @@ export class TransformByQState { private intervalId: NodeJS.Timeout | undefined = undefined + private refreshInProgress: boolean = false + public isNotStarted() { return this.transformByQState === TransformByQStatus.NotStarted } @@ -831,6 +788,14 @@ export class TransformByQState { return this.transformByQState === TransformByQStatus.PartiallySucceeded } + public isRefreshInProgress() { + return this.refreshInProgress + } + + public getHasSeenTransforming() { + return this.hasSeenTransforming + } + public getTransformationType() { return this.transformationType } @@ -871,6 +836,14 @@ export class TransformByQState { return this.targetJDKVersion } + public getPathFromJdkVersion(version: JDKVersion | undefined) { + if (version) { + return this.jdkVersionToPath.get(version) + } else { + return undefined + } + } + public getSourceDB() { return this.sourceDB } @@ -915,6 +888,10 @@ export class TransformByQState { return this.summaryFilePath } + public getJobHistoryPath() { + return this.jobHistoryPath + } + public getResultArchiveFilePath() { return this.resultArchiveFilePath } @@ -923,10 +900,6 @@ export class TransformByQState { return this.projectCopyFilePath } - public getJobFailureMetadata() { - return this.jobFailureMetadata - } - public getPayloadFilePath() { return this.payloadFilePath } @@ -955,6 +928,12 @@ export class TransformByQState { return this.targetJavaHome } + public setJdkVersionToPath(jdkVersion: JDKVersion | undefined, path: string) { + if (jdkVersion) { + this.jdkVersionToPath.set(jdkVersion, path) + } + } + public getChatControllers() { return this.chatControllers } @@ -1007,6 +986,14 @@ export class TransformByQState { this.transformByQState = TransformByQStatus.PartiallySucceeded } + public setRefreshInProgress(inProgress: boolean) { + this.refreshInProgress = inProgress + } + + public setHasSeenTransforming(hasSeen: boolean) { + this.hasSeenTransforming = hasSeen + } + public setTransformationType(type: TransformationType) { this.transformationType = type } @@ -1083,6 +1070,10 @@ export class TransformByQState { this.summaryFilePath = filePath } + public setJobHistoryPath(filePath: string) { + this.jobHistoryPath = filePath + } + public setResultArchiveFilePath(filePath: string) { this.resultArchiveFilePath = filePath } @@ -1091,10 +1082,6 @@ export class TransformByQState { this.projectCopyFilePath = filePath } - public setJobFailureMetadata(data: string) { - this.jobFailureMetadata = data - } - public setPayloadFilePath(payloadFilePath: string) { this.payloadFilePath = payloadFilePath } @@ -1153,9 +1140,10 @@ export class TransformByQState { public setJobDefaults() { this.setToNotStarted() + this.refreshInProgress = false + this.hasSeenTransforming = false this.jobFailureErrorNotification = undefined this.jobFailureErrorChatMessage = undefined - this.jobFailureMetadata = '' this.payloadFilePath = '' this.metadataPathSQL = '' this.customVersionPath = '' @@ -1169,6 +1157,7 @@ export class TransformByQState { this.buildLog = '' this.customBuildCommand = '' this.intervalId = undefined + this.jobHistoryPath = '' } } diff --git a/packages/core/src/codewhisperer/region/regionProfileManager.ts b/packages/core/src/codewhisperer/region/regionProfileManager.ts index ce33bfd925d..24d58d7f588 100644 --- a/packages/core/src/codewhisperer/region/regionProfileManager.ts +++ b/packages/core/src/codewhisperer/region/regionProfileManager.ts @@ -69,7 +69,7 @@ export class RegionProfileManager { constructor(private readonly profileProvider: () => Promise) { super( 'aws.amazonq.regionProfiles.cache', - 60000, + 3600000, { resource: { locked: false, @@ -77,7 +77,7 @@ export class RegionProfileManager { result: undefined, }, }, - { timeout: 15000, interval: 1500, truthy: true } + { timeout: 15000, interval: 500, truthy: true } ) } @@ -287,38 +287,6 @@ export class RegionProfileManager { } await this.switchRegionProfile(previousSelected, 'reload') - - // cross-validation - // jitter of 0 ~ 5 second - const jitterInSec = Math.floor(Math.random() * 6) - const jitterInMs = jitterInSec * 1000 - setTimeout(async () => { - this.getProfiles() - .then(async (profiles) => { - const r = profiles.find((it) => it.arn === previousSelected.arn) - if (!r) { - telemetry.amazonq_profileState.emit({ - source: 'reload', - amazonQProfileRegion: 'not-set', - reason: 'profile could not be selected', - result: 'Failed', - }) - - await this.invalidateProfile(previousSelected.arn) - RegionProfileManager.logger.warn( - `invlaidating ${previousSelected.name} profile, arn=${previousSelected.arn}` - ) - } - }) - .catch((e) => { - telemetry.amazonq_profileState.emit({ - source: 'reload', - amazonQProfileRegion: 'not-set', - reason: (e as Error).message, - result: 'Failed', - }) - }) - }, jitterInMs) } private loadPersistedRegionProfle(): { [label: string]: RegionProfile } { diff --git a/packages/core/src/codewhisperer/service/diagnosticsProvider.ts b/packages/core/src/codewhisperer/service/diagnosticsProvider.ts index 72407cd80f5..b7a950bba5c 100644 --- a/packages/core/src/codewhisperer/service/diagnosticsProvider.ts +++ b/packages/core/src/codewhisperer/service/diagnosticsProvider.ts @@ -25,10 +25,14 @@ export const securityScanRender: SecurityScanRender = { export function initSecurityScanRender( securityRecommendationList: AggregatedCodeScanIssue[], - context: vscode.ExtensionContext, editor: vscode.TextEditor | undefined, - scope: CodeAnalysisScope + scope: CodeAnalysisScope, + fromQCA: boolean = true ) { + // fromQCA parameter is used to determine if the findings are coming from QCA or from displayFindings tool. + // if the incoming findings are from QCA review, then keep only existing findings from displayFindings + // if the incoming findings are not from QCA review, then keep only the existing QCA findings + securityScanRender.securityDiagnosticCollection = createSecurityDiagnosticCollection() securityScanRender.initialized = false if (scope === CodeAnalysisScope.FILE_ON_DEMAND && editor) { securityScanRender.securityDiagnosticCollection?.delete(editor.document.uri) @@ -37,22 +41,20 @@ export function initSecurityScanRender( } for (const securityRecommendation of securityRecommendationList) { updateSecurityDiagnosticCollection(securityRecommendation) - updateSecurityIssuesForProviders(securityRecommendation, scope === CodeAnalysisScope.FILE_AUTO) + updateSecurityIssuesForProviders(securityRecommendation, scope === CodeAnalysisScope.FILE_AUTO, fromQCA) } securityScanRender.initialized = true } -function updateSecurityIssuesForProviders(securityRecommendation: AggregatedCodeScanIssue, isAutoScope?: boolean) { +function updateSecurityIssuesForProviders( + securityRecommendation: AggregatedCodeScanIssue, + isAutoScope?: boolean, + fromQCA: boolean = true +) { if (isAutoScope) { SecurityIssueProvider.instance.mergeIssues(securityRecommendation) } else { - const updatedSecurityRecommendationList = [ - ...SecurityIssueProvider.instance.issues.filter( - (group) => group.filePath !== securityRecommendation.filePath - ), - securityRecommendation, - ] - SecurityIssueProvider.instance.issues = updatedSecurityRecommendationList + SecurityIssueProvider.instance.mergeIssuesDisplayFindings(securityRecommendation, fromQCA) } SecurityIssueTreeViewProvider.instance.refresh() } diff --git a/packages/core/src/codewhisperer/service/securityIssueCodeActionProvider.ts b/packages/core/src/codewhisperer/service/securityIssueCodeActionProvider.ts index f1d01494d54..4dc7bceebe7 100644 --- a/packages/core/src/codewhisperer/service/securityIssueCodeActionProvider.ts +++ b/packages/core/src/codewhisperer/service/securityIssueCodeActionProvider.ts @@ -66,7 +66,7 @@ export class SecurityIssueCodeActionProvider implements vscode.CodeActionProvide `Amazon Q: Explain "${issue.title}"`, vscode.CodeActionKind.QuickFix ) - const explainWithQArgs = [issue] + const explainWithQArgs = [issue, group.filePath] explainWithQ.command = { title: 'Explain with Amazon Q', command: 'aws.amazonq.explainIssue', diff --git a/packages/core/src/codewhisperer/service/securityIssueHoverProvider.ts b/packages/core/src/codewhisperer/service/securityIssueHoverProvider.ts index b82c10063e6..bb9fe2cafa4 100644 --- a/packages/core/src/codewhisperer/service/securityIssueHoverProvider.ts +++ b/packages/core/src/codewhisperer/service/securityIssueHoverProvider.ts @@ -10,7 +10,6 @@ import path from 'path' import { AuthUtil } from '../util/authUtil' import { TelemetryHelper } from '../util/telemetryHelper' import { SecurityIssueProvider } from './securityIssueProvider' -import { amazonqCodeIssueDetailsTabTitle } from '../models/constants' export class SecurityIssueHoverProvider implements vscode.HoverProvider { static #instance: SecurityIssueHoverProvider @@ -79,23 +78,23 @@ export class SecurityIssueHoverProvider implements vscode.HoverProvider { `${suggestedFix?.code && suggestedFix.description !== '' ? suggestedFix.description : issue.recommendation.text}\n\n` ) - const viewDetailsCommand = this._getCommandMarkdown( - 'aws.amazonq.openSecurityIssuePanel', - [issue, filePath], - 'eye', - 'View Details', - `Open "${amazonqCodeIssueDetailsTabTitle}"` - ) - markdownString.appendMarkdown(viewDetailsCommand) - const explainWithQCommand = this._getCommandMarkdown( 'aws.amazonq.explainIssue', - [issue], + [issue, filePath], 'comment', 'Explain', 'Explain with Amazon Q' ) - markdownString.appendMarkdown(' | ' + explainWithQCommand) + markdownString.appendMarkdown(explainWithQCommand) + + const generateFixCommand = this._getCommandMarkdown( + 'aws.amazonq.generateFix', + [issue, filePath], + 'wrench', + 'Fix', + 'Fix with Amazon Q' + ) + markdownString.appendMarkdown(' | ' + generateFixCommand) const ignoreIssueCommand = this._getCommandMarkdown( 'aws.amazonq.security.ignore', @@ -115,22 +114,6 @@ export class SecurityIssueHoverProvider implements vscode.HoverProvider { ) markdownString.appendMarkdown(' | ' + ignoreSimilarIssuesCommand) - if (suggestedFix && suggestedFix.code) { - const applyFixCommand = this._getCommandMarkdown( - 'aws.amazonq.applySecurityFix', - [issue, filePath, 'hover'], - 'wrench', - 'Fix', - 'Fix with Amazon Q' - ) - markdownString.appendMarkdown(' | ' + applyFixCommand) - - markdownString.appendMarkdown('### Suggested Fix Preview\n') - markdownString.appendMarkdown( - `${this._makeCodeBlock(suggestedFix.code, issue.detectorId.split('/').shift())}\n` - ) - } - return markdownString } @@ -145,60 +128,4 @@ export class SecurityIssueHoverProvider implements vscode.HoverProvider { } return `![${severity}](severity-${severity.toLowerCase()}.svg)` } - - /** - * Creates a markdown string to render a code diff block for a given code block. Lines - * that are highlighted red indicate deletion while lines highlighted in green indicate - * addition. An optional language can be provided for syntax highlighting on lines which are - * not additions or deletions. - * - * @param code The code containing the diff - * @param language The language for syntax highlighting - * @returns The markdown string - */ - private _makeCodeBlock(code: string, language?: string) { - const lines = code - .replaceAll('\n\\ No newline at end of file', '') - .replaceAll('--- buggyCode\n', '') - .replaceAll('+++ fixCode\n', '') - .split('\n') - const maxLineChars = lines.reduce((acc, curr) => Math.max(acc, curr.length), 0) - const paddedLines = lines.map((line) => line.padEnd(maxLineChars + 2)) - - // Group the lines into sections so consecutive lines of the same type can be placed in - // the same span below - const sections = [paddedLines[0]] - let i = 1 - while (i < paddedLines.length) { - if (paddedLines[i][0] === sections[sections.length - 1][0]) { - sections[sections.length - 1] += '\n' + paddedLines[i] - } else { - sections.push(paddedLines[i]) - } - i++ - } - - // Return each section with the correct syntax highlighting and background color - return sections - .map( - (section) => ` - - -\`\`\`${section.startsWith('-') || section.startsWith('+') ? 'diff' : section.startsWith('@@') ? undefined : language} -${section} -\`\`\` - - -` - ) - .join('
') - } } diff --git a/packages/core/src/codewhisperer/service/securityIssueProvider.ts b/packages/core/src/codewhisperer/service/securityIssueProvider.ts index 61957e6eca5..01f1cd880bd 100644 --- a/packages/core/src/codewhisperer/service/securityIssueProvider.ts +++ b/packages/core/src/codewhisperer/service/securityIssueProvider.ts @@ -5,6 +5,9 @@ import * as vscode from 'vscode' import { AggregatedCodeScanIssue, CodeScanIssue, SuggestedFix } from '../models/model' +import { randomUUID } from '../../shared/crypto' +import { displayFindingsDetectorName } from '../models/constants' + export class SecurityIssueProvider { static #instance: SecurityIssueProvider public static get instance() { @@ -20,6 +23,15 @@ export class SecurityIssueProvider { this._issues = issues } + private _id: string = randomUUID() + public get id() { + return this._id + } + + public set id(id: string) { + this._id = id + } + public handleDocumentChange(event: vscode.TextDocumentChangeEvent) { // handleDocumentChange function may be triggered while testing by our own code generation. if (!event.contentChanges || event.contentChanges.length === 0) { @@ -150,6 +162,30 @@ export class SecurityIssueProvider { ) } + public mergeIssuesDisplayFindings(newIssues: AggregatedCodeScanIssue, fromQCA: boolean) { + const existingGroup = this._issues.find((group) => group.filePath === newIssues.filePath) + if (!existingGroup) { + this._issues.push(newIssues) + return + } + + this._issues = this._issues.map((group) => + group.filePath !== newIssues.filePath + ? group + : { + ...group, + issues: [ + ...group.issues.filter( + // if the incoming findings are from QCA review, then keep only existing findings from displayFindings + // if the incoming findings are not from QCA review, then keep only the existing QCA findings + (issue) => fromQCA === (issue.detectorName === displayFindingsDetectorName) + ), + ...newIssues.issues, + ], + } + ) + } + private isExistingIssue(issue: CodeScanIssue, filePath: string) { return this._issues .find((group) => group.filePath === filePath) diff --git a/packages/core/src/codewhisperer/service/securityIssueTreeViewProvider.ts b/packages/core/src/codewhisperer/service/securityIssueTreeViewProvider.ts index d7c93f70423..b1f7f73907b 100644 --- a/packages/core/src/codewhisperer/service/securityIssueTreeViewProvider.ts +++ b/packages/core/src/codewhisperer/service/securityIssueTreeViewProvider.ts @@ -189,11 +189,8 @@ export class IssueItem extends vscode.TreeItem { } private getDescription() { - const positionStr = `[Ln ${this.issue.startLine + 1}, Col 1]` const groupingStrategy = CodeIssueGroupingStrategyState.instance.getState() - return groupingStrategy !== CodeIssueGroupingStrategy.FileLocation - ? `${path.basename(this.filePath)} ${positionStr}` - : positionStr + return groupingStrategy !== CodeIssueGroupingStrategy.FileLocation ? `${path.basename(this.filePath)}` : '' } private getContextValue() { diff --git a/packages/core/src/codewhisperer/service/securityScanHandler.ts b/packages/core/src/codewhisperer/service/securityScanHandler.ts index b83fdbebb1a..14485642aed 100644 --- a/packages/core/src/codewhisperer/service/securityScanHandler.ts +++ b/packages/core/src/codewhisperer/service/securityScanHandler.ts @@ -35,13 +35,11 @@ import { SecurityScanTimedOutError, UploadArtifactToS3Error, } from '../models/errors' -import { getTelemetryReasonDesc, isAwsError } from '../../shared/errors' +import { getTelemetryReasonDesc } from '../../shared/errors' import { CodeWhispererSettings } from '../util/codewhispererSettings' import { detectCommentAboveLine } from '../../shared/utilities/commentUtils' import { runtimeLanguageContext } from '../util/runtimeLanguageContext' import { FeatureUseCase } from '../models/constants' -import { UploadTestArtifactToS3Error } from '../../amazonqTest/error' -import { ChatSessionManager } from '../../amazonqTest/chat/storages/chatSession' import { AmazonqCreateUpload, Span, telemetry } from '../../shared/telemetry/telemetry' import { AuthUtil } from '../util/authUtil' @@ -432,10 +430,7 @@ export async function uploadArtifactToS3( } else { errorMessage = errorDesc ?? defaultMessage } - if (isAwsError(error) && featureUseCase === FeatureUseCase.TEST_GENERATION) { - ChatSessionManager.Instance.getSession().startTestGenerationRequestId = error.requestId - } - throw isCodeScan ? new UploadArtifactToS3Error(errorMessage) : new UploadTestArtifactToS3Error(errorMessage) + throw new UploadArtifactToS3Error(errorMessage) } finally { getLogger().debug(`Upload to S3 response details: x-amz-request-id: ${requestId}, x-amz-id-2: ${id2}`) if (span) { diff --git a/packages/core/src/codewhisperer/service/testGenHandler.ts b/packages/core/src/codewhisperer/service/testGenHandler.ts deleted file mode 100644 index 5ca8ca665da..00000000000 --- a/packages/core/src/codewhisperer/service/testGenHandler.ts +++ /dev/null @@ -1,326 +0,0 @@ -/*! - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -import { ZipMetadata } from '../util/zipUtil' -import { getLogger } from '../../shared/logger/logger' -import * as CodeWhispererConstants from '../models/constants' -import * as codewhispererClient from '../client/codewhisperer' -import * as codeWhisperer from '../client/codewhisperer' -import CodeWhispererUserClient, { - ArtifactMap, - CreateUploadUrlRequest, - TargetCode, -} from '../client/codewhispereruserclient' -import { - CreateTestJobError, - CreateUploadUrlError, - ExportResultsArchiveError, - InvalidSourceZipError, - TestGenFailedError, - TestGenStoppedError, - TestGenTimedOutError, -} from '../../amazonqTest/error' -import { getMd5, uploadArtifactToS3 } from './securityScanHandler' -import { testGenState, Reference, RegionProfile } from '../models/model' -import { ChatSessionManager } from '../../amazonqTest/chat/storages/chatSession' -import { createCodeWhispererChatStreamingClient } from '../../shared/clients/codewhispererChatClient' -import { downloadExportResultArchive } from '../../shared/utilities/download' -import AdmZip from 'adm-zip' -import path from 'path' -import { ExportIntent } from '@amzn/codewhisperer-streaming' -import { glob } from 'glob' -import { UserWrittenCodeTracker } from '../tracker/userWrittenCodeTracker' -import { randomUUID } from '../../shared/crypto' -import { sleep } from '../../shared/utilities/timeoutUtils' -import { tempDirPath } from '../../shared/filesystemUtilities' -import fs from '../../shared/fs/fs' -import { AuthUtil } from '../util/authUtil' - -// TODO: Get TestFileName and Framework and to error message -export function throwIfCancelled() { - // TODO: fileName will be '' if user gives propt without opening - if (testGenState.isCancelling()) { - throw new TestGenStoppedError() - } -} - -export async function getPresignedUrlAndUploadTestGen(zipMetadata: ZipMetadata, profile: RegionProfile | undefined) { - const logger = getLogger() - if (zipMetadata.zipFilePath === '') { - getLogger().error('Failed to create valid source zip') - throw new InvalidSourceZipError() - } - const srcReq: CreateUploadUrlRequest = { - contentMd5: getMd5(zipMetadata.zipFilePath), - artifactType: 'SourceCode', - uploadIntent: CodeWhispererConstants.testGenUploadIntent, - profileArn: profile?.arn, - } - logger.verbose(`Prepare for uploading src context...`) - const srcResp = await codeWhisperer.codeWhispererClient.createUploadUrl(srcReq).catch((err) => { - getLogger().error(`Failed getting presigned url for uploading src context. Request id: ${err.requestId}`) - throw new CreateUploadUrlError(err.message) - }) - logger.verbose(`CreateUploadUrlRequest requestId: ${srcResp.$response.requestId}`) - logger.verbose(`Complete Getting presigned Url for uploading src context.`) - logger.verbose(`Uploading src context...`) - await uploadArtifactToS3(zipMetadata.zipFilePath, srcResp, CodeWhispererConstants.FeatureUseCase.TEST_GENERATION) - logger.verbose(`Complete uploading src context.`) - const artifactMap: ArtifactMap = { - SourceCode: srcResp.uploadId, - } - return artifactMap -} - -export async function createTestJob( - artifactMap: codewhispererClient.ArtifactMap, - relativeTargetPath: TargetCode[], - userInputPrompt: string, - clientToken?: string, - profile?: RegionProfile -) { - const logger = getLogger() - logger.verbose(`Creating test job and starting startTestGeneration...`) - - // JS will minify this input object - fix that - const targetCodeList = relativeTargetPath.map((targetCode) => ({ - relativeTargetPath: targetCode.relativeTargetPath, - targetLineRangeList: targetCode.targetLineRangeList?.map((range) => ({ - start: { line: range.start.line, character: range.start.character }, - end: { line: range.end.line, character: range.end.character }, - })), - })) - logger.debug('updated target code list: %O', targetCodeList) - const req: CodeWhispererUserClient.StartTestGenerationRequest = { - uploadId: artifactMap.SourceCode, - targetCodeList, - userInput: userInputPrompt, - testGenerationJobGroupName: ChatSessionManager.Instance.getSession().testGenerationJobGroupName ?? randomUUID(), // TODO: remove fallback - clientToken, - profileArn: profile?.arn, - } - logger.debug('Unit test generation request body: %O', req) - logger.debug('target code list: %O', req.targetCodeList[0]) - const firstTargetCodeList = req.targetCodeList?.[0] - const firstTargetLineRangeList = firstTargetCodeList?.targetLineRangeList?.[0] - logger.debug('target line range list: %O', firstTargetLineRangeList) - logger.debug('target line range start: %O', firstTargetLineRangeList?.start) - logger.debug('target line range end: %O', firstTargetLineRangeList?.end) - - const resp = await codewhispererClient.codeWhispererClient.startTestGeneration(req).catch((err) => { - ChatSessionManager.Instance.getSession().startTestGenerationRequestId = err.requestId - logger.error(`Failed creating test job. Request id: ${err.requestId}`) - throw new CreateTestJobError(err.message) - }) - logger.info('Unit test generation request id: %s', resp.$response.requestId) - logger.debug('Unit test generation data: %O', resp.$response.data) - ChatSessionManager.Instance.getSession().startTestGenerationRequestId = resp.$response.requestId - if (resp.$response.error) { - logger.error('Unit test generation error: %O', resp.$response.error) - } - if (resp.testGenerationJob) { - ChatSessionManager.Instance.getSession().listOfTestGenerationJobId.push( - resp.testGenerationJob?.testGenerationJobId - ) - ChatSessionManager.Instance.getSession().testGenerationJobGroupName = - resp.testGenerationJob?.testGenerationJobGroupName - } - return resp -} - -export async function pollTestJobStatus( - jobId: string, - jobGroupName: string, - filePath: string, - initialExecution: boolean, - profile?: RegionProfile -) { - const session = ChatSessionManager.Instance.getSession() - const pollingStartTime = performance.now() - // We don't expect to get results immediately, so sleep for some time initially to not make unnecessary calls - await sleep(CodeWhispererConstants.testGenPollingDelaySeconds) - - const logger = getLogger() - logger.verbose(`Polling testgen job status...`) - let status = CodeWhispererConstants.TestGenerationJobStatus.IN_PROGRESS - while (true) { - throwIfCancelled() - const req: CodeWhispererUserClient.GetTestGenerationRequest = { - testGenerationJobId: jobId, - testGenerationJobGroupName: jobGroupName, - profileArn: profile?.arn, - } - const resp = await codewhispererClient.codeWhispererClient.getTestGeneration(req) - logger.verbose('pollTestJobStatus request id: %s', resp.$response.requestId) - logger.debug('pollTestJobStatus testGenerationJob %O', resp.testGenerationJob) - ChatSessionManager.Instance.getSession().testGenerationJob = resp.testGenerationJob - const progressRate = resp.testGenerationJob?.progressRate ?? 0 - testGenState.getChatControllers()?.sendUpdatePromptProgress.fire({ - tabID: ChatSessionManager.Instance.getSession().tabID, - status: 'InProgress', - progressRate, - }) - const jobSummary = resp.testGenerationJob?.jobSummary ?? '' - const jobSummaryNoBackticks = jobSummary.replace(/^`+|`+$/g, '') - ChatSessionManager.Instance.getSession().jobSummary = jobSummaryNoBackticks - const packageInfoList = resp.testGenerationJob?.packageInfoList ?? [] - const packageInfo = packageInfoList[0] - const targetFileInfo = packageInfo?.targetFileInfoList?.[0] - - if (packageInfo) { - // TODO: will need some fields from packageInfo such as buildCommand, packagePlan, packageSummary - } - if (targetFileInfo) { - if (targetFileInfo.numberOfTestMethods) { - session.numberOfTestsGenerated = Number(targetFileInfo.numberOfTestMethods) - } - if (targetFileInfo.codeReferences) { - session.references = targetFileInfo.codeReferences as Reference[] - } - if (initialExecution) { - session.generatedFilePath = targetFileInfo.testFilePath ?? '' - const currentPlanSummary = session.targetFileInfo?.filePlan - const newPlanSummary = targetFileInfo?.filePlan - - if (currentPlanSummary !== newPlanSummary && newPlanSummary) { - const chatControllers = testGenState.getChatControllers() - if (chatControllers) { - const currentSession = ChatSessionManager.Instance.getSession() - chatControllers.updateTargetFileInfo.fire({ - tabID: currentSession.tabID, - targetFileInfo, - testGenerationJobGroupName: resp.testGenerationJob?.testGenerationJobGroupName, - testGenerationJobId: resp.testGenerationJob?.testGenerationJobId, - filePath, - }) - } - } - } - } - ChatSessionManager.Instance.getSession().targetFileInfo = targetFileInfo - status = resp.testGenerationJob?.status as CodeWhispererConstants.TestGenerationJobStatus - if (status === CodeWhispererConstants.TestGenerationJobStatus.FAILED) { - session.numberOfTestsGenerated = 0 - logger.verbose(`Test generation failed.`) - if (resp.testGenerationJob?.jobStatusReason) { - session.stopIteration = true - throw new TestGenFailedError(resp.testGenerationJob?.jobStatusReason) - } else { - throw new TestGenFailedError() - } - } else if (status === CodeWhispererConstants.TestGenerationJobStatus.COMPLETED) { - logger.verbose(`testgen job status: ${status}`) - logger.verbose(`Complete polling test job status.`) - break - } - throwIfCancelled() - await sleep(CodeWhispererConstants.testGenJobPollingIntervalMilliseconds) - const elapsedTime = performance.now() - pollingStartTime - if (elapsedTime > CodeWhispererConstants.testGenJobTimeoutMilliseconds) { - logger.verbose(`testgen job status: ${status}`) - logger.verbose(`testgen job failed. Amazon Q timed out.`) - throw new TestGenTimedOutError() - } - } - return status -} - -/** - * Download the zip from exportResultsArchieve API and store in temp zip - */ -export async function exportResultsArchive( - uploadId: string, - groupName: string, - jobId: string, - projectName: string, - projectPath: string, - initialExecution: boolean -) { - // TODO: Make a common Temp folder - const pathToArchiveDir = path.join(tempDirPath, 'q-testgen') - - const archivePathExists = await fs.existsDir(pathToArchiveDir) - if (archivePathExists) { - await fs.delete(pathToArchiveDir, { recursive: true }) - } - await fs.mkdir(pathToArchiveDir) - - let downloadErrorMessage = undefined - - const session = ChatSessionManager.Instance.getSession() - try { - const pathToArchive = path.join(pathToArchiveDir, 'QTestGeneration.zip') - // Download and deserialize the zip - await downloadResultArchive(uploadId, groupName, jobId, pathToArchive) - const zip = new AdmZip(pathToArchive) - zip.extractAllTo(pathToArchiveDir, true) - - const testFilePathFromResponse = session?.targetFileInfo?.testFilePath - const testFilePath = testFilePathFromResponse - ? testFilePathFromResponse.split('/').slice(1).join('/') // remove the project name - : await getTestFilePathFromZip(pathToArchiveDir) - if (initialExecution) { - testGenState.getChatControllers()?.showCodeGenerationResults.fire({ - tabID: session.tabID, - filePath: testFilePath, - projectName, - }) - - // If User accepts the diff - testGenState.getChatControllers()?.sendUpdatePromptProgress.fire({ - tabID: ChatSessionManager.Instance.getSession().tabID, - status: 'Completed', - }) - } - } catch (e) { - session.numberOfTestsGenerated = 0 - downloadErrorMessage = (e as Error).message - getLogger().error(`Unit Test Generation: ExportResultArchive error = ${downloadErrorMessage}`) - throw new ExportResultsArchiveError(downloadErrorMessage) - } -} - -async function getTestFilePathFromZip(pathToArchiveDir: string) { - const resultArtifactsDir = path.join(pathToArchiveDir, 'resultArtifacts') - const paths = await glob([resultArtifactsDir + '/**/*', '!**/.DS_Store'], { nodir: true }) - const absolutePath = paths[0] - const result = path.relative(resultArtifactsDir, absolutePath) - return result -} - -export async function downloadResultArchive( - uploadId: string, - testGenerationJobGroupName: string, - testGenerationJobId: string, - pathToArchive: string -) { - let downloadErrorMessage = undefined - const cwStreamingClient = await createCodeWhispererChatStreamingClient() - - try { - await downloadExportResultArchive( - cwStreamingClient, - { - exportId: uploadId, - exportIntent: ExportIntent.UNIT_TESTS, - exportContext: { - unitTestGenerationExportContext: { - testGenerationJobGroupName, - testGenerationJobId, - }, - }, - }, - pathToArchive, - AuthUtil.instance.regionProfileManager.activeRegionProfile - ) - } catch (e: any) { - downloadErrorMessage = (e as Error).message - getLogger().error(`Unit Test Generation: ExportResultArchive error = ${downloadErrorMessage}`) - throw new ExportResultsArchiveError(downloadErrorMessage) - } finally { - cwStreamingClient.destroy() - UserWrittenCodeTracker.instance.onQFeatureInvoked() - } -} diff --git a/packages/core/src/codewhisperer/service/transformByQ/humanInTheLoopManager.ts b/packages/core/src/codewhisperer/service/transformByQ/humanInTheLoopManager.ts index 63c1bfe3a2f..1646864e066 100644 --- a/packages/core/src/codewhisperer/service/transformByQ/humanInTheLoopManager.ts +++ b/packages/core/src/codewhisperer/service/transformByQ/humanInTheLoopManager.ts @@ -8,12 +8,19 @@ import path from 'path' import { FolderInfo, transformByQState } from '../../models/model' import fs from '../../../shared/fs/fs' import { createPomCopy, replacePomVersion } from './transformFileHandler' -import { IManifestFile } from '../../../amazonqFeatureDev/models' import { getLogger } from '../../../shared/logger/logger' import { telemetry } from '../../../shared/telemetry/telemetry' import { CodeTransformTelemetryState } from '../../../amazonqGumby/telemetry/codeTransformTelemetryState' import { MetadataResult } from '../../../shared/telemetry/telemetryClient' +export interface IManifestFile { + pomArtifactId: string + pomFolderName: string + hilCapability: string + pomGroupId: string + sourcePomVersion: string +} + /** * @description This class helps encapsulate the "human in the loop" behavior of Amazon Q transform. Users * will be prompted for input during the transformation process. Amazon Q will make some temporary folders diff --git a/packages/core/src/codewhisperer/service/transformByQ/transformApiHandler.ts b/packages/core/src/codewhisperer/service/transformByQ/transformApiHandler.ts index e284207540d..20ef306f7ab 100644 --- a/packages/core/src/codewhisperer/service/transformByQ/transformApiHandler.ts +++ b/packages/core/src/codewhisperer/service/transformByQ/transformApiHandler.ts @@ -40,13 +40,12 @@ import { CodeTransformTelemetryState } from '../../../amazonqGumby/telemetry/cod import { calculateTotalLatency } from '../../../amazonqGumby/telemetry/codeTransformTelemetry' import { MetadataResult } from '../../../shared/telemetry/telemetryClient' import request from '../../../shared/request' -import { JobStoppedError, ZipExceedsSizeLimitError } from '../../../amazonqGumby/errors' +import { JobStoppedError } from '../../../amazonqGumby/errors' import { createLocalBuildUploadZip, extractOriginalProjectSources, writeAndShowBuildLogs } from './transformFileHandler' import { createCodeWhispererChatStreamingClient } from '../../../shared/clients/codewhispererChatClient' import { downloadExportResultArchive } from '../../../shared/utilities/download' import { ExportContext, ExportIntent, TransformationDownloadArtifactType } from '@amzn/codewhisperer-streaming' import fs from '../../../shared/fs/fs' -import { ChatSessionManager } from '../../../amazonqGumby/chat/storages/chatSession' import { encodeHTML } from '../../../shared/utilities/textUtilities' import { convertToTimeString } from '../../../shared/datetime' import { getAuthType } from '../../../auth/utils' @@ -55,7 +54,6 @@ import { setContext } from '../../../shared/vscode/setContext' import { AuthUtil } from '../../util/authUtil' import { DiffModel } from './transformationResultsViewProvider' import { spawnSync } from 'child_process' // eslint-disable-line no-restricted-imports -import { isClientSideBuildEnabled } from '../../../dev/config' export function getSha256(buffer: Buffer) { const hasher = crypto.createHash('sha256') @@ -187,12 +185,13 @@ export async function stopJob(jobId: string) { return } + getLogger().info(`CodeTransformation: Stopping transformation job with ID: ${jobId}`) + try { await codeWhisperer.codeWhispererClient.codeModernizerStopCodeTransformation({ transformationJobId: jobId, }) } catch (e: any) { - transformByQState.setJobFailureMetadata(` (request ID: ${e.requestId ?? 'unavailable'})`) getLogger().error(`CodeTransformation: StopTransformation error = %O`, e) throw new Error('Stop job failed') } @@ -218,7 +217,6 @@ export async function uploadPayload( }) } catch (e: any) { const errorMessage = `Creating the upload URL failed due to: ${(e as Error).message}` - transformByQState.setJobFailureMetadata(` (request ID: ${e.requestId ?? 'unavailable'})`) getLogger().error(`CodeTransformation: CreateUploadUrl error: = %O`, e) throw new Error(errorMessage) } @@ -309,24 +307,20 @@ export function createZipManifest({ hilZipParams }: IZipManifestParams) { interface IZipCodeParams { dependenciesFolder?: FolderInfo - humanInTheLoopFlag?: boolean projectPath?: string zipManifest: ZipManifest | HilZipManifest } interface ZipCodeResult { - dependenciesCopied: boolean tempFilePath: string fileSize: number } export async function zipCode( - { dependenciesFolder, humanInTheLoopFlag, projectPath, zipManifest }: IZipCodeParams, + { dependenciesFolder, projectPath, zipManifest }: IZipCodeParams, zip: AdmZip = new AdmZip() ) { let tempFilePath = undefined - let logFilePath = undefined - let dependenciesCopied = false try { throwIfCancelled() @@ -384,65 +378,48 @@ export async function zipCode( continue } const relativePath = path.relative(dependenciesFolder.path, file) - // const paddedPath = path.join(`dependencies/${dependenciesFolder.name}`, relativePath) - const paddedPath = path.join(`dependencies/`, relativePath) - zip.addLocalFile(file, path.dirname(paddedPath)) + if (relativePath.includes('compilations.json')) { + let fileContents = await nodefs.promises.readFile(file, 'utf-8') + if (os.platform() === 'win32') { + fileContents = fileContents.replace(/\\\\/g, '/') + } + zip.addFile('compilations.json', Buffer.from(fileContents, 'utf-8')) + } else { + zip.addLocalFile(file, path.dirname(relativePath)) + } dependencyFilesSize += (await nodefs.promises.stat(file)).size } getLogger().info(`CodeTransformation: dependency files size = ${dependencyFilesSize}`) - dependenciesCopied = true } - // TO-DO: decide where exactly to put the YAML file / what to name it if (transformByQState.getCustomDependencyVersionFilePath() && zipManifest instanceof ZipManifest) { zip.addLocalFile( transformByQState.getCustomDependencyVersionFilePath(), - 'custom-upgrades', - 'dependency-versions.yaml' + 'sources', + 'dependency_upgrade.yml' ) + zipManifest.dependencyUpgradeConfigFile = 'dependency_upgrade.yml' } zip.addFile('manifest.json', Buffer.from(JSON.stringify(zipManifest)), 'utf-8') throwIfCancelled() - // add text file with logs from mvn clean install and mvn copy-dependencies - logFilePath = await writeAndShowBuildLogs() - // We don't add build-logs.txt file to the manifest if we are - // uploading HIL artifacts - if (!humanInTheLoopFlag) { - zip.addLocalFile(logFilePath) - } - tempFilePath = path.join(os.tmpdir(), 'zipped-code.zip') await fs.writeFile(tempFilePath, zip.toBuffer()) - if (dependenciesFolder && (await fs.exists(dependenciesFolder.path))) { + if (dependenciesFolder?.path) { await fs.delete(dependenciesFolder.path, { recursive: true, force: true }) } } catch (e: any) { getLogger().error(`CodeTransformation: zipCode error = ${e}`) throw Error('Failed to zip project') - } finally { - if (logFilePath) { - await fs.delete(logFilePath) - } } - const zipSize = (await nodefs.promises.stat(tempFilePath)).size + const fileSize = (await nodefs.promises.stat(tempFilePath)).size - const exceedsLimit = zipSize > CodeWhispererConstants.uploadZipSizeLimitInBytes + getLogger().info(`CodeTransformation: created ZIP of size ${fileSize} at ${tempFilePath}`) - getLogger().info(`CodeTransformation: created ZIP of size ${zipSize} at ${tempFilePath}`) - - if (exceedsLimit) { - void vscode.window.showErrorMessage(CodeWhispererConstants.projectSizeTooLargeNotification) - transformByQState.getChatControllers()?.transformationFinished.fire({ - message: CodeWhispererConstants.projectSizeTooLargeChatMessage, - tabID: ChatSessionManager.Instance.getSession().tabID, - }) - throw new ZipExceedsSizeLimitError() - } - return { dependenciesCopied: dependenciesCopied, tempFilePath: tempFilePath, fileSize: zipSize } as ZipCodeResult + return { tempFilePath: tempFilePath, fileSize: fileSize } as ZipCodeResult } export async function startJob(uploadId: string, profile: RegionProfile | undefined) { @@ -465,7 +442,6 @@ export async function startJob(uploadId: string, profile: RegionProfile | undefi return response.transformationJobId } catch (e: any) { const errorMessage = `Starting the job failed due to: ${(e as Error).message}` - transformByQState.setJobFailureMetadata(` (request ID: ${e.requestId ?? 'unavailable'})`) getLogger().error(`CodeTransformation: StartTransformation error = %O`, e) throw new Error(errorMessage) } @@ -652,12 +628,9 @@ export async function getTransformationPlan(jobId: string, profile: RegionProfil return plan } catch (e: any) { const errorMessage = (e as Error).message - transformByQState.setJobFailureMetadata(` (request ID: ${e.requestId ?? 'unavailable'})`) getLogger().error(`CodeTransformation: GetTransformationPlan error = %O`, e) - /* Means API call failed - * If response is defined, means a display/parsing error occurred, so continue transformation - */ + // GetTransformationPlan API call failed, but if response is defined, a display/parsing error occurred, so continue transformation if (response === undefined) { throw new Error(errorMessage) } @@ -672,7 +645,6 @@ export async function getTransformationSteps(jobId: string, profile: RegionProfi }) return response.transformationPlan.transformationSteps.slice(1) // skip step 0 (contains supplemental info) } catch (e: any) { - transformByQState.setJobFailureMetadata(` (request ID: ${e.requestId ?? 'unavailable'})`) getLogger().error(`CodeTransformation: GetTransformationPlan error = %O`, e) throw e } @@ -692,6 +664,9 @@ export async function pollTransformationJob(jobId: string, validStates: string[] if (CodeWhispererConstants.validStatesForBuildSucceeded.includes(status)) { jobPlanProgress['buildCode'] = StepProgress.Succeeded } + if (status === 'TRANSFORMING') { + transformByQState.setHasSeenTransforming(true) + } // emit metric when job status changes if (status !== transformByQState.getPolledJobStatus()) { telemetry.codeTransform_jobStatusChanged.emit({ @@ -728,16 +703,23 @@ export async function pollTransformationJob(jobId: string, validStates: string[] // final plan is complete; show to user isPlanComplete = true } + // for JDK upgrades without a YAML file, we show a static plan so no need to keep refreshing it + if ( + plan && + transformByQState.getSourceJDKVersion() !== transformByQState.getTargetJDKVersion() && + !transformByQState.getCustomDependencyVersionFilePath() + ) { + isPlanComplete = true + } } if (validStates.includes(status)) { break } - // TO-DO: remove isClientSideBuildEnabled when releasing CSB + // TO-DO: later, handle case where PlannerAgent needs to run mvn dependency:tree during PLANNING stage; not needed for now if ( - isClientSideBuildEnabled && - status === 'TRANSFORMING' && + transformByQState.getHasSeenTransforming() && transformByQState.getTransformationType() === TransformationType.LANGUAGE_UPGRADE ) { // client-side build is N/A for SQL conversions @@ -762,7 +744,6 @@ export async function pollTransformationJob(jobId: string, validStates: string[] await sleep(CodeWhispererConstants.transformationJobPollingIntervalSeconds * 1000) } catch (e: any) { getLogger().error(`CodeTransformation: GetTransformation error = %O`, e) - transformByQState.setJobFailureMetadata(` (request ID: ${e.requestId ?? 'unavailable'})`) throw e } } @@ -844,17 +825,24 @@ async function processClientInstructions(jobId: string, clientInstructionsPath: const destinationPath = path.join(os.tmpdir(), `originalCopy_${jobId}_${artifactId}`) await extractOriginalProjectSources(destinationPath) getLogger().info(`CodeTransformation: copied project to ${destinationPath}`) - const diffModel = new DiffModel() - diffModel.parseDiff(clientInstructionsPath, path.join(destinationPath, 'sources'), true) - // show user the diff.patch - const doc = await vscode.workspace.openTextDocument(clientInstructionsPath) - await vscode.window.showTextDocument(doc, { viewColumn: vscode.ViewColumn.One }) + const diffContents = await fs.readFileText(clientInstructionsPath) + if (diffContents.trim()) { + const diffModel = new DiffModel() + diffModel.parseDiff(clientInstructionsPath, path.join(destinationPath, 'sources'), true) + // show user the diff.patch + const doc = await vscode.workspace.openTextDocument(clientInstructionsPath) + await vscode.window.showTextDocument(doc, { viewColumn: vscode.ViewColumn.One }) + } else { + // still need to set the project copy so that we can use it below + transformByQState.setProjectCopyFilePath(path.join(destinationPath, 'sources')) + getLogger().info(`CodeTransformation: diff.patch is empty`) + } await runClientSideBuild(transformByQState.getProjectCopyFilePath(), artifactId) } -export async function runClientSideBuild(projectCopyPath: string, clientInstructionArtifactId: string) { +export async function runClientSideBuild(projectCopyDir: string, clientInstructionArtifactId: string) { const baseCommand = transformByQState.getMavenName() - const args = [] + const args = ['clean'] if (transformByQState.getCustomBuildCommand() === CodeWhispererConstants.skipUnitTestsBuildCommand) { args.push('test-compile') } else { @@ -864,22 +852,22 @@ export async function runClientSideBuild(projectCopyPath: string, clientInstruct const argString = args.join(' ') const spawnResult = spawnSync(baseCommand, args, { - cwd: projectCopyPath, + cwd: projectCopyDir, shell: true, encoding: 'utf-8', env: environment, }) - const buildLogs = `Intermediate build result from running ${baseCommand} ${argString}:\n\n${spawnResult.stdout}` + const buildLogs = `Intermediate build result from running mvn ${argString}:\n\n${spawnResult.stdout}` transformByQState.clearBuildLog() transformByQState.appendToBuildLog(buildLogs) await writeAndShowBuildLogs() - const uploadZipBaseDir = path.join( + const uploadZipDir = path.join( os.tmpdir(), `clientInstructionsResult_${transformByQState.getJobId()}_${clientInstructionArtifactId}` ) - const uploadZipPath = await createLocalBuildUploadZip(uploadZipBaseDir, spawnResult.status, spawnResult.stdout) + const uploadZipPath = await createLocalBuildUploadZip(uploadZipDir, spawnResult.status, spawnResult.stdout) // upload build results const uploadContext: UploadContext = { @@ -892,10 +880,33 @@ export async function runClientSideBuild(projectCopyPath: string, clientInstruct try { await uploadPayload(uploadZipPath, AuthUtil.instance.regionProfileManager.activeRegionProfile, uploadContext) await resumeTransformationJob(transformByQState.getJobId(), 'COMPLETED') + } catch (err: any) { + getLogger().error(`CodeTransformation: upload client build results / resumeTransformation error = %O`, err) + transformByQState.setJobFailureErrorChatMessage( + `${CodeWhispererConstants.failedToCompleteJobGenericChatMessage} ${err.message}` + ) + transformByQState.setJobFailureErrorNotification( + `${CodeWhispererConstants.failedToCompleteJobGenericNotification} ${err.message}` + ) + // in case server-side execution times out, still call resumeTransformationJob + if (err.message.includes('find a step in desired state:AWAITING_CLIENT_ACTION')) { + getLogger().info('CodeTransformation: resuming job after server-side execution timeout') + await resumeTransformationJob(transformByQState.getJobId(), 'COMPLETED') + } else { + throw err + } } finally { - await fs.delete(projectCopyPath, { recursive: true }) - await fs.delete(uploadZipBaseDir, { recursive: true }) - getLogger().info(`CodeTransformation: Just deleted project copy and uploadZipBaseDir after client-side build`) + await fs.delete(projectCopyDir, { recursive: true }) + await fs.delete(uploadZipDir, { recursive: true }) + await fs.delete(uploadZipPath, { force: true }) + const exportZipDir = path.join( + os.tmpdir(), + `downloadClientInstructions_${transformByQState.getJobId()}_${clientInstructionArtifactId}` + ) + await fs.delete(exportZipDir, { recursive: true }) + getLogger().info( + `CodeTransformation: deleted projectCopy, clientInstructionsResult, and downloadClientInstructions directories/files` + ) } } diff --git a/packages/core/src/codewhisperer/service/transformByQ/transformFileHandler.ts b/packages/core/src/codewhisperer/service/transformByQ/transformFileHandler.ts index fd74ca7b147..400acd5fa7a 100644 --- a/packages/core/src/codewhisperer/service/transformByQ/transformFileHandler.ts +++ b/packages/core/src/codewhisperer/service/transformByQ/transformFileHandler.ts @@ -9,18 +9,21 @@ import * as os from 'os' import xml2js = require('xml2js') import * as CodeWhispererConstants from '../../models/constants' import { existsSync, readFileSync, writeFileSync } from 'fs' // eslint-disable-line no-restricted-imports -import { BuildSystem, DB, FolderInfo, TransformationType, transformByQState } from '../../models/model' -import { IManifestFile } from '../../../amazonqFeatureDev/models' +import { BuildSystem, DB, FolderInfo, transformByQState } from '../../models/model' import fs from '../../../shared/fs/fs' import globals from '../../../shared/extensionGlobals' import { ChatSessionManager } from '../../../amazonqGumby/chat/storages/chatSession' import { AbsolutePathDetectedError } from '../../../amazonqGumby/errors' import { getLogger } from '../../../shared/logger/logger' import AdmZip from 'adm-zip' +import { IManifestFile } from './humanInTheLoopManager' +import { ExportResultArchiveStructure } from '../../../shared/utilities/download' +import { isFileNotFoundError } from '../../../shared/errors' -export function getDependenciesFolderInfo(): FolderInfo { +export async function getDependenciesFolderInfo(): Promise { const dependencyFolderName = `${CodeWhispererConstants.dependencyFolderName}${globals.clock.Date.now()}` const dependencyFolderPath = path.join(os.tmpdir(), dependencyFolderName) + await fs.mkdir(dependencyFolderPath) return { name: dependencyFolderName, path: dependencyFolderPath, @@ -31,15 +34,12 @@ export async function writeAndShowBuildLogs(isLocalInstall: boolean = false) { const logFilePath = path.join(os.tmpdir(), 'build-logs.txt') writeFileSync(logFilePath, transformByQState.getBuildLog()) const doc = await vscode.workspace.openTextDocument(logFilePath) - if ( - !transformByQState.getBuildLog().includes('clean install succeeded') && - transformByQState.getTransformationType() !== TransformationType.SQL_CONVERSION - ) { + const logs = transformByQState.getBuildLog().toLowerCase() + if (logs.includes('intermediate build result') || logs.includes('maven jar failed')) { // only show the log if the build failed; show it in second column for intermediate builds only const options = isLocalInstall ? undefined : { viewColumn: vscode.ViewColumn.Two } await vscode.window.showTextDocument(doc, options) } - return logFilePath } export async function createLocalBuildUploadZip(baseDir: string, exitCode: number | null, stdout: string) { @@ -119,15 +119,16 @@ export async function parseBuildFile() { return undefined } +// return the first missing key in the custom versions file, or undefined if all required keys are present export async function validateCustomVersionsFile(fileContents: string) { - const requiredKeys = ['dependencyManagement:', 'identifier:', 'targetVersion:'] + const requiredKeys = ['dependencyManagement', 'identifier', 'targetVersion', 'originType'] for (const key of requiredKeys) { if (!fileContents.includes(key)) { getLogger().info(`CodeTransformation: .YAML file is missing required key: ${key}`) - return false + return key } } - return true + return undefined } export async function validateSQLMetadataFile(fileContents: string, message: any) { @@ -174,8 +175,7 @@ export async function validateSQLMetadataFile(fileContents: string, message: any } export function setMaven() { - // for now, just use regular Maven since the Maven executables can - // cause permissions issues when building if user has not ran 'chmod' + // avoid using maven wrapper since we can run into permissions issues transformByQState.setMavenName('mvn') } @@ -214,7 +214,6 @@ export async function getJsonValuesFromManifestFile( return { hilCapability: jsonValues?.hilType, pomFolderName: jsonValues?.pomFolderName, - // TODO remove this forced version sourcePomVersion: jsonValues?.sourcePomVersion || '1.0', pomArtifactId: jsonValues?.pomArtifactId, pomGroupId: jsonValues?.pomGroupId, @@ -351,3 +350,40 @@ export async function parseVersionsListFromPomFile(xmlString: string): Promise { - telemetry.record({ codeTransformSessionId: CodeTransformTelemetryState.instance.getSessionId() }) +function collectDependenciesAndMetadata(dependenciesFolderPath: string, workingDirPath: string) { + getLogger().info('CodeTransformation: running mvn clean test-compile with maven JAR') - // will always be 'mvn' - const baseCommand = transformByQState.getMavenName() - - const args = [`-Dmaven.repo.local=${dependenciesFolder.path}`, 'clean', 'install', '-q'] - - transformByQState.appendToBuildLog(`Running ${baseCommand} ${args.join(' ')}`) - - if (transformByQState.getCustomBuildCommand() === CodeWhispererConstants.skipUnitTestsBuildCommand) { - args.push('-DskipTests') - } - - let environment = process.env - - if (transformByQState.getSourceJavaHome()) { - environment = { ...process.env, JAVA_HOME: transformByQState.getSourceJavaHome() } - } - - const argString = args.join(' ') - const spawnResult = spawnSync(baseCommand, args, { - cwd: modulePath, - shell: true, - encoding: 'utf-8', - env: environment, - maxBuffer: CodeWhispererConstants.maxBufferSize, - }) - - const mavenBuildCommand = transformByQState.getMavenName() - telemetry.record({ codeTransformBuildCommand: mavenBuildCommand as CodeTransformBuildCommand }) - - if (spawnResult.status !== 0) { - let errorLog = '' - errorLog += spawnResult.error ? JSON.stringify(spawnResult.error) : '' - errorLog += `${spawnResult.stderr}\n${spawnResult.stdout}` - transformByQState.appendToBuildLog(`${baseCommand} ${argString} failed: \n ${errorLog}`) - getLogger().error( - `CodeTransformation: Error in running Maven command ${baseCommand} ${argString} = ${errorLog}` - ) - throw new ToolkitError(`Maven ${argString} error`, { code: 'MavenExecutionError' }) - } else { - transformByQState.appendToBuildLog(`mvn clean install succeeded`) - } - }) -} - -function copyProjectDependencies(dependenciesFolder: FolderInfo, modulePath: string) { const baseCommand = transformByQState.getMavenName() + const jarPath = globals.context.asAbsolutePath(path.join('resources', 'amazonQCT', 'QCT-Maven-6-16.jar')) + + getLogger().info('CodeTransformation: running Maven extension with JAR') const args = [ - 'dependency:copy-dependencies', - `-DoutputDirectory=${dependenciesFolder.path}`, - '-Dmdep.useRepositoryLayout=true', - '-Dmdep.copyPom=true', - '-Dmdep.addParentPoms=true', - '-q', + `-Dmaven.ext.class.path=${jarPath}`, + `-Dcom.amazon.aws.developer.transform.jobDirectory=${dependenciesFolderPath}`, + 'clean', + 'test-compile', ] let environment = process.env - if (transformByQState.getSourceJavaHome()) { + if (transformByQState.getSourceJavaHome() !== undefined) { environment = { ...process.env, JAVA_HOME: transformByQState.getSourceJavaHome() } } const spawnResult = spawnSync(baseCommand, args, { - cwd: modulePath, + cwd: workingDirPath, shell: true, encoding: 'utf-8', env: environment, - maxBuffer: CodeWhispererConstants.maxBufferSize, }) + + getLogger().info( + `CodeTransformation: Ran mvn clean test-compile with maven JAR; status code = ${spawnResult.status}}` + ) + if (spawnResult.status !== 0) { let errorLog = '' errorLog += spawnResult.error ? JSON.stringify(spawnResult.error) : '' errorLog += `${spawnResult.stderr}\n${spawnResult.stdout}` - getLogger().info( - `CodeTransformation: Maven command ${baseCommand} ${args} failed, but still continuing with transformation: ${errorLog}` - ) - throw new Error('Maven copy-deps error') + errorLog = errorLog.toLowerCase().replace('elasticgumby', 'QCT') + transformByQState.appendToBuildLog(`mvn clean test-compile with maven JAR failed:\n${errorLog}`) + getLogger().error(`CodeTransformation: Error in running mvn clean test-compile with maven JAR = ${errorLog}`) + throw new Error('mvn clean test-compile with maven JAR failed') } + getLogger().info( + `CodeTransformation: mvn clean test-compile with maven JAR succeeded; dependencies copied to ${dependenciesFolderPath}` + ) } -export async function prepareProjectDependencies(dependenciesFolder: FolderInfo, rootPomPath: string) { +export async function prepareProjectDependencies(dependenciesFolderPath: string, workingDirPath: string) { setMaven() - getLogger().info('CodeTransformation: running Maven copy-dependencies') // pause to give chat time to update await sleep(100) try { - copyProjectDependencies(dependenciesFolder, rootPomPath) - } catch (err) { - // continue in case of errors - getLogger().info( - `CodeTransformation: Maven copy-dependencies failed, but transformation will continue and may succeed` - ) - } - - getLogger().info('CodeTransformation: running Maven install') - try { - installProjectDependencies(dependenciesFolder, rootPomPath) + collectDependenciesAndMetadata(dependenciesFolderPath, workingDirPath) } catch (err) { - void vscode.window.showErrorMessage(CodeWhispererConstants.cleanInstallErrorNotification) + getLogger().error('CodeTransformation: collectDependenciesAndMetadata failed') + void vscode.window.showErrorMessage(CodeWhispererConstants.cleanTestCompileErrorNotification) throw err } - throwIfCancelled() void vscode.window.showInformationMessage(CodeWhispererConstants.buildSucceededNotification) } -export async function getVersionData() { - const baseCommand = transformByQState.getMavenName() - const projectPath = transformByQState.getProjectPath() - const args = ['-v'] - const spawnResult = spawnSync(baseCommand, args, { cwd: projectPath, shell: true, encoding: 'utf-8' }) - - let localMavenVersion: string | undefined = '' - let localJavaVersion: string | undefined = '' - - try { - const localMavenVersionIndex = spawnResult.stdout.indexOf('Apache Maven') - const localMavenVersionString = spawnResult.stdout.slice(localMavenVersionIndex + 13).trim() - localMavenVersion = localMavenVersionString.slice(0, localMavenVersionString.indexOf(' ')).trim() - } catch (e: any) { - localMavenVersion = undefined // if this happens here or below, user most likely has JAVA_HOME incorrectly defined - } - - try { - const localJavaVersionIndex = spawnResult.stdout.indexOf('Java version: ') - const localJavaVersionString = spawnResult.stdout.slice(localJavaVersionIndex + 14).trim() - localJavaVersion = localJavaVersionString.slice(0, localJavaVersionString.indexOf(',')).trim() // will match value of JAVA_HOME - } catch (e: any) { - localJavaVersion = undefined - } - - getLogger().info( - `CodeTransformation: Ran ${baseCommand} to get Maven version = ${localMavenVersion} and Java version = ${localJavaVersion} with project JDK = ${transformByQState.getSourceJDKVersion()}` - ) - return [localMavenVersion, localJavaVersion] -} - export function runMavenDependencyUpdateCommands(dependenciesFolder: FolderInfo) { const baseCommand = transformByQState.getMavenName() diff --git a/packages/core/src/codewhisperer/service/transformByQ/transformationHistoryHandler.ts b/packages/core/src/codewhisperer/service/transformByQ/transformationHistoryHandler.ts new file mode 100644 index 00000000000..1876ac059e4 --- /dev/null +++ b/packages/core/src/codewhisperer/service/transformByQ/transformationHistoryHandler.ts @@ -0,0 +1,389 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' +import fs from '../../../shared/fs/fs' +import path from 'path' +import os from 'os' +import * as CodeWhispererConstants from '../../models/constants' +import { JDKVersion, TransformationType, transformByQState } from '../../models/model' +import { getLogger } from '../../../shared/logger/logger' +import { codeWhispererClient } from '../../../codewhisperer/client/codewhisperer' +import { downloadAndExtractResultArchive, pollTransformationJob } from './transformApiHandler' +import { ChatSessionManager } from '../../../amazonqGumby/chat/storages/chatSession' +import { AuthUtil } from '../../util/authUtil' +import { setMaven } from './transformFileHandler' +import { convertToTimeString, isWithin30Days } from '../../../shared/datetime' +import { copyArtifacts } from './transformFileHandler' + +export interface HistoryObject { + startTime: string + projectName: string + status: string + duration: string + diffPath: string + summaryPath: string + jobId: string +} + +export interface JobMetadata { + jobId: string + projectName: string + transformationType: TransformationType + sourceJDKVersion: JDKVersion + targetJDKVersion: JDKVersion + customDependencyVersionFilePath: string + customBuildCommand: string + targetJavaHome: string + projectPath: string + startTime: string +} + +/** + * Reads 'transformation_history.tsv' (history) file + * + * @returns history array of 10 most recent jobs from within past 30 days + */ +export async function readHistoryFile(): Promise { + const history: HistoryObject[] = [] + const jobHistoryFilePath = path.join(os.homedir(), '.aws', 'transform', 'transformation_history.tsv') + + if (!(await fs.existsFile(jobHistoryFilePath))) { + return history + } + + const historyFile = await fs.readFileText(jobHistoryFilePath) + const jobs = historyFile.split('\n') + jobs.shift() // removes headers + + // Process from end, stop at 10 valid entries + for (let i = jobs.length - 1; i >= 0 && history.length < 10; i--) { + const job = jobs[i] + if (job && isWithin30Days(job.split('\t')[0])) { + const jobInfo = job.split('\t') + history.push({ + startTime: jobInfo[0], + projectName: jobInfo[1], + status: jobInfo[2], + duration: jobInfo[3], + diffPath: jobInfo[4], + summaryPath: jobInfo[5], + jobId: jobInfo[6], + }) + } + } + return history +} + +/** + * Creates temporary metadata JSON file with transformation config info and saves a copy of upload zip + * + * These files are used when a job is resumed after interruption + * + * @param payloadFilePath path to upload zip + * @param metadata + * @returns + */ +export async function createMetadataFile(payloadFilePath: string, metadata: JobMetadata): Promise { + const jobHistoryPath = path.join(os.homedir(), '.aws', 'transform', metadata.projectName, metadata.jobId) + + // create job history folders + await fs.mkdir(jobHistoryPath) + + // save a copy of the upload zip + try { + await fs.copy(payloadFilePath, path.join(jobHistoryPath, 'zipped-code.zip')) + } catch (error) { + getLogger().error('Code Transformation: error saving copy of upload zip: %s', (error as Error).message) + } + + // create metadata file with transformation config info + try { + await fs.writeFile(path.join(jobHistoryPath, 'metadata.json'), JSON.stringify(metadata)) + } catch (error) { + getLogger().error('Code Transformation: error creating metadata file: %s', (error as Error).message) + } + + return jobHistoryPath +} + +/** + * Writes job details to history file + * + * @param startTime job start timestamp (ex. "01/01/23, 12:00 AM") + * @param projectName + * @param status + * @param duration job duration in hr / min / sec format (ex. "1 hr 15 min") + * @param jobId + * @param jobHistoryPath path to where job's history details are stored (ex. "~/.aws/transform/proj_name/job_id") + */ +export async function writeToHistoryFile( + startTime: string, + projectName: string, + status: string, + duration: string, + jobId: string, + jobHistoryPath: string +) { + const historyLogFilePath = path.join(os.homedir(), '.aws', 'transform', 'transformation_history.tsv') + // create transform folder if necessary + if (!(await fs.existsFile(historyLogFilePath))) { + await fs.mkdir(path.dirname(historyLogFilePath)) + // create headers of new transformation history file + await fs.writeFile(historyLogFilePath, 'date\tproject_name\tstatus\tduration\tdiff_patch\tsummary\tjob_id\n') + } + const artifactsExist = status === 'COMPLETED' || status === 'PARTIALLY_COMPLETED' + const fields = [ + startTime, + projectName, + status, + duration, + artifactsExist ? path.join(jobHistoryPath, 'diff.patch') : '', + artifactsExist ? path.join(jobHistoryPath, 'summary', 'summary.md') : '', + jobId, + ] + + const jobDetails = fields.join('\t') + '\n' + await fs.appendFile(historyLogFilePath, jobDetails) + + // update Transformation Hub table + await vscode.commands.executeCommand('aws.amazonq.transformationHub.updateContent', 'job history', undefined, true) +} + +/** + * Delete temporary files at the end of a transformation + * + * @param jobHistoryPath path to history directory for this job + * @param jobStatus final transformation status + * @param payloadFilePath path to original upload zip; providing this param will also delete any temp build logs + */ +export async function cleanupTempJobFiles(jobHistoryPath: string, jobStatus: string, payloadFilePath?: string) { + if (payloadFilePath) { + // delete original upload ZIP + await fs.delete(payloadFilePath, { force: true }) + // delete temporary build logs file + const logFilePath = path.join(os.tmpdir(), 'build-logs.txt') + await fs.delete(logFilePath, { force: true }) + } + + // delete metadata file and upload zip copy if no longer need them (i.e. will not be resuming) + if (jobStatus !== 'FAILED') { + await fs.delete(path.join(jobHistoryPath, 'metadata.json'), { force: true }) + await fs.delete(path.join(jobHistoryPath, 'zipped-code.zip'), { force: true }) + } +} + +/* Job refresh-related functions */ + +export async function refreshJob(jobId: string, currentStatus: string, projectName: string) { + // fetch status from server + let status = '' + let duration = '' + if (currentStatus === 'COMPLETED' || currentStatus === 'PARTIALLY_COMPLETED') { + // job is already completed, no need to fetch status + status = currentStatus + } else { + try { + const response = await codeWhispererClient.codeModernizerGetCodeTransformation({ + transformationJobId: jobId, + profileArn: undefined, + }) + status = response.transformationJob.status ?? currentStatus + if (response.transformationJob.endExecutionTime && response.transformationJob.creationTime) { + duration = convertToTimeString( + response.transformationJob.endExecutionTime.getTime() - + response.transformationJob.creationTime.getTime() + ) + } + + getLogger().debug( + 'Code Transformation: Job refresh - Fetched status for job id: %s\n{Status: %s; Duration: %s}', + jobId, + status, + duration + ) + } catch (error) { + const errorMessage = (error as Error).message + getLogger().error('Code Transformation: Error fetching status (job id: %s): %s', jobId, errorMessage) + if (errorMessage.includes('not authorized to make this call')) { + // job not available on backend + status = 'FAILED' // won't allow retries for this job + } else { + // some other error (e.g. network error) + return + } + } + } + + // retrieve artifacts and updated duration if available + let jobHistoryPath: string = '' + if (status === 'COMPLETED' || status === 'PARTIALLY_COMPLETED') { + // artifacts should be available to download + jobHistoryPath = await retrieveArtifacts(jobId, projectName) + + await cleanupTempJobFiles(path.join(os.homedir(), '.aws', 'transform', projectName, jobId), status) + } else if (CodeWhispererConstants.validStatesForBuildSucceeded.includes(status)) { + // still in progress on server side + if (transformByQState.isRunning()) { + getLogger().warn( + 'Code Transformation: There is a job currently running (id: %s). Cannot resume another job (id: %s)', + transformByQState.getJobId(), + jobId + ) + return + } + transformByQState.setRefreshInProgress(true) + const messenger = transformByQState.getChatMessenger() + const tabID = ChatSessionManager.Instance.getSession().tabID + messenger?.sendJobRefreshInProgressMessage(tabID!, jobId) + await vscode.commands.executeCommand('aws.amazonq.transformationHub.updateContent', 'job history') // refreshing the table disables all jobs' refresh buttons while this one is resuming + + // resume job and bring to completion + try { + status = await resumeJob(jobId, projectName, status) + } catch (error) { + getLogger().error('Code Transformation: Error resuming job (id: %s): %s', jobId, (error as Error).message) + transformByQState.setJobDefaults() + messenger?.sendJobFinishedMessage(tabID!, CodeWhispererConstants.refreshErrorChatMessage) + void vscode.window.showErrorMessage(CodeWhispererConstants.refreshErrorNotification(jobId)) + await vscode.commands.executeCommand('aws.amazonq.transformationHub.updateContent', 'job history') + return + } + + // download artifacts if available + if ( + CodeWhispererConstants.validStatesForCheckingDownloadUrl.includes(status) && + !CodeWhispererConstants.failureStates.includes(status) + ) { + duration = convertToTimeString(Date.now() - new Date(transformByQState.getStartTime()).getTime()) + jobHistoryPath = await retrieveArtifacts(jobId, projectName) + } + + // reset state + transformByQState.setJobDefaults() + messenger?.sendJobFinishedMessage(tabID!, CodeWhispererConstants.refreshCompletedChatMessage) + } else { + // FAILED or STOPPED job + getLogger().info('Code Transformation: No artifacts available to download (job status = %s)', status) + if (status === 'FAILED') { + // if job failed on backend, mark it to disable the refresh button + status = 'FAILED_BE' // this will be truncated to just 'FAILED' in the table + } + await cleanupTempJobFiles(path.join(os.homedir(), '.aws', 'transform', projectName, jobId), status) + } + + if (status === currentStatus && !jobHistoryPath) { + // no changes, no need to update file/table + void vscode.window.showInformationMessage(CodeWhispererConstants.refreshNoUpdatesNotification(jobId)) + return + } + + void vscode.window.showInformationMessage(CodeWhispererConstants.refreshCompletedNotification(jobId)) + // update local file and history table + + await updateHistoryFile(status, duration, jobHistoryPath, jobId) +} + +async function retrieveArtifacts(jobId: string, projectName: string) { + const resultsPath = path.join(os.homedir(), '.aws', 'transform', projectName, 'results') // temporary directory for extraction + let jobHistoryPath = path.join(os.homedir(), '.aws', 'transform', projectName, jobId) + + if (await fs.existsFile(path.join(jobHistoryPath, 'diff.patch'))) { + getLogger().info('Code Transformation: Diff patch already exists for job id: %s', jobId) + jobHistoryPath = '' + } else { + try { + await downloadAndExtractResultArchive(jobId, resultsPath) + await copyArtifacts(resultsPath, jobHistoryPath) + } catch (error) { + jobHistoryPath = '' + } finally { + // delete temporary extraction directory + await fs.delete(resultsPath, { recursive: true, force: true }) + } + } + return jobHistoryPath +} + +async function updateHistoryFile(status: string, duration: string, jobHistoryPath: string, jobId: string) { + const history: string[][] = [] + const historyLogFilePath = path.join(os.homedir(), '.aws', 'transform', 'transformation_history.tsv') + if (await fs.existsFile(historyLogFilePath)) { + const historyFile = await fs.readFileText(historyLogFilePath) + const jobs = historyFile.split('\n') + jobs.shift() // removes headers + if (jobs.length > 0) { + for (const job of jobs) { + if (job) { + const jobInfo = job.split('\t') + // startTime: jobInfo[0], projectName: jobInfo[1], status: jobInfo[2], duration: jobInfo[3], diffPath: jobInfo[4], summaryPath: jobInfo[5], jobId: jobInfo[6] + if (jobInfo[6] === jobId) { + // update any values if applicable + jobInfo[2] = status + if (duration) { + jobInfo[3] = duration + } + if (jobHistoryPath) { + jobInfo[4] = path.join(jobHistoryPath, 'diff.patch') + jobInfo[5] = path.join(jobHistoryPath, 'summary', 'summary.md') + } + } + history.push(jobInfo) + } + } + } + } + + if (history.length === 0) { + return + } + + // rewrite file + await fs.writeFile(historyLogFilePath, 'date\tproject_name\tstatus\tduration\tdiff_patch\tsummary\tjob_id\n') + const tsvContent = history.map((row) => row.join('\t')).join('\n') + '\n' + await fs.appendFile(historyLogFilePath, tsvContent) + + // update table content + await vscode.commands.executeCommand('aws.amazonq.transformationHub.updateContent', 'job history', undefined, true) +} + +async function resumeJob(jobId: string, projectName: string, status: string) { + // set state to prepare to resume job + await setupTransformationState(jobId, projectName, status) + // resume polling the job + return await pollAndCompleteTransformation(jobId) +} + +async function setupTransformationState(jobId: string, projectName: string, status: string) { + transformByQState.setJobId(jobId) + transformByQState.setPolledJobStatus(status) + transformByQState.setJobHistoryPath(path.join(os.homedir(), '.aws', 'transform', projectName, jobId)) + + const metadata: JobMetadata = JSON.parse( + await fs.readFileText(path.join(transformByQState.getJobHistoryPath(), 'metadata.json')) + ) + transformByQState.setTransformationType(metadata.transformationType) + transformByQState.setSourceJDKVersion(metadata.sourceJDKVersion) + transformByQState.setTargetJDKVersion(metadata.targetJDKVersion) + transformByQState.setCustomDependencyVersionFilePath(metadata.customDependencyVersionFilePath) + transformByQState.setPayloadFilePath( + path.join(os.homedir(), '.aws', 'transform', projectName, jobId, 'zipped-code.zip') + ) + setMaven() + transformByQState.setCustomBuildCommand(metadata.customBuildCommand) + transformByQState.setTargetJavaHome(metadata.targetJavaHome) + transformByQState.setProjectPath(metadata.projectPath) + transformByQState.setStartTime(metadata.startTime) +} + +async function pollAndCompleteTransformation(jobId: string) { + const status = await pollTransformationJob( + jobId, + CodeWhispererConstants.validStatesForCheckingDownloadUrl, + AuthUtil.instance.regionProfileManager.activeRegionProfile + ) + await cleanupTempJobFiles(transformByQState.getJobHistoryPath(), status, transformByQState.getPayloadFilePath()) + return status +} diff --git a/packages/core/src/codewhisperer/service/transformByQ/transformationHubViewProvider.ts b/packages/core/src/codewhisperer/service/transformByQ/transformationHubViewProvider.ts index 052ef53b56c..35e8319ab46 100644 --- a/packages/core/src/codewhisperer/service/transformByQ/transformationHubViewProvider.ts +++ b/packages/core/src/codewhisperer/service/transformByQ/transformationHubViewProvider.ts @@ -24,20 +24,26 @@ import { startInterval } from '../../commands/startTransformByQ' import { CodeTransformTelemetryState } from '../../../amazonqGumby/telemetry/codeTransformTelemetryState' import { convertToTimeString } from '../../../shared/datetime' import { AuthUtil } from '../../util/authUtil' +import { refreshJob, readHistoryFile, HistoryObject } from './transformationHistoryHandler' export class TransformationHubViewProvider implements vscode.WebviewViewProvider { public static readonly viewType = 'aws.amazonq.transformationHub' private _view?: vscode.WebviewView private lastClickedButton: string = '' private _extensionUri: vscode.Uri = globals.context.extensionUri + private transformationHistory: HistoryObject[] = [] constructor() {} static #instance: TransformationHubViewProvider public async updateContent( button: 'job history' | 'plan progress', - startTime: number = CodeTransformTelemetryState.instance.getStartTime() + startTime: number = CodeTransformTelemetryState.instance.getStartTime(), + historyFileUpdated?: boolean ) { this.lastClickedButton = button + if (historyFileUpdated) { + this.transformationHistory = await readHistoryFile() + } if (this._view) { if (this.lastClickedButton === 'job history') { clearInterval(transformByQState.getIntervalId()) @@ -62,18 +68,33 @@ export class TransformationHubViewProvider implements vscode.WebviewViewProvider return (this.#instance ??= new this()) } - public resolveWebviewView( + public async resolveWebviewView( webviewView: vscode.WebviewView, context: vscode.WebviewViewResolveContext, token: vscode.CancellationToken - ): void | Thenable { + ) { this._view = webviewView + this._view.webview.onDidReceiveMessage((message) => { + switch (message.command) { + case 'refreshJob': + void refreshJob(message.jobId, message.currentStatus, message.projectName) + break + case 'openSummaryPreview': + void vscode.commands.executeCommand('markdown.showPreview', vscode.Uri.file(message.filePath)) + break + case 'openDiffFile': + void vscode.commands.executeCommand('vscode.open', vscode.Uri.file(message.filePath)) + break + } + }) + this._view.webview.options = { enableScripts: true, localResourceRoots: [this._extensionUri], } + this.transformationHistory = await readHistoryFile() if (this.lastClickedButton === 'job history') { this._view!.webview.html = this.showJobHistory() } else { @@ -88,6 +109,19 @@ export class TransformationHubViewProvider implements vscode.WebviewViewProvider } private showJobHistory(): string { + const jobsToDisplay: HistoryObject[] = [...this.transformationHistory] + if (transformByQState.isRunning()) { + const current = sessionJobHistory[transformByQState.getJobId()] + jobsToDisplay.unshift({ + startTime: current.startTime, + projectName: current.projectName, + status: current.status, + duration: current.duration, + diffPath: '', + summaryPath: '', + jobId: transformByQState.getJobId(), + }) + } return ` @@ -99,18 +133,70 @@ export class TransformationHubViewProvider implements vscode.WebviewViewProvider -

Transformation Status

+

Transformation History

+

${CodeWhispererConstants.transformationHistoryTableDescription}

${ - Object.keys(sessionJobHistory).length === 0 - ? `

${CodeWhispererConstants.nothingToShowMessage}

` - : this.getTableMarkup(sessionJobHistory[transformByQState.getJobId()]) + jobsToDisplay.length === 0 + ? `


${CodeWhispererConstants.noJobHistoryMessage}

` + : this.getTableMarkup(jobsToDisplay) } + ` } - private getTableMarkup(job: { startTime: string; projectName: string; status: string; duration: string }) { + private getTableMarkup(history: HistoryObject[]) { return ` + @@ -118,17 +204,48 @@ export class TransformationHubViewProvider implements vscode.WebviewViewProvider - + + + + - - - - - - - + ${history + .map( + (job) => ` + + + + + + + + + + + ` + ) + .join('')}
Project Status DurationIdDiff PatchSummary FileJob IdRefresh Job
${job.startTime}${job.projectName}${job.status}${job.duration}${transformByQState.getJobId()}
${job.startTime}${job.projectName}${job.status === 'FAILED_BE' ? 'FAILED' : job.status}${job.duration}${job.diffPath ? `diff.patch` : ''}${job.summaryPath ? `summary.md` : ''}${job.jobId} + +
` diff --git a/packages/core/src/codewhisperer/service/transformByQ/transformationResultsViewProvider.ts b/packages/core/src/codewhisperer/service/transformByQ/transformationResultsViewProvider.ts index e5de2099753..c37ecfca3bb 100644 --- a/packages/core/src/codewhisperer/service/transformByQ/transformationResultsViewProvider.ts +++ b/packages/core/src/codewhisperer/service/transformByQ/transformationResultsViewProvider.ts @@ -22,6 +22,7 @@ import { setContext } from '../../../shared/vscode/setContext' import * as codeWhisperer from '../../client/codewhisperer' import { UserWrittenCodeTracker } from '../../tracker/userWrittenCodeTracker' import { AuthUtil } from '../../util/authUtil' +import { copyArtifacts } from './transformFileHandler' export abstract class ProposedChangeNode { abstract readonly resourcePath: string @@ -165,7 +166,9 @@ export class DiffModel { throw new Error(CodeWhispererConstants.noChangesMadeMessage) } - const changedFiles = parsePatch(diffContents) + let changedFiles = parsePatch(diffContents) + // exclude dependency_upgrade.yml from patch application + changedFiles = changedFiles.filter((file) => !file.oldFileName?.includes('dependency_upgrade')) getLogger().info('CodeTransformation: parsed patch file successfully') // if doing intermediate client-side build, pathToWorkspace is the path to the unzipped project's 'sources' directory (re-using upload ZIP) // otherwise, we are at the very end of the transformation and need to copy the changed files in the project to show the diff(s) @@ -424,6 +427,7 @@ export class ProposedTransformationExplorer { let deserializeErrorMessage = undefined let pathContainingArchive = '' patchFiles = [] // reset patchFiles if there was a previous transformation + try { // Download and deserialize the zip pathContainingArchive = path.dirname(pathToArchive) @@ -439,6 +443,9 @@ export class ProposedTransformationExplorer { transformByQState.setSummaryFilePath( path.join(pathContainingArchive, ExportResultArchiveStructure.PathToSummary) ) + + await copyArtifacts(pathContainingArchive, transformByQState.getJobHistoryPath()) + transformByQState.setResultArchiveFilePath(pathContainingArchive) await setContext('gumby.isSummaryAvailable', true) diff --git a/packages/core/src/codewhisperer/util/closingBracketUtil.ts b/packages/core/src/codewhisperer/util/closingBracketUtil.ts new file mode 100644 index 00000000000..4892c5694b4 --- /dev/null +++ b/packages/core/src/codewhisperer/util/closingBracketUtil.ts @@ -0,0 +1,263 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + * Reference: https://github.com/aws/aws-toolkit-vscode/blob/amazonq/v1.74.0/packages/core/src/codewhisperer/util/closingBracketUtil.ts + */ + +import * as vscode from 'vscode' +import * as CodeWhispererConstants from '../models/constants' + +interface bracketMapType { + [k: string]: string +} + +const quotes = ["'", '"', '`'] +const parenthesis = ['(', '[', '{', ')', ']', '}', '<', '>'] + +const closeToOpen: bracketMapType = { + ')': '(', + ']': '[', + '}': '{', + '>': '<', +} + +const openToClose: bracketMapType = { + '(': ')', + '[': ']', + '{': '}', + '<': '>', +} + +/** + * LeftContext | Recommendation | RightContext + * This function aims to resolve symbols which are redundant and need to be removed + * The high level logic is as followed + * 1. Pair non-paired closing symbols(parenthesis, brackets, quotes) existing in the "recommendation" with non-paired symbols existing in the "leftContext" + * 2. Remove non-paired closing symbols existing in the "rightContext" + * @param endPosition: end position of the effective recommendation written by CodeWhisperer + * @param startPosition: start position of the effective recommendation by CodeWhisperer + * + * for example given file context ('|' is where we trigger the service): + * anArray.pu| + * recommendation returned: "sh(element);" + * typeahead: "sh(" + * the effective recommendation written by CodeWhisperer: "element);" + */ +export async function handleExtraBrackets( + editor: vscode.TextEditor, + endPosition: vscode.Position, + startPosition: vscode.Position +) { + const recommendation = editor.document.getText(new vscode.Range(startPosition, endPosition)) + const endOffset = editor.document.offsetAt(endPosition) + const startOffset = editor.document.offsetAt(startPosition) + const leftContext = editor.document.getText( + new vscode.Range( + startPosition, + editor.document.positionAt(Math.max(startOffset - CodeWhispererConstants.charactersLimit, 0)) + ) + ) + + const rightContext = editor.document.getText( + new vscode.Range( + editor.document.positionAt(endOffset), + editor.document.positionAt(endOffset + CodeWhispererConstants.charactersLimit) + ) + ) + const bracketsToRemove = getBracketsToRemove( + editor, + recommendation, + leftContext, + rightContext, + endPosition, + startPosition + ) + + const quotesToRemove = getQuotesToRemove( + editor, + recommendation, + leftContext, + rightContext, + endPosition, + startPosition + ) + + const symbolsToRemove = [...bracketsToRemove, ...quotesToRemove] + + if (symbolsToRemove.length) { + await removeBracketsFromRightContext(editor, symbolsToRemove, endPosition) + } +} + +const removeBracketsFromRightContext = async ( + editor: vscode.TextEditor, + idxToRemove: number[], + endPosition: vscode.Position +) => { + const offset = editor.document.offsetAt(endPosition) + + await editor.edit( + (editBuilder) => { + for (const idx of idxToRemove) { + const range = new vscode.Range( + editor.document.positionAt(offset + idx), + editor.document.positionAt(offset + idx + 1) + ) + editBuilder.delete(range) + } + }, + { undoStopAfter: false, undoStopBefore: false } + ) +} + +function getBracketsToRemove( + editor: vscode.TextEditor, + recommendation: string, + leftContext: string, + rightContext: string, + end: vscode.Position, + start: vscode.Position +) { + const unpairedClosingsInReco = nonClosedClosingParen(recommendation) + const unpairedOpeningsInLeftContext = nonClosedOpneingParen(leftContext, unpairedClosingsInReco.length) + const unpairedClosingsInRightContext = nonClosedClosingParen(rightContext) + + const toRemove: number[] = [] + + let i = 0 + let j = 0 + let k = 0 + while (i < unpairedOpeningsInLeftContext.length && j < unpairedClosingsInReco.length) { + const opening = unpairedOpeningsInLeftContext[i] + const closing = unpairedClosingsInReco[j] + + const isPaired = closeToOpen[closing.char] === opening.char + const rightContextCharToDelete = unpairedClosingsInRightContext[k] + + if (isPaired) { + if (rightContextCharToDelete && rightContextCharToDelete.char === closing.char) { + const rightContextStart = editor.document.offsetAt(end) + 1 + const symbolPosition = editor.document.positionAt( + rightContextStart + rightContextCharToDelete.strOffset + ) + const lineCnt = recommendation.split('\n').length - 1 + const isSameline = symbolPosition.line - lineCnt === start.line + + if (isSameline) { + toRemove.push(rightContextCharToDelete.strOffset) + } + + k++ + } + } + + i++ + j++ + } + + return toRemove +} + +function getQuotesToRemove( + editor: vscode.TextEditor, + recommendation: string, + leftContext: string, + rightContext: string, + endPosition: vscode.Position, + startPosition: vscode.Position +) { + let leftQuote: string | undefined = undefined + let leftIndex: number | undefined = undefined + for (let i = leftContext.length - 1; i >= 0; i--) { + const char = leftContext[i] + if (quotes.includes(char)) { + leftQuote = char + leftIndex = leftContext.length - i + break + } + } + + let rightQuote: string | undefined = undefined + let rightIndex: number | undefined = undefined + for (let i = 0; i < rightContext.length; i++) { + const char = rightContext[i] + if (quotes.includes(char)) { + rightQuote = char + rightIndex = i + break + } + } + + let quoteCountInReco = 0 + if (leftQuote && rightQuote && leftQuote === rightQuote) { + for (const char of recommendation) { + if (quotes.includes(char) && char === leftQuote) { + quoteCountInReco++ + } + } + } + + if (leftIndex !== undefined && rightIndex !== undefined && quoteCountInReco % 2 !== 0) { + const p = editor.document.positionAt(editor.document.offsetAt(endPosition) + rightIndex) + + if (endPosition.line === startPosition.line && endPosition.line === p.line) { + return [rightIndex] + } + } + + return [] +} + +function nonClosedOpneingParen(str: string, cnt?: number): { char: string; strOffset: number }[] { + const resultSet: { char: string; strOffset: number }[] = [] + const stack: string[] = [] + + for (let i = str.length - 1; i >= 0; i--) { + const char = str[i] + if (char! in parenthesis) { + continue + } + + if (char in closeToOpen) { + stack.push(char) + if (cnt && cnt === resultSet.length) { + return resultSet + } + } else if (char in openToClose) { + if (stack.length !== 0 && stack[stack.length - 1] === openToClose[char]) { + stack.pop() + } else { + resultSet.push({ char: char, strOffset: i }) + } + } + } + + return resultSet +} + +function nonClosedClosingParen(str: string, cnt?: number): { char: string; strOffset: number }[] { + const resultSet: { char: string; strOffset: number }[] = [] + const stack: string[] = [] + + for (let i = 0; i < str.length; i++) { + const char = str[i] + if (char! in parenthesis) { + continue + } + + if (char in openToClose) { + stack.push(char) + if (cnt && cnt === resultSet.length) { + return resultSet + } + } else if (char in closeToOpen) { + if (stack.length !== 0 && stack[stack.length - 1] === closeToOpen[char]) { + stack.pop() + } else { + resultSet.push({ char: char, strOffset: i }) + } + } + } + + return resultSet +} diff --git a/packages/core/src/codewhisperer/util/telemetryHelper.ts b/packages/core/src/codewhisperer/util/telemetryHelper.ts index 060a5ecb282..89c04afe572 100644 --- a/packages/core/src/codewhisperer/util/telemetryHelper.ts +++ b/packages/core/src/codewhisperer/util/telemetryHelper.ts @@ -13,7 +13,6 @@ import { CodewhispererPreviousSuggestionState, CodewhispererUserDecision, CodewhispererUserTriggerDecision, - Status, telemetry, } from '../../shared/telemetry/telemetry' import { CodewhispererCompletionType, CodewhispererSuggestionState } from '../../shared/telemetry/telemetry' @@ -28,7 +27,6 @@ import { CodeWhispererSupplementalContext } from '../models/model' import { FeatureConfigProvider } from '../../shared/featureConfig' import CodeWhispererUserClient, { CodeScanRemediationsEventType } from '../client/codewhispereruserclient' import { CodeAnalysisScope as CodeAnalysisScopeClientSide } from '../models/constants' -import { Session } from '../../amazonqTest/chat/session/session' import { sleep } from '../../shared/utilities/timeoutUtils' import { getDiagnosticsDifferences, getDiagnosticsOfCurrentFile, toIdeDiagnostics } from './diagnosticsUtil' import { Auth } from '../../auth/auth' @@ -71,54 +69,6 @@ export class TelemetryHelper { return (this.#instance ??= new this()) } - public sendTestGenerationToolkitEvent( - session: Session, - isSupportedLanguage: boolean, - isFileInWorkspace: boolean, - result: 'Succeeded' | 'Failed' | 'Cancelled', - requestId?: string, - perfClientLatency?: number, - reasonDesc?: string, - isCodeBlockSelected?: boolean, - artifactsUploadDuration?: number, - buildPayloadBytes?: number, - buildZipFileBytes?: number, - acceptedCharactersCount?: number, - acceptedCount?: number, - acceptedLinesCount?: number, - generatedCharactersCount?: number, - generatedCount?: number, - generatedLinesCount?: number, - reason?: string, - status?: Status - ) { - telemetry.amazonq_utgGenerateTests.emit({ - cwsprChatProgrammingLanguage: session.fileLanguage ?? 'plaintext', - hasUserPromptSupplied: session.hasUserPromptSupplied, - isSupportedLanguage: session.isSupportedLanguage, - isFileInWorkspace: isFileInWorkspace, - result: result, - artifactsUploadDuration: artifactsUploadDuration, - buildPayloadBytes: buildPayloadBytes, - buildZipFileBytes: buildZipFileBytes, - credentialStartUrl: AuthUtil.instance.startUrl, - acceptedCharactersCount: acceptedCharactersCount, - acceptedCount: acceptedCount, - acceptedLinesCount: acceptedLinesCount, - generatedCharactersCount: generatedCharactersCount, - generatedCount: generatedCount, - generatedLinesCount: generatedLinesCount, - isCodeBlockSelected: isCodeBlockSelected, - jobGroup: session.testGenerationJobGroupName, - jobId: session.listOfTestGenerationJobId[0], - perfClientLatency: perfClientLatency, - requestId: requestId, - reasonDesc: reasonDesc, - reason: reason, - status: status, - }) - } - public recordServiceInvocationTelemetry( requestId: string, sessionId: string, diff --git a/packages/core/src/codewhisperer/util/zipUtil.ts b/packages/core/src/codewhisperer/util/zipUtil.ts index 32687a6452c..719116efdc7 100644 --- a/packages/core/src/codewhisperer/util/zipUtil.ts +++ b/packages/core/src/codewhisperer/util/zipUtil.ts @@ -4,7 +4,7 @@ */ import * as vscode from 'vscode' import path from 'path' -import { tempDirPath, testGenerationLogsDir } from '../../shared/filesystemUtilities' +import { tempDirPath } from '../../shared/filesystemUtilities' import { getLogger } from '../../shared/logger/logger' import * as CodeWhispererConstants from '../models/constants' import { ToolkitError } from '../../shared/errors' @@ -21,7 +21,6 @@ import { } from '../models/errors' import { FeatureUseCase } from '../models/constants' import { ChildProcess, ChildProcessOptions } from '../../shared/utilities/processUtils' -import { ProjectZipError } from '../../amazonqTest/error' import { removeAnsi } from '../../shared/utilities/textUtilities' import { normalize } from '../../shared/utilities/pathUtils' import { ZipStream } from '../../shared/utilities/zipStream' @@ -570,56 +569,6 @@ export class ZipUtil { } } - public async generateZipTestGen(projectPath: string, initialExecution: boolean): Promise { - try { - // const repoMapFile = await LspClient.instance.getRepoMapJSON() - const zipDirPath = this.getZipDirPath(FeatureUseCase.TEST_GENERATION) - - const metadataDir = path.join(zipDirPath, 'utgRequiredArtifactsDir') - - // Create directories - const dirs = { - metadata: metadataDir, - buildAndExecuteLogDir: path.join(metadataDir, 'buildAndExecuteLogDir'), - repoMapDir: path.join(metadataDir, 'repoMapData'), - testCoverageDir: path.join(metadataDir, 'testCoverageDir'), - } - await Promise.all(Object.values(dirs).map((dir) => fs.mkdir(dir))) - - // if (await fs.exists(repoMapFile)) { - // await fs.copy(repoMapFile, path.join(dirs.repoMapDir, 'repoMapData.json')) - // await fs.delete(repoMapFile) - // } - - if (!initialExecution) { - await this.processTestCoverageFiles(dirs.testCoverageDir) - - const sourcePath = path.join(testGenerationLogsDir, 'output.log') - const targetPath = path.join(dirs.buildAndExecuteLogDir, 'output.log') - if (await fs.exists(sourcePath)) { - await fs.copy(sourcePath, targetPath) - } - } - - const zipFilePath: string = await this.zipProject(FeatureUseCase.TEST_GENERATION, projectPath, metadataDir) - const zipFileSize = (await fs.stat(zipFilePath)).size - return { - rootDir: zipDirPath, - zipFilePath: zipFilePath, - srcPayloadSizeInBytes: this._totalSize, - scannedFiles: new Set(this._pickedSourceFiles), - zipFileSizeInBytes: zipFileSize, - buildPayloadSizeInBytes: this._totalBuildSize, - lines: this._totalLines, - language: this._language, - } - } catch (error) { - getLogger().error('Zip error caused by: %s', error) - throw new ProjectZipError( - error instanceof Error ? error.message : 'Unknown error occurred during zip operation' - ) - } - } // TODO: Refactor this public async removeTmpFiles(zipMetadata: ZipMetadata, scope?: CodeWhispererConstants.CodeAnalysisScope) { const logger = getLoggerForScope(scope) diff --git a/packages/core/src/codewhisperer/views/securityIssue/securityIssueWebview.ts b/packages/core/src/codewhisperer/views/securityIssue/securityIssueWebview.ts index d511bd9a5f6..632283215ab 100644 --- a/packages/core/src/codewhisperer/views/securityIssue/securityIssueWebview.ts +++ b/packages/core/src/codewhisperer/views/securityIssue/securityIssueWebview.ts @@ -109,7 +109,10 @@ export class SecurityIssueWebview extends VueWebview { } public generateFix() { - void vscode.commands.executeCommand('aws.amazonq.security.generateFix', this.issue, this.filePath, 'webview') + const args = [this.issue] + void this.navigateToFile()?.then(() => { + void vscode.commands.executeCommand('aws.amazonq.generateFix', ...args) + }) } public regenerateFix() { diff --git a/packages/core/src/commands.ts b/packages/core/src/commands.ts index db038a72bbd..f69a8dd173c 100644 --- a/packages/core/src/commands.ts +++ b/packages/core/src/commands.ts @@ -46,7 +46,7 @@ import { Commands, VsCodeCommandArg, placeholder, vscodeComponent } from './shar import { isValidResponse } from './shared/wizards/wizard' import { CancellationError } from './shared/utilities/timeoutUtils' import { ToolkitError } from './shared/errors' -import { setContext } from './shared/vscode/setContext' +import { getContext, setContext } from './shared/vscode/setContext' function switchConnections(auth: Auth | TreeNode | unknown) { if (!(auth instanceof Auth)) { @@ -103,7 +103,7 @@ export function registerCommands(context: vscode.ExtensionContext) { const manageConnections = Commands.register( { id: 'aws.toolkit.auth.manageConnections', compositeKey: { 1: 'source' } }, - async (_: VsCodeCommandArg, source: AuthSource, serviceToShow?: ServiceItemId) => { + async (_: VsCodeCommandArg, source: AuthSource, serviceToShow?: ServiceItemId, blocking?: boolean) => { if (_ !== placeholder) { source = AuthSources.vscodeComponent } @@ -124,7 +124,23 @@ export function registerCommands(context: vscode.ExtensionContext) { CommonAuthWebview.authSource = source await vscode.commands.executeCommand('aws.explorer.setLoginService', serviceToShow) await setContext('aws.explorer.showAuthView', true) + + // While the auth view is open, we want to be blocking (if the command has been specified to be blocking) + const authWindowPromise = new Promise((resolve) => { + if (!blocking) { + resolve() + } + + const check = globals.clock.setInterval(() => { + if (getContext('aws.explorer.showAuthView') === false) { + clearInterval(check) + resolve() + } + }, 500) + }) + await vscode.commands.executeCommand('aws.toolkit.AmazonCommonAuth.focus') + await authWindowPromise } ) diff --git a/packages/core/src/dev/config.ts b/packages/core/src/dev/config.ts index b4df78f64b0..d5fa49b2426 100644 --- a/packages/core/src/dev/config.ts +++ b/packages/core/src/dev/config.ts @@ -10,6 +10,3 @@ export const betaUrl = { amazonq: '', toolkit: '', } - -// TO-DO: remove when releasing CSB -export const isClientSideBuildEnabled = false diff --git a/packages/core/src/extensionNode.ts b/packages/core/src/extensionNode.ts index 8e759263623..97785456e9b 100644 --- a/packages/core/src/extensionNode.ts +++ b/packages/core/src/extensionNode.ts @@ -41,6 +41,7 @@ import { activate as activateRedshift } from './awsService/redshift/activation' import { activate as activateDocumentDb } from './docdb/activation' import { activate as activateIamPolicyChecks } from './awsService/accessanalyzer/activation' import { activate as activateNotifications } from './notifications/activation' +import { activate as activateSagemaker } from './awsService/sagemaker/activation' import { SchemaService } from './shared/schemas' import { AwsResourceManager } from './dynamicResources/awsResourceManager' import globals from './shared/extensionGlobals' @@ -185,6 +186,8 @@ export async function activate(context: vscode.ExtensionContext) { await activateSchemas(extContext) + await activateSagemaker(extContext) + if (!isSageMaker()) { // Amazon Q Tree setup. learnMoreAmazonQCommand.register() diff --git a/packages/core/src/feedback/vue/submitFeedback.ts b/packages/core/src/feedback/vue/submitFeedback.ts index a19f81c4079..928c0eb3249 100644 --- a/packages/core/src/feedback/vue/submitFeedback.ts +++ b/packages/core/src/feedback/vue/submitFeedback.ts @@ -41,6 +41,10 @@ export class FeedbackWebview extends VueWebview { return 'Choose a reaction (smile/frown)' } + if (message.comment.length < 188) { + return 'Please add atleast 100 characters in the template describing your issue.' + } + if (this.commentData) { message.comment = `${message.comment}\n\n${this.commentData}` } diff --git a/packages/core/src/feedback/vue/submitFeedback.vue b/packages/core/src/feedback/vue/submitFeedback.vue index 814223dc3cc..b97233ba494 100644 --- a/packages/core/src/feedback/vue/submitFeedback.vue +++ b/packages/core/src/feedback/vue/submitFeedback.vue @@ -34,6 +34,26 @@ >.
+
+ For helpful feedback, please include: +
    +
  • + Issue: A brief summary of the issue or suggestion +
  • +
  • + Reproduction Steps: Clear steps to reproduce the issue (if + applicable) +
  • +
  • + Expected vs. Actual: What you expected and what actually + happened +
  • +
+

@@ -66,7 +86,16 @@ const client = WebviewClientFactory.create() export default defineComponent({ data() { return { - comment: '', + comment: `Issue: + +Reproduction Steps: +1. +2. +3. + +Expected Behavior: + +Actual Behavior: `, sentiment: '', isSubmitting: false, error: '', diff --git a/packages/core/src/lambda/activation.ts b/packages/core/src/lambda/activation.ts index d799173697e..eaebc17de3b 100644 --- a/packages/core/src/lambda/activation.ts +++ b/packages/core/src/lambda/activation.ts @@ -3,14 +3,16 @@ * SPDX-License-Identifier: Apache-2.0 */ +import * as path from 'path' import * as vscode from 'vscode' +import * as nls from 'vscode-nls' + import { Lambda } from 'aws-sdk' import { deleteLambda } from './commands/deleteLambda' import { uploadLambdaCommand } from './commands/uploadLambda' import { LambdaFunctionNode } from './explorer/lambdaFunctionNode' -import { downloadLambdaCommand } from './commands/downloadLambda' +import { downloadLambdaCommand, openLambdaFile } from './commands/downloadLambda' import { tryRemoveFolder } from '../shared/filesystemUtilities' -import { ExtContext } from '../shared/extensions' import { invokeRemoteLambda } from './vue/remoteInvoke/invokeLambda' import { registerSamDebugInvokeVueCommand, registerSamInvokeVueCommand } from './vue/configEditor/samInvokeBackend' import { Commands } from '../shared/vscode/commands2' @@ -24,11 +26,130 @@ import { liveTailRegistry, liveTailCodeLensProvider } from '../awsService/cloudW import { getFunctionLogGroupName } from '../awsService/cloudWatchLogs/activation' import { ToolkitError, isError } from '../shared/errors' import { LogStreamFilterResponse } from '../awsService/cloudWatchLogs/wizard/liveTailLogStreamSubmenu' +import { tempDirPath } from '../shared/filesystemUtilities' +import fs from '../shared/fs/fs' +import { + confirmOutdatedChanges, + deleteFilesInFolder, + deployFromTemp, + getReadme, + openLambdaFolderForEdit, + watchForUpdates, +} from './commands/editLambda' +import { compareCodeSha, getFunctionInfo, getTempLocation, setFunctionInfo } from './utils' +import { registerLambdaUriHandler } from './uriHandlers' +import globals from '../shared/extensionGlobals' + +const localize = nls.loadMessageBundle() +import { activateRemoteDebugging } from './remoteDebugging/ldkController' +import { ExtContext } from '../shared/extensions' + +async function openReadme() { + const readmeUri = vscode.Uri.file(await getReadme()) + // We only want to do it if there's not a readme already + const isPreviewOpen = vscode.window.tabGroups.all.some((group) => + group.tabs.some((tab) => tab.label.includes('README')) + ) + if (!isPreviewOpen) { + await vscode.commands.executeCommand('markdown.showPreviewToSide', readmeUri) + } +} + +async function quickEditActivation() { + if (vscode.workspace.workspaceFolders) { + for (const workspaceFolder of vscode.workspace.workspaceFolders) { + // Making the comparison case insensitive because Windows can have `C\` or `c\` + const workspacePath = workspaceFolder.uri.fsPath.toLowerCase() + const tempPath = path.join(tempDirPath, 'lambda').toLowerCase() + if (workspacePath.includes(tempPath)) { + const name = path.basename(workspaceFolder.uri.fsPath) + const region = path.basename(path.dirname(workspaceFolder.uri.fsPath)) + + const lambda = { name, region, configuration: undefined } + + watchForUpdates(lambda, vscode.Uri.file(workspacePath)) + + await openReadme() + + // Open handler function + try { + const handler = await getFunctionInfo(lambda, 'handlerFile') + const lambdaLocation = path.join(workspacePath, handler) + await openLambdaFile(lambdaLocation, vscode.ViewColumn.One) + } catch (e) { + void vscode.window.showWarningMessage( + localize('AWS.lambda.openFile.failure', `Failed to determine handler location: ${e}`) + ) + } + + // Check if there are changes that need overwritten + try { + // Checking if there are changes that need to be overwritten + const prompt = localize( + 'AWS.lambda.download.confirmOutdatedSync', + 'There are changes to your function in the cloud since you last edited locally, do you want to overwrite your local changes?' + ) + + // Adding delay to give the authentication time to catch up + await new Promise((resolve) => globals.clock.setTimeout(resolve, 1000)) + + const overwriteChanges = !(await compareCodeSha(lambda)) + ? await confirmOutdatedChanges(prompt) + : false + if (overwriteChanges) { + // Close all open tabs from this workspace + const workspaceUri = vscode.Uri.file(workspacePath) + for (const tabGroup of vscode.window.tabGroups.all) { + const tabsToClose = tabGroup.tabs.filter( + (tab) => + tab.input instanceof vscode.TabInputText && + tab.input.uri.fsPath.startsWith(workspaceUri.fsPath) + ) + if (tabsToClose.length > 0) { + await vscode.window.tabGroups.close(tabsToClose) + } + } + + // Delete all files in the directory + await deleteFilesInFolder(workspacePath) + + // Show message to user about next steps + void vscode.window.showInformationMessage( + localize( + 'AWS.lambda.refresh.complete', + 'Local workspace cleared. Navigate to the Toolkit explorer to get fresh code from the cloud.' + ) + ) + + await setFunctionInfo(lambda, { undeployed: false }) + + // Remove workspace folder + const workspaceIndex = vscode.workspace.workspaceFolders?.findIndex( + (folder) => folder.uri.fsPath.toLowerCase() === workspacePath + ) + if (workspaceIndex !== undefined && workspaceIndex >= 0) { + vscode.workspace.updateWorkspaceFolders(workspaceIndex, 1) + } + } + } catch (e) { + void vscode.window.showWarningMessage( + localize( + 'AWS.lambda.pull.failure', + `Failed to pull latest changes from the cloud, you can still edit locally: ${e}` + ) + ) + } + } + } + } +} /** * Activates Lambda components. */ export async function activate(context: ExtContext): Promise { + void quickEditActivation() + context.extensionContext.subscriptions.push( Commands.register('aws.deleteLambda', async (node: LambdaFunctionNode | TreeNode) => { const sourceNode = getSourceNode(node) @@ -47,6 +168,7 @@ export async function activate(context: ExtContext): Promise { source: source, }) }), + // Capture debug finished events, and delete the temporary directory if it exists vscode.debug.onDidTerminateDebugSession(async (session) => { if ( @@ -56,10 +178,12 @@ export async function activate(context: ExtContext): Promise { await tryRemoveFolder(session.configuration.baseBuildDir) } }), + Commands.register('aws.downloadLambda', async (node: LambdaFunctionNode | TreeNode) => { const sourceNode = getSourceNode(node) await downloadLambdaCommand(sourceNode) }), + Commands.register({ id: 'aws.uploadLambda', autoconnect: true }, async (arg?: unknown) => { if (arg instanceof LambdaFunctionNode) { await uploadLambdaCommand({ @@ -73,6 +197,26 @@ export async function activate(context: ExtContext): Promise { await uploadLambdaCommand() } }), + + Commands.register({ id: 'aws.quickDeployLambda' }, async (node: LambdaFunctionNode) => { + const functionName = node.configuration.FunctionName! + const region = node.regionCode + const lambda = { name: functionName, region, configuration: node.configuration } + const tempLocation = getTempLocation(functionName, region) + + if (await fs.existsDir(tempLocation)) { + await deployFromTemp(lambda, vscode.Uri.file(tempLocation)) + } + }), + + Commands.register('aws.openLambdaFile', async (path: string) => { + await openLambdaFile(path) + }), + + Commands.register('aws.lambda.openWorkspace', async (node: LambdaFunctionNode) => { + await openLambdaFolderForEdit(node.functionName, node.regionCode) + }), + Commands.register('aws.copyLambdaUrl', async (node: LambdaFunctionNode | TreeNode) => { const sourceNode = getSourceNode(node) await copyLambdaUrl(sourceNode, new DefaultLambdaClient(sourceNode.regionCode)) @@ -116,6 +260,10 @@ export async function activate(context: ExtContext): Promise { throw err } } - }) + }), + + registerLambdaUriHandler() ) + + void activateRemoteDebugging() } diff --git a/packages/core/src/lambda/commands/downloadLambda.ts b/packages/core/src/lambda/commands/downloadLambda.ts index e2e1dc2be91..baf82b5b30c 100644 --- a/packages/core/src/lambda/commands/downloadLambda.ts +++ b/packages/core/src/lambda/commands/downloadLambda.ts @@ -11,7 +11,7 @@ import { LambdaFunctionNode } from '../explorer/lambdaFunctionNode' import { showConfirmationMessage } from '../../shared/utilities/messages' import { LaunchConfiguration, getReferencedHandlerPaths } from '../../shared/debug/launchConfiguration' -import { makeTemporaryToolkitFolder, fileExists, tryRemoveFolder } from '../../shared/filesystemUtilities' +import { makeTemporaryToolkitFolder, tryRemoveFolder } from '../../shared/filesystemUtilities' import * as localizedText from '../../shared/localizedText' import { getLogger } from '../../shared/logger/logger' import { HttpResourceFetcher } from '../../shared/resourcefetcher/node/httpResourceFetcher' @@ -26,9 +26,34 @@ import { DefaultLambdaClient } from '../../shared/clients/lambdaClient' import { telemetry } from '../../shared/telemetry/telemetry' import { Result, Runtime } from '../../shared/telemetry/telemetry' import { fs } from '../../shared/fs/fs' +import { LambdaFunction } from './uploadLambda' +import globals from '../../shared/extensionGlobals' + +// Workspace state key for Lambda function ARN to local path cache +const LAMBDA_ARN_CACHE_KEY = 'aws.lambda.functionArnToLocalPathCache' // eslint-disable-line @typescript-eslint/naming-convention + +async function setLambdaArnCache(functionArn: string, localPath: string): Promise { + try { + const cache: Record = globals.context.workspaceState.get(LAMBDA_ARN_CACHE_KEY, {}) + cache[functionArn] = localPath + await globals.context.workspaceState.update(LAMBDA_ARN_CACHE_KEY, cache) + getLogger().debug(`lambda: cached local path for function ARN: ${functionArn} -> ${localPath}`) + } catch (error) { + getLogger().error(`lambda: failed to cache local path for function ARN: ${functionArn}`, error) + } +} + +export function getCachedLocalPath(functionArn: string): string | undefined { + const cache: Record = globals.context.workspaceState.get(LAMBDA_ARN_CACHE_KEY, {}) + return cache[functionArn] +} export async function downloadLambdaCommand(functionNode: LambdaFunctionNode) { const result = await runDownloadLambda(functionNode) + // check if result is Result + if (result instanceof vscode.Uri) { + return + } telemetry.lambda_import.emit({ result, @@ -36,7 +61,10 @@ export async function downloadLambdaCommand(functionNode: LambdaFunctionNode) { }) } -async function runDownloadLambda(functionNode: LambdaFunctionNode): Promise { +export async function runDownloadLambda( + functionNode: LambdaFunctionNode, + returnDir: boolean = false +): Promise { const workspaceFolders = vscode.workspace.workspaceFolders || [] const functionName = functionNode.configuration.FunctionName! @@ -73,16 +101,37 @@ async function runDownloadLambda(functionNode: LambdaFunctionNode): Promise( + return await downloadLambdaInLocation( + { name: functionName, region: functionNode.regionCode, configuration: functionNode.configuration }, + downloadLocationName, + downloadLocation, + workspaceFolders, + selectedUri, + returnDir + ) +} + +export async function downloadLambdaInLocation( + lambda: LambdaFunction, + downloadLocationName: string, + downloadLocation: string, + workspaceFolders?: readonly vscode.WorkspaceFolder[], + selectedUri?: vscode.Uri, + returnDir: boolean = false +): Promise { + const result = await vscode.window.withProgress( { location: vscode.ProgressLocation.Notification, cancellable: false, title: localize( 'AWS.lambda.download.status', 'Downloading Lambda function {0} into {1}...', - functionName, + lambda.name, downloadLocationName ), }, @@ -90,8 +139,22 @@ async function runDownloadLambda(functionNode: LambdaFunctionNode): Promise { - return selectedUri === val.uri - }).length === 0 - ) { - await addFolderToWorkspace({ uri: selectedUri! }, true) - } - const workspaceFolder = vscode.workspace.getWorkspaceFolder(vscode.Uri.file(downloadLocation))! - - await addLaunchConfigEntry(lambdaLocation, functionNode, workspaceFolder) + if (workspaceFolders) { + if ( + workspaceFolders.filter((val) => { + return selectedUri === val.uri + }).length === 0 + ) { + await addFolderToWorkspace({ uri: selectedUri! }, true) + } + const workspaceFolder = vscode.workspace.getWorkspaceFolder(vscode.Uri.file(downloadLocation))! + await addLaunchConfigEntry(lambdaLocation, lambda, workspaceFolder) + } return 'Succeeded' } catch (e) { // failed to open handler file or add launch config. @@ -130,6 +195,12 @@ async function runDownloadLambda(functionNode: LambdaFunctionNode): Promise, - functionNode: LambdaFunctionNode, + lambda: LambdaFunction, extractLocation: string, - lambda = new DefaultLambdaClient(functionNode.regionCode) + lambdaClient = new DefaultLambdaClient(lambda.region) ): Promise { - const functionArn = functionNode.configuration.FunctionArn! + const functionArn = lambda.configuration!.FunctionArn! let tempDir: string | undefined try { tempDir = await makeTemporaryToolkitFolder() const downloadLocation = path.join(tempDir, 'function.zip') - const response = await lambda.getFunction(functionArn) + const response = await lambdaClient.getFunction(functionArn) const codeLocation = response.Code!.Location! // arbitrary increments since there's no "busy" state for progress bars @@ -176,8 +247,8 @@ async function downloadAndUnzipLambda( } } -export async function openLambdaFile(lambdaLocation: string): Promise { - if (!(await fileExists(lambdaLocation))) { +export async function openLambdaFile(lambdaLocation: string, viewColumn?: vscode.ViewColumn): Promise { + if (!(await fs.exists(lambdaLocation))) { const warning = localize( 'AWS.lambda.download.fileNotFound', 'Handler file {0} not found in downloaded function.', @@ -187,22 +258,23 @@ export async function openLambdaFile(lambdaLocation: string): Promise { void vscode.window.showWarningMessage(warning) throw new Error() } + await vscode.commands.executeCommand('workbench.action.focusFirstEditorGroup') const doc = await vscode.workspace.openTextDocument(vscode.Uri.file(lambdaLocation)) - await vscode.window.showTextDocument(doc) + await vscode.window.showTextDocument(doc, viewColumn) } async function addLaunchConfigEntry( lambdaLocation: string, - functionNode: LambdaFunctionNode, + lambda: LambdaFunction, workspaceFolder: vscode.WorkspaceFolder ): Promise { - const handler = functionNode.configuration.Handler! + const handler = lambda.configuration!.Handler! const samDebugConfig = createCodeAwsSamDebugConfig( workspaceFolder, handler, - computeLambdaRoot(lambdaLocation, functionNode), - functionNode.configuration.Runtime! + computeLambdaRoot(lambdaLocation, lambda), + lambda.configuration!.Runtime! ) const launchConfig = new LaunchConfiguration(vscode.Uri.file(lambdaLocation)) @@ -218,8 +290,8 @@ async function addLaunchConfigEntry( * @param lambdaLocation Lambda handler file location * @param functionNode Function node */ -function computeLambdaRoot(lambdaLocation: string, functionNode: LambdaFunctionNode): string { - const lambdaDetails = getLambdaDetails(functionNode.configuration) +function computeLambdaRoot(lambdaLocation: string, lambda: LambdaFunction): string { + const lambdaDetails = getLambdaDetails(lambda.configuration!) const normalizedLocation = pathutils.normalize(lambdaLocation) const lambdaIndex = normalizedLocation.indexOf(`/${lambdaDetails.fileName}`) diff --git a/packages/core/src/lambda/commands/editLambda.ts b/packages/core/src/lambda/commands/editLambda.ts new file mode 100644 index 00000000000..5ea8169d280 --- /dev/null +++ b/packages/core/src/lambda/commands/editLambda.ts @@ -0,0 +1,285 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ +import * as vscode from 'vscode' +import * as nls from 'vscode-nls' +import { LambdaFunctionNode } from '../explorer/lambdaFunctionNode' +import { downloadLambdaInLocation, openLambdaFile } from './downloadLambda' +import { LambdaFunction, runUploadDirectory } from './uploadLambda' +import { + compareCodeSha, + getFunctionInfo, + getLambdaDetails, + getTempLocation, + lambdaTempPath, + setFunctionInfo, +} from '../utils' +import { showConfirmationMessage } from '../../shared/utilities/messages' +import fs from '../../shared/fs/fs' +import globals from '../../shared/extensionGlobals' +import { LambdaFunctionNodeDecorationProvider } from '../explorer/lambdaFunctionNodeDecorationProvider' +import path from 'path' +import { telemetry } from '../../shared/telemetry/telemetry' +import { ToolkitError } from '../../shared/errors' +import { getFunctionWithCredentials } from '../../shared/clients/lambdaClient' +import { getLogger } from '../../shared/logger/logger' + +const localize = nls.loadMessageBundle() + +let lastPromptTime = Date.now() - 5000 + +export function watchForUpdates(lambda: LambdaFunction, projectUri: vscode.Uri): void { + const watcher = vscode.workspace.createFileSystemWatcher(new vscode.RelativePattern(projectUri, '*')) + const startTime = globals.clock.Date.now() + + watcher.onDidChange(async (fileUri) => { + await promptForSync(lambda, projectUri, fileUri) + }) + + watcher.onDidCreate(async (fileUri) => { + // When the code is downloaded and the watcher is set, this will immediately trigger the onDidCreate + // To avoid this, we must check that the file was actually created AFTER the watcher was created + if ((await fs.stat(fileUri.fsPath)).ctime < startTime) { + return + } + await promptForSync(lambda, projectUri, fileUri) + }) + + watcher.onDidDelete(async (fileUri) => { + // We don't want to sync if the whole directory has been deleted or emptied + if (fileUri.fsPath !== projectUri.fsPath) { + // Check if directory is empty before prompting for sync + try { + const entries = await fs.readdir(projectUri.fsPath) + if (entries.length > 0) { + await promptForSync(lambda, projectUri, fileUri) + } + } catch (err) { + getLogger().debug(`Failed to check Lambda directory contents: ${err}`) + } + } + }) +} + +// Creating this function for testing, can't mock the vscode.window in the tests +export async function promptDeploy() { + const confirmItem = localize('AWS.lambda.upload.sync', 'Deploy') + const cancelItem = localize('AWS.lambda.upload.noSync', 'No, thanks') + const response = await vscode.window.showInformationMessage( + localize('AWS.lambda.upload.confirmSync', 'Would you like to deploy these changes to the cloud?'), + confirmItem, + cancelItem + ) + return response === confirmItem +} + +export async function promptForSync(lambda: LambdaFunction, projectUri: vscode.Uri, fileUri: vscode.Uri) { + if (!(await fs.existsDir(projectUri.fsPath)) || globals.clock.Date.now() - lastPromptTime < 5000) { + return + } + + await setFunctionInfo(lambda, { + undeployed: true, + }) + + await LambdaFunctionNodeDecorationProvider.getInstance().addBadge( + fileUri, + vscode.Uri.from({ scheme: 'lambda', path: `${lambda.region}/${lambda.name}` }) + ) + + lastPromptTime = globals.clock.Date.now() + if (await promptDeploy()) { + await deployFromTemp(lambda, projectUri) + } +} + +export async function confirmOutdatedChanges(prompt: string): Promise { + return await showConfirmationMessage({ + prompt, + confirm: localize('AWS.lambda.upload.overwrite', 'Overwrite'), + cancel: localize('AWS.lambda.upload.noOverwrite', 'Cancel'), + }) +} + +export async function deployFromTemp(lambda: LambdaFunction, projectUri: vscode.Uri) { + return telemetry.lambda_quickDeploy.run(async () => { + const prompt = localize( + 'AWS.lambda.upload.confirmOutdatedSync', + 'There are changes to your Function in the cloud after you created this local copy, overwrite anyway?' + ) + + const isShaDifferent = !(await compareCodeSha(lambda)) + const overwriteChanges = isShaDifferent ? await confirmOutdatedChanges(prompt) : true + + if (overwriteChanges) { + // Reset the lastPrompt time because we don't want to retrigger the watcher flow + lastPromptTime = globals.clock.Date.now() + await vscode.workspace.saveAll() + try { + await runUploadDirectory(lambda, 'zip', projectUri) + } catch { + throw new ToolkitError('Failed to deploy Lambda function', { code: 'deployFailure' }) + } + await setFunctionInfo(lambda, { + lastDeployed: globals.clock.Date.now(), + undeployed: false, + }) + await LambdaFunctionNodeDecorationProvider.getInstance().removeBadge( + projectUri, + vscode.Uri.from({ scheme: 'lambda', path: `${lambda.region}/${lambda.name}` }) + ) + if (isShaDifferent) { + telemetry.record({ action: 'overwriteChanges' }) + } + } else { + telemetry.record({ action: 'cancelOverwrite' }) + } + }) +} + +export async function deleteFilesInFolder(location: string) { + const entries = await fs.readdir(location) + await Promise.all( + entries.map((entry) => fs.delete(path.join(location, entry[0]), { recursive: true, force: true })) + ) +} + +export async function editLambdaCommand(functionNode: LambdaFunctionNode) { + const region = functionNode.regionCode + const functionName = functionNode.configuration.FunctionName! + return await editLambda({ name: functionName, region, configuration: functionNode.configuration }, 'explorer') +} + +export async function overwriteChangesForEdit(lambda: LambdaFunction, downloadLocation: string) { + try { + // Clear directory contents instead of deleting to avoid Windows EBUSY errors + if (await fs.existsDir(downloadLocation)) { + await deleteFilesInFolder(downloadLocation) + } else { + await fs.mkdir(downloadLocation) + } + + await downloadLambdaInLocation(lambda, 'local', downloadLocation) + + // Watching for updates, then setting info, then removing the badges must be done in this order + // This is because the files creating can throw the watcher, which sometimes leads to changes being marked as undeployed + watchForUpdates(lambda, vscode.Uri.file(downloadLocation)) + + await setFunctionInfo(lambda, { + lastDeployed: globals.clock.Date.now(), + undeployed: false, + sha: lambda.configuration!.CodeSha256, + handlerFile: getLambdaDetails(lambda.configuration!).fileName, + }) + await LambdaFunctionNodeDecorationProvider.getInstance().removeBadge( + vscode.Uri.file(downloadLocation), + vscode.Uri.from({ scheme: 'lambda', path: `${lambda.region}/${lambda.name}` }) + ) + } catch { + throw new ToolkitError('Failed to download Lambda function', { code: 'failedDownload' }) + } +} + +export async function editLambda(lambda: LambdaFunction, source?: 'workspace' | 'explorer') { + return await telemetry.lambda_quickEditFunction.run(async () => { + telemetry.record({ source }) + const downloadLocation = getTempLocation(lambda.name, lambda.region) + + // We don't want to do anything if the folder already exists as a workspace folder, it means it's already being edited + if (vscode.workspace.workspaceFolders?.some((folder) => folder.uri.fsPath === downloadLocation)) { + return downloadLocation + } + + const prompt = localize( + 'AWS.lambda.download.confirmOutdatedSync', + 'There are changes to your function in the cloud since you last edited locally, do you want to overwrite your local changes?' + ) + + // We want to overwrite changes in the following cases: + // 1. There is no code sha locally (getCodeShaLocal returns falsy) + // 2. There is a code sha locally, it does not match the one remotely, and the user confirms they want to overwrite it + const localExists = !!(await getFunctionInfo(lambda, 'sha')) + // This record tells us if they're attempting to edit a function they've edited before + telemetry.record({ action: localExists ? 'existingEdit' : 'newEdit' }) + + const isDirectoryEmpty = (await fs.existsDir(downloadLocation)) + ? (await fs.readdir(downloadLocation)).length === 0 + : true + + const overwriteChanges = + !localExists || + isDirectoryEmpty || + (!(await compareCodeSha(lambda)) ? await confirmOutdatedChanges(prompt) : false) + + if (overwriteChanges) { + await overwriteChangesForEdit(lambda, downloadLocation) + } else if (source === 'explorer') { + // If the source is the explorer, we want to open, otherwise we just wait to open in the workspace + const lambdaLocation = path.join(downloadLocation, getLambdaDetails(lambda.configuration!).fileName) + await openLambdaFile(lambdaLocation) + watchForUpdates(lambda, vscode.Uri.file(downloadLocation)) + } + + return downloadLocation + }) +} + +export async function openLambdaFolderForEdit(name: string, region: string) { + const downloadLocation = getTempLocation(name, region) + + // Do all authentication work before opening workspace to avoid race condition + const getFunctionOutput = await getFunctionWithCredentials(region, name) + const configuration = getFunctionOutput.Configuration + + // Download and set up Lambda code before opening workspace + await editLambda( + { + name, + region, + configuration: configuration as any, + }, + 'workspace' + ) + + try { + await vscode.commands.executeCommand('vscode.openFolder', vscode.Uri.file(downloadLocation), { + newWindow: true, + noRecentEntry: true, + }) + } catch (e) { + throw new ToolkitError(`Failed to open your function as a workspace: ${e}`, { code: 'folderOpenFailure' }) + } +} + +export async function getReadme(): Promise { + const readmeSource = path.join('resources', 'markdown', 'lambdaEdit.md') + const readmeDestination = path.join(lambdaTempPath, 'README.md') + try { + const readmeContent = await fs.readFileText(globals.context.asAbsolutePath(readmeSource)) + await fs.writeFile(readmeDestination, readmeContent) + } catch (e) { + getLogger().info(`Failed to copy content for Lambda README: ${e}`) + } + + try { + const createStackIconSource = path.join('resources', 'icons', 'aws', 'lambda', 'create-stack-light.svg') + const createStackIconDestination = path.join(lambdaTempPath, 'create-stack.svg') + await fs.copy(globals.context.asAbsolutePath(createStackIconSource), createStackIconDestination) + + // Copy VS Code built-in icons + const vscodeIconPath = path.join('resources', 'icons', 'vscode', 'light') + + const invokeIconSource = path.join(vscodeIconPath, 'run.svg') + const invokeIconDestination = path.join(lambdaTempPath, 'invoke.svg') + await fs.copy(globals.context.asAbsolutePath(invokeIconSource), invokeIconDestination) + + const deployIconSource = path.join(vscodeIconPath, 'cloud-upload.svg') + const deployIconDestination = path.join(lambdaTempPath, 'deploy.svg') + await fs.copy(globals.context.asAbsolutePath(deployIconSource), deployIconDestination) + } catch (e) { + getLogger().info(`Failed to copy content for Lambda README: ${e}`) + } + + return readmeDestination +} diff --git a/packages/core/src/lambda/commands/uploadLambda.ts b/packages/core/src/lambda/commands/uploadLambda.ts index 692d07409a2..6bfd3777463 100644 --- a/packages/core/src/lambda/commands/uploadLambda.ts +++ b/packages/core/src/lambda/commands/uploadLambda.ts @@ -277,7 +277,7 @@ export class UploadLambdaWizard extends Wizard { * @param type Whether to zip or sam build the directory * @param window Wrapper around vscode.window functionality for testing */ -async function runUploadDirectory(lambda: LambdaFunction, type: 'zip' | 'sam', parentDir: vscode.Uri) { +export async function runUploadDirectory(lambda: LambdaFunction, type: 'zip' | 'sam', parentDir: vscode.Uri) { if (type === 'sam' && lambda.configuration) { return await runUploadLambdaWithSamBuild({ ...lambda, configuration: lambda.configuration }, parentDir) } else { diff --git a/packages/core/src/lambda/explorer/cloudFormationNodes.ts b/packages/core/src/lambda/explorer/cloudFormationNodes.ts index 6fd8c4d0e96..e2d9e9aae27 100644 --- a/packages/core/src/lambda/explorer/cloudFormationNodes.ts +++ b/packages/core/src/lambda/explorer/cloudFormationNodes.ts @@ -153,8 +153,7 @@ function makeCloudFormationLambdaFunctionNode( regionCode: string, configuration: Lambda.FunctionConfiguration ): LambdaFunctionNode { - const node = new LambdaFunctionNode(parent, regionCode, configuration) - node.contextValue = contextValueCloudformationLambdaFunction + const node = new LambdaFunctionNode(parent, regionCode, configuration, contextValueCloudformationLambdaFunction) return node } diff --git a/packages/core/src/lambda/explorer/lambdaFunctionFileNode.ts b/packages/core/src/lambda/explorer/lambdaFunctionFileNode.ts new file mode 100644 index 00000000000..422de99b31f --- /dev/null +++ b/packages/core/src/lambda/explorer/lambdaFunctionFileNode.ts @@ -0,0 +1,38 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import { AWSResourceNode } from '../../shared/treeview/nodes/awsResourceNode' +import { AWSTreeNodeBase } from '../../shared/treeview/nodes/awsTreeNodeBase' +import { LambdaFunctionNode } from './lambdaFunctionNode' +import { getIcon } from '../../shared/icons' +import { isCloud9 } from '../../shared/extensionUtilities' +import { LambdaFunctionFolderNode } from './lambdaFunctionFolderNode' + +export class LambdaFunctionFileNode extends AWSTreeNodeBase implements AWSResourceNode { + public constructor( + public readonly parent: LambdaFunctionNode | LambdaFunctionFolderNode, + public readonly filename: string, + public readonly path: string + ) { + super(filename) + this.iconPath = getIcon('vscode-file') + this.contextValue = 'lambdaFunctionFileNode' + this.command = !isCloud9() + ? { + command: 'aws.openLambdaFile', + title: 'Open file', + arguments: [path], + } + : undefined + } + + public get arn(): string { + return '' + } + + public get name(): string { + return '' + } +} diff --git a/packages/core/src/lambda/explorer/lambdaFunctionFolderNode.ts b/packages/core/src/lambda/explorer/lambdaFunctionFolderNode.ts new file mode 100644 index 00000000000..7c67d482666 --- /dev/null +++ b/packages/core/src/lambda/explorer/lambdaFunctionFolderNode.ts @@ -0,0 +1,60 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' +import { AWSResourceNode } from '../../shared/treeview/nodes/awsResourceNode' +import { AWSTreeNodeBase } from '../../shared/treeview/nodes/awsTreeNodeBase' +import { LambdaFunctionNode } from './lambdaFunctionNode' +import { fs } from '../../shared/fs/fs' +import { getIcon } from '../../shared/icons' +import { makeChildrenNodes } from '../../shared/treeview/utils' +import { PlaceholderNode } from '../../shared/treeview/nodes/placeholderNode' +import { localize } from 'vscode-nls' +import path from 'path' +import { LambdaFunctionFileNode } from './lambdaFunctionFileNode' + +export class LambdaFunctionFolderNode extends AWSTreeNodeBase implements AWSResourceNode { + public constructor( + public readonly parent: LambdaFunctionNode | LambdaFunctionFolderNode, + public readonly filename: string, + public readonly path: string + ) { + super(filename, vscode.TreeItemCollapsibleState.Collapsed) + this.iconPath = getIcon('vscode-folder') + this.contextValue = 'lambdaFunctionFolderNode' + } + + public get arn(): string { + return '' + } + + public get name(): string { + return '' + } + + public override async getChildren(): Promise { + return await makeChildrenNodes({ + getChildNodes: async () => this.loadFunctionFiles(), + getNoChildrenPlaceholderNode: async () => + new PlaceholderNode(this, localize('AWS.explorerNode.s3.noObjects', '[No Objects found]')), + }) + } + + public async loadFunctionFiles(): Promise { + const nodes: AWSTreeNodeBase[] = [] + const files = await fs.readdir(this.path) + for (const file of files) { + const [fileName, type] = file + const filePath = path.join(this.path, fileName) + if (type === vscode.FileType.Directory) { + nodes.push(new LambdaFunctionFolderNode(this, fileName, filePath)) + } else { + nodes.push(new LambdaFunctionFileNode(this, fileName, filePath)) + } + } + + return nodes + } +} diff --git a/packages/core/src/lambda/explorer/lambdaFunctionNode.ts b/packages/core/src/lambda/explorer/lambdaFunctionNode.ts index 02fa8439d5c..03cb9210aaa 100644 --- a/packages/core/src/lambda/explorer/lambdaFunctionNode.ts +++ b/packages/core/src/lambda/explorer/lambdaFunctionNode.ts @@ -5,26 +5,50 @@ import { Lambda } from 'aws-sdk' import * as os from 'os' +import * as vscode from 'vscode' import { getIcon } from '../../shared/icons' import { AWSResourceNode } from '../../shared/treeview/nodes/awsResourceNode' import { AWSTreeNodeBase } from '../../shared/treeview/nodes/awsTreeNodeBase' +import { editLambdaCommand } from '../commands/editLambda' +import { fs } from '../../shared/fs/fs' +import { makeChildrenNodes } from '../../shared/treeview/utils' +import { PlaceholderNode } from '../../shared/treeview/nodes/placeholderNode' +import path from 'path' +import { localize } from 'vscode-nls' +import { LambdaFunctionFolderNode } from './lambdaFunctionFolderNode' +import { LambdaFunctionFileNode } from './lambdaFunctionFileNode' + +export const contextValueLambdaFunction = 'awsRegionFunctionNode' +export const contextValueLambdaFunctionImportable = 'awsRegionFunctionNodeDownloadable' export class LambdaFunctionNode extends AWSTreeNodeBase implements AWSResourceNode { public constructor( public readonly parent: AWSTreeNodeBase, public override readonly regionCode: string, - public configuration: Lambda.FunctionConfiguration + public configuration: Lambda.FunctionConfiguration, + public override readonly contextValue?: string, + public localDir?: string ) { - super('') + super( + `${configuration.FunctionArn}`, + contextValue === contextValueLambdaFunctionImportable + ? vscode.TreeItemCollapsibleState.Collapsed + : vscode.TreeItemCollapsibleState.None + ) this.update(configuration) + this.resourceUri = vscode.Uri.from({ scheme: 'lambda', path: `${regionCode}/${configuration.FunctionName}` }) this.iconPath = getIcon('aws-lambda-function') + this.contextValue = contextValue } public update(configuration: Lambda.FunctionConfiguration): void { this.configuration = configuration this.label = this.configuration.FunctionName || '' this.tooltip = `${this.configuration.FunctionName}${os.EOL}${this.configuration.FunctionArn}` + if (this.contextValue === contextValueLambdaFunction) { + this.tooltip += `${os.EOL} This function is not downloadable` + } } public get functionName(): string { @@ -46,4 +70,35 @@ export class LambdaFunctionNode extends AWSTreeNodeBase implements AWSResourceNo return this.configuration.FunctionName } + + public override async getChildren(): Promise { + if (!(this.contextValue === contextValueLambdaFunctionImportable)) { + return [] + } + + return await makeChildrenNodes({ + getChildNodes: async () => { + const path = await editLambdaCommand(this) + return path ? this.loadFunctionFiles(path) : [] + }, + getNoChildrenPlaceholderNode: async () => + new PlaceholderNode(this, localize('AWS.explorerNode.lambda.noFiles', '[No files found]')), + }) + } + + public async loadFunctionFiles(tmpPath: string): Promise { + const nodes: AWSTreeNodeBase[] = [] + const files = await fs.readdir(tmpPath) + for (const file of files) { + const [fileName, type] = file + const filePath = path.join(tmpPath, fileName) + if (type === vscode.FileType.Directory) { + nodes.push(new LambdaFunctionFolderNode(this, fileName, filePath)) + } else { + nodes.push(new LambdaFunctionFileNode(this, fileName, filePath)) + } + } + + return nodes + } } diff --git a/packages/core/src/lambda/explorer/lambdaFunctionNodeDecorationProvider.ts b/packages/core/src/lambda/explorer/lambdaFunctionNodeDecorationProvider.ts new file mode 100644 index 00000000000..b31de940991 --- /dev/null +++ b/packages/core/src/lambda/explorer/lambdaFunctionNodeDecorationProvider.ts @@ -0,0 +1,107 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ +import * as vscode from 'vscode' +import { fs } from '../../shared/fs/fs' +import path from 'path' +import { getFunctionInfo } from '../utils' +import { LambdaFunction } from '../commands/uploadLambda' + +export class LambdaFunctionNodeDecorationProvider implements vscode.FileDecorationProvider { + // Make it a singleton so that it's easier to access + private static instance: LambdaFunctionNodeDecorationProvider + private readonly _onDidChangeFileDecorations = new vscode.EventEmitter() + readonly onDidChangeFileDecorations = this._onDidChangeFileDecorations.event + + private constructor() {} + + public static getInstance(): LambdaFunctionNodeDecorationProvider { + if (!LambdaFunctionNodeDecorationProvider.instance) { + LambdaFunctionNodeDecorationProvider.instance = new LambdaFunctionNodeDecorationProvider() + } + return LambdaFunctionNodeDecorationProvider.instance + } + + async provideFileDecoration(uri: vscode.Uri): Promise { + const badge = { + badge: 'M', + color: new vscode.ThemeColor('gitDecoration.modifiedResourceForeground'), + tooltip: 'This function has undeployed changes', + propagate: true, + } + + if (uri.scheme === 'lambda') { + const [region, name] = uri.path.split('/') + const lambda: LambdaFunction = { region, name } + if (await getFunctionInfo(lambda, 'undeployed')) { + badge.propagate = false + return badge + } + } else { + try { + const lambda = this.getLambdaFromPath(uri) + if (lambda && (await this.isFileModifiedAfterDeployment(uri.fsPath, lambda))) { + return badge + } + } catch { + return undefined + } + } + } + + public async addBadge(fileUri: vscode.Uri, functionUri: vscode.Uri) { + this._onDidChangeFileDecorations.fire(vscode.Uri.file(fileUri.fsPath)) + this._onDidChangeFileDecorations.fire(functionUri) + } + + public async removeBadge(fileUri: vscode.Uri, functionUri: vscode.Uri) { + // We need to propagate the badge removal down to all files in the dir + for (const path of await this.getFilePaths(fileUri.fsPath)) { + const subUri = vscode.Uri.file(path) + this._onDidChangeFileDecorations.fire(subUri) + } + this._onDidChangeFileDecorations.fire(functionUri) + } + + private async getFilePaths(basePath: string) { + const files = await fs.readdir(basePath) + const subFiles: string[] = [basePath] + for (const file of files) { + const [fileName, type] = file + const filePath = path.join(basePath, fileName) + if (type === vscode.FileType.Directory) { + subFiles.push(...(await this.getFilePaths(filePath))) + } else { + subFiles.push(filePath) + } + } + + return subFiles + } + + private getLambdaFromPath(uri: vscode.Uri): LambdaFunction { + const pathParts = uri.fsPath.split(path.sep) + const lambdaIndex = pathParts.indexOf('lambda') + if (lambdaIndex === -1 || lambdaIndex + 2 >= pathParts.length) { + throw new Error('Invalid path') + } + const region = pathParts[lambdaIndex + 1] + const name = pathParts[lambdaIndex + 2] + return { region, name } + } + + private async isFileModifiedAfterDeployment(filePath: string, lambda: LambdaFunction): Promise { + try { + const { lastDeployed, undeployed } = await getFunctionInfo(lambda) + if (!lastDeployed || !undeployed) { + return false + } + + const fileStat = await fs.stat(filePath) + return fileStat.mtime > lastDeployed + } catch { + return false + } + } +} diff --git a/packages/core/src/lambda/explorer/lambdaNodes.ts b/packages/core/src/lambda/explorer/lambdaNodes.ts index 9adff42f04d..077572feda7 100644 --- a/packages/core/src/lambda/explorer/lambdaNodes.ts +++ b/packages/core/src/lambda/explorer/lambdaNodes.ts @@ -15,12 +15,13 @@ import { PlaceholderNode } from '../../shared/treeview/nodes/placeholderNode' import { makeChildrenNodes } from '../../shared/treeview/utils' import { toArrayAsync, toMap, updateInPlace } from '../../shared/utilities/collectionUtils' import { listLambdaFunctions } from '../utils' -import { LambdaFunctionNode } from './lambdaFunctionNode' +import { + contextValueLambdaFunction, + contextValueLambdaFunctionImportable, + LambdaFunctionNode, +} from './lambdaFunctionNode' import { samLambdaImportableRuntimes } from '../models/samLambdaRuntime' -export const contextValueLambdaFunction = 'awsRegionFunctionNode' -export const contextValueLambdaFunctionImportable = 'awsRegionFunctionNodeDownloadable' - /** * An AWS Explorer node representing the Lambda Service. * Contains Lambda Functions for a specific region as child nodes. @@ -70,10 +71,10 @@ function makeLambdaFunctionNode( regionCode: string, configuration: Lambda.FunctionConfiguration ): LambdaFunctionNode { - const node = new LambdaFunctionNode(parent, regionCode, configuration) - node.contextValue = samLambdaImportableRuntimes.contains(node.configuration.Runtime ?? '') + const contextValue = samLambdaImportableRuntimes.contains(configuration.Runtime ?? '') ? contextValueLambdaFunctionImportable : contextValueLambdaFunction + const node = new LambdaFunctionNode(parent, regionCode, configuration, contextValue) return node } diff --git a/packages/core/src/lambda/models/samLambdaRuntime.ts b/packages/core/src/lambda/models/samLambdaRuntime.ts index 58311474d41..06e35dbcd2b 100644 --- a/packages/core/src/lambda/models/samLambdaRuntime.ts +++ b/packages/core/src/lambda/models/samLambdaRuntime.ts @@ -68,7 +68,7 @@ export const javaRuntimes: ImmutableSet = ImmutableSet([ 'java21', ]) export const dotNetRuntimes: ImmutableSet = ImmutableSet(['dotnet6', 'dotnet8']) -export const rubyRuntimes: ImmutableSet = ImmutableSet(['ruby3.2', 'ruby3.3']) +export const rubyRuntimes: ImmutableSet = ImmutableSet(['ruby3.2', 'ruby3.3', 'ruby3.4']) /** * Deprecated runtimes can be found at https://docs.aws.amazon.com/lambda/latest/dg/runtime-support-policy.html @@ -99,6 +99,16 @@ const defaultRuntimes = ImmutableMap([ [RuntimeFamily.Ruby, 'ruby3.3'], ]) +export const mapFamilyToDebugType = ImmutableMap([ + [RuntimeFamily.NodeJS, 'node'], + [RuntimeFamily.Python, 'python'], + [RuntimeFamily.DotNet, 'csharp'], + [RuntimeFamily.Go, 'go'], + [RuntimeFamily.Java, 'java'], + [RuntimeFamily.Ruby, 'ruby'], + [RuntimeFamily.Unknown, 'unknown'], +]) + export const samZipLambdaRuntimes: ImmutableSet = ImmutableSet.union([ nodeJsRuntimes, pythonRuntimes, @@ -125,7 +135,11 @@ export const samArmLambdaRuntimes: ImmutableSet = ImmutableSet const cloud9SupportedRuntimes: ImmutableSet = ImmutableSet.union([nodeJsRuntimes, pythonRuntimes]) // only interpreted languages are importable as compiled languages won't provide a useful artifact for editing. -export const samLambdaImportableRuntimes: ImmutableSet = ImmutableSet.union([nodeJsRuntimes, pythonRuntimes]) +export const samLambdaImportableRuntimes: ImmutableSet = ImmutableSet.union([ + nodeJsRuntimes, + pythonRuntimes, + rubyRuntimes, +]) export function samLambdaCreatableRuntimes(cloud9: boolean = isCloud9()): ImmutableSet { return cloud9 ? cloud9SupportedRuntimes : samZipLambdaRuntimes diff --git a/packages/core/src/lambda/remoteDebugging/ldkClient.ts b/packages/core/src/lambda/remoteDebugging/ldkClient.ts new file mode 100644 index 00000000000..915e150b039 --- /dev/null +++ b/packages/core/src/lambda/remoteDebugging/ldkClient.ts @@ -0,0 +1,470 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' +import { IoTSecureTunneling, Lambda } from 'aws-sdk' +import { getClientId } from '../../shared/telemetry/util' +import { DefaultLambdaClient } from '../../shared/clients/lambdaClient' +import { LocalProxy } from './localProxy' +import globals from '../../shared/extensionGlobals' +import { getLogger } from '../../shared/logger/logger' +import { getIoTSTClientWithAgent, getLambdaClientWithAgent } from './utils' +import { ToolkitError } from '../../shared/errors' +import * as nls from 'vscode-nls' + +const localize = nls.loadMessageBundle() + +export function isTunnelInfo(data: TunnelInfo): data is TunnelInfo { + return ( + typeof data === 'object' && + data !== null && + typeof data.tunnelID === 'string' && + typeof data.sourceToken === 'string' && + typeof data.destinationToken === 'string' + ) +} + +interface TunnelInfo { + tunnelID: string + sourceToken: string + destinationToken: string +} + +async function callUpdateFunctionConfiguration( + lambda: DefaultLambdaClient, + config: Lambda.FunctionConfiguration, + waitForUpdate: boolean +): Promise { + // Update function configuration back to original values + return await lambda.updateFunctionConfiguration( + { + FunctionName: config.FunctionName!, + Timeout: config.Timeout, + Layers: config.Layers?.map((layer) => layer.Arn!).filter(Boolean) || [], + Environment: { + Variables: config.Environment?.Variables ?? {}, + }, + }, + { + maxRetries: 5, + initialDelayMs: 2000, + backoffMultiplier: 2, + waitForUpdate: waitForUpdate, + } + ) +} + +export class LdkClient { + static #instance: LdkClient + private localProxy: LocalProxy | undefined + private static instanceCreating = false + private lambdaClientCache: Map = new Map() + private iotSTClientCache: Map = new Map() + + constructor() {} + + public static get instance() { + if (this.#instance !== undefined) { + return this.#instance + } + if (this.instanceCreating) { + getLogger().warn( + localize( + 'AWS.lambda.ldkClient.multipleInstancesError', + 'Attempt to create multiple LdkClient instances simultaneously' + ) + ) + } + // Set flag to prevent recursive instance creation + this.instanceCreating = true + try { + const self = (this.#instance = new this()) + return self + } finally { + this.instanceCreating = false + } + } + + /** + * Get or create a cached Lambda client for the specified region + */ + private getLambdaClient(region: string): DefaultLambdaClient { + if (!this.lambdaClientCache.has(region)) { + this.lambdaClientCache.set(region, getLambdaClientWithAgent(region)) + } + return this.lambdaClientCache.get(region)! + } + + private async getIoTSTClient(region: string): Promise { + if (!this.iotSTClientCache.has(region)) { + this.iotSTClientCache.set(region, await getIoTSTClientWithAgent(region)) + } + return this.iotSTClientCache.get(region)! + } + /** + * Clean up all resources held by this client + * Should be called when the extension is deactivated + */ + public dispose(): void { + if (this.localProxy) { + this.localProxy.stop() + this.localProxy = undefined + } + // Clear the Lambda client cache + this.iotSTClientCache.clear() + this.lambdaClientCache.clear() + } + + // Create or reuse tunnel + async createOrReuseTunnel(region: string): Promise { + try { + // Get VSCode UUID using getClientId from telemetry.utils.ts + const vscodeUuid = getClientId(globals.globalState) + + // Create IoTSecureTunneling client + const iotSecureTunneling = await this.getIoTSTClient(region) + + // Define tunnel identifier + const tunnelIdentifier = `RemoteDebugging+${vscodeUuid}` + const timeoutInMinutes = 720 + // List existing tunnels + const listTunnelsResponse = await iotSecureTunneling.listTunnels({}).promise() + + // Find tunnel with our identifier + const existingTunnel = listTunnelsResponse.tunnelSummaries?.find( + (tunnel) => tunnel.description === tunnelIdentifier && tunnel.status?.toLowerCase() === 'open' + ) + + if (existingTunnel && existingTunnel.tunnelId) { + const timeCreated = existingTunnel?.createdAt ? new Date(existingTunnel.createdAt) : new Date() + const expiryTime = new Date(timeCreated.getTime() + timeoutInMinutes * 60 * 1000) + const currentTime = new Date() + const minutesRemaining = (expiryTime.getTime() - currentTime.getTime()) / (60 * 1000) + + if (minutesRemaining >= 15) { + // Rotate access tokens for the existing tunnel + const rotateResponse = await this.refreshTunnelTokens(existingTunnel.tunnelId, region) + + return rotateResponse + } else { + // Close tunnel if less than 15 minutes remaining + await iotSecureTunneling + .closeTunnel({ + tunnelId: existingTunnel.tunnelId, + delete: false, + }) + .promise() + + getLogger().info(`Closed tunnel ${existingTunnel.tunnelId} with less than 15 minutes remaining`) + } + } + + // Create new tunnel + const openTunnelResponse = await iotSecureTunneling + .openTunnel({ + description: tunnelIdentifier, + timeoutConfig: { + maxLifetimeTimeoutMinutes: timeoutInMinutes, // 12 hours + }, + destinationConfig: { + services: ['WSS'], + }, + }) + .promise() + + getLogger().info(`Created new tunnel with ID: ${openTunnelResponse.tunnelId}`) + + return { + tunnelID: openTunnelResponse.tunnelId || '', + sourceToken: openTunnelResponse.sourceAccessToken || '', + destinationToken: openTunnelResponse.destinationAccessToken || '', + } + } catch (error) { + throw ToolkitError.chain(error, 'Error creating/reusing tunnel') + } + } + + // Refresh tunnel tokens + async refreshTunnelTokens(tunnelId: string, region: string): Promise { + try { + const iotSecureTunneling = await this.getIoTSTClient(region) + const rotateResponse = await iotSecureTunneling + .rotateTunnelAccessToken({ + tunnelId: tunnelId, + clientMode: 'ALL', + }) + .promise() + + return { + tunnelID: tunnelId, + sourceToken: rotateResponse.sourceAccessToken || '', + destinationToken: rotateResponse.destinationAccessToken || '', + } + } catch (error) { + throw ToolkitError.chain(error, 'Error refreshing tunnel tokens') + } + } + + async getFunctionDetail(functionArn: string): Promise { + try { + const region = getRegionFromArn(functionArn) + if (!region) { + getLogger().error( + localize( + 'AWS.lambda.ldkClient.couldNotDetermineRegion', + 'Could not determine region from Lambda ARN' + ) + ) + return undefined + } + const client = this.getLambdaClient(region) + const configuration = (await client.getFunction(functionArn)).Configuration as Lambda.FunctionConfiguration + // get function detail + // return function detail + return configuration + } catch (error) { + getLogger().warn(`Error getting function detail:${error}`) + return undefined + } + } + + // Create debug deployment to given lambda function + // save a snapshot of the current config to global : aws.lambda.remoteDebugContext + // we are 1: changing function timeout to 15 minute + // 2: adding the ldk layer LDK_LAYER_ARN_X86_64 or LDK_LAYER_ARN_ARM64 (ignore if already added, fail if 5 layer already there) + // 3: adding two param to lambda environment variable + // {AWS_LAMBDA_EXEC_WRAPPER:/opt/bin/ldk_wrapper, AWS_LDK_DESTINATION_TOKEN: destinationToken } + async createDebugDeployment( + config: Lambda.FunctionConfiguration, + destinationToken: string, + lambdaTimeout: number, + shouldPublishVersion: boolean, + ldkLayerArn: string, + progress: vscode.Progress<{ message?: string | undefined; increment?: number | undefined }> + ): Promise { + try { + if (!config.FunctionArn || !config.FunctionName) { + throw new Error(localize('AWS.lambda.ldkClient.functionArnMissing', 'Function ARN is missing')) + } + const region = getRegionFromArn(config.FunctionArn ?? '') + if (!region) { + throw new Error( + localize( + 'AWS.lambda.ldkClient.couldNotDetermineRegion', + 'Could not determine region from Lambda ARN' + ) + ) + } + + // fix out of bound timeout + if (lambdaTimeout && (lambdaTimeout > 900 || lambdaTimeout <= 0)) { + lambdaTimeout = 900 + } + + // Inform user about the changes that will be made + + progress.report({ message: localize('AWS.lambda.ldkClient.applyingChanges', 'Applying changes...') }) + + // Determine architecture and select appropriate layer + + const layers = config.Layers || [] + + // Check if LDK layer is already added + const ldkLayerExists = layers.some( + (layer) => layer.Arn?.includes('LDKLayerX86') || layer.Arn?.includes('LDKLayerArm64') + ) + + // Check if we have room to add a layer (max 5) + if (!ldkLayerExists && layers.length >= 5) { + throw new Error( + localize( + 'AWS.lambda.ldkClient.cannotAddLdkLayer', + 'Cannot add LDK layer: Lambda function already has 5 layers' + ) + ) + } + // Create updated layers list + const updatedLayers = ldkLayerExists + ? layers.map((layer) => layer.Arn!).filter(Boolean) + : [...layers.map((layer) => layer.Arn!).filter(Boolean), ldkLayerArn] + + // Create updated environment variables + const currentEnv = config.Environment?.Variables || {} + const updatedEnv: { [key: string]: string } = { + ...currentEnv, + AWS_LAMBDA_EXEC_WRAPPER: '/opt/bin/ldk_wrapper', + AWS_LAMBDA_DEBUG_ON_LATEST: shouldPublishVersion ? 'false' : 'true', + AWS_LDK_DESTINATION_TOKEN: destinationToken, + } + if (currentEnv['AWS_LAMBDA_EXEC_WRAPPER']) { + updatedEnv.ORIGINAL_AWS_LAMBDA_EXEC_WRAPPER = currentEnv['AWS_LAMBDA_EXEC_WRAPPER'] + } + + // Create Lambda client using AWS SDK + const lambda = this.getLambdaClient(region) + + // Update function configuration + if (!config.FunctionArn || !config.FunctionName) { + throw new Error('Function ARN is missing') + } + + // Create a temporary config for the update + const updateConfig: Lambda.FunctionConfiguration = { + FunctionName: config.FunctionName, + Timeout: lambdaTimeout ?? 900, // 15 minutes + Layers: updatedLayers.map((arn) => ({ Arn: arn })), + Environment: { + Variables: updatedEnv, + }, + } + + await callUpdateFunctionConfiguration(lambda, updateConfig, true) + + // publish version + let version = '$Latest' + if (shouldPublishVersion) { + // should somehow return version for debugging + const versionResp = await lambda.publishVersion(config.FunctionName, { waitForUpdate: true }) + version = versionResp.Version ?? '' + // remove debug deployment in a non-blocking way + void Promise.resolve( + callUpdateFunctionConfiguration(lambda, config, false).then(() => { + progress.report({ + message: localize( + 'AWS.lambda.ldkClient.debugDeploymentCompleted', + 'Debug deployment completed successfully' + ), + }) + }) + ) + } + return version + } catch (error) { + getLogger().error(`Error creating debug deployment: ${error}`) + if (error instanceof Error) { + throw new ToolkitError(`Failed to create debug deployment: ${error.message}`) + } + return 'Failed' + } + } + + // Remove debug deployment from the given lambda function + // use the snapshot we took before create debug deployment + // we are 1: reverting timeout to it's original snapshot + // 2: reverting layer status according to it's original snapshot + // 3: reverting environment back to it's original snapshot + async removeDebugDeployment(config: Lambda.FunctionConfiguration, check: boolean = true): Promise { + try { + if (!config.FunctionArn || !config.FunctionName) { + throw new Error('Function ARN is missing') + } + const region = getRegionFromArn(config.FunctionArn ?? '') + if (!region) { + throw new Error('Could not determine region from Lambda ARN') + } + + if (check) { + const currentConfig = await this.getFunctionDetail(config.FunctionArn) + if ( + currentConfig?.Timeout === config?.Timeout && + currentConfig?.Layers?.length === config?.Layers?.length + ) { + // nothing to remove + return true + } + } + + // Create Lambda client using AWS SDK + const lambda = this.getLambdaClient(region) + + // Update function configuration back to original values + await callUpdateFunctionConfiguration(lambda, config, false) + + return true + } catch (error) { + // no need to raise, even this failed we want the following to execute + throw ToolkitError.chain(error, 'Error removing debug deployment') + } + } + + async deleteDebugVersion(functionArn: string, qualifier: string) { + try { + const region = getRegionFromArn(functionArn) + if (!region) { + throw new Error('Could not determine region from Lambda ARN') + } + const lambda = this.getLambdaClient(region) + await lambda.deleteFunction(functionArn, qualifier) + return true + } catch (error) { + getLogger().error('Error deleting debug version: %O', error) + return false + } + } + + // Start proxy with better resource management + async startProxy(region: string, sourceToken: string, port: number = 0): Promise { + try { + getLogger().info(`Starting direct proxy for region:${region}`) + + // Clean up any existing proxy thoroughly + if (this.localProxy) { + getLogger().info('Stopping existing proxy before starting a new one') + this.localProxy.stop() + this.localProxy = undefined + + // Small delay to ensure resources are released + await new Promise((resolve) => setTimeout(resolve, 100)) + } + + // Create and start a new local proxy + this.localProxy = new LocalProxy() + + // Start the proxy and get the assigned port + const localPort = await this.localProxy.start(region, sourceToken, port) + getLogger().info(`Local proxy started successfully on port ${localPort}`) + return true + } catch (error) { + getLogger().error(`Failed to start proxy: ${error}`) + if (this.localProxy) { + this.localProxy.stop() + this.localProxy = undefined + } + throw ToolkitError.chain(error, 'Failed to start proxy') + } + } + + // Stop proxy with proper cleanup and reference handling + async stopProxy(): Promise { + try { + getLogger().info(`Stopping proxy`) + + if (this.localProxy) { + // Ensure proper resource cleanup + this.localProxy.stop() + + // Force delete the reference to allow GC + this.localProxy = undefined + + getLogger().info('Local proxy stopped successfully') + } else { + getLogger().info('No active local proxy to stop') + } + + return true + } catch (error) { + throw ToolkitError.chain(error, 'Error stopping proxy') + } + } +} + +// Helper function to extract region from ARN +export function getRegionFromArn(arn: string | undefined): string | undefined { + if (!arn) { + return undefined + } + const parts = arn.split(':') + return parts.length >= 4 ? parts[3] : undefined +} diff --git a/packages/core/src/lambda/remoteDebugging/ldkController.ts b/packages/core/src/lambda/remoteDebugging/ldkController.ts new file mode 100644 index 00000000000..55a777fdc3d --- /dev/null +++ b/packages/core/src/lambda/remoteDebugging/ldkController.ts @@ -0,0 +1,785 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' +import { getLogger } from '../../shared/logger/logger' +import globals from '../../shared/extensionGlobals' +import { Lambda } from 'aws-sdk' +import { getRegionFromArn, isTunnelInfo, LdkClient } from './ldkClient' +import { getFamily, mapFamilyToDebugType } from '../models/samLambdaRuntime' +import { findJavaPath } from '../../shared/utilities/pathFind' +import { ToolkitError } from '../../shared/errors' +import { showConfirmationMessage, showMessage } from '../../shared/utilities/messages' +import { telemetry } from '../../shared/telemetry/telemetry' +import * as nls from 'vscode-nls' +import { getRemoteDebugLayer } from './ldkLayers' +import path from 'path' +import { glob } from 'glob' +import { Commands } from '../../shared/vscode/commands2' + +const localize = nls.loadMessageBundle() +const logger = getLogger() +export const remoteDebugContextString = 'aws.lambda.remoteDebugContext' +export const remoteDebugSnapshotString = 'aws.lambda.remoteDebugSnapshot' + +// Map debug types to their corresponding VS Code extension IDs +const mapDebugTypeToExtensionId = new Map([ + ['python', ['ms-python.python']], + ['java', ['redhat.java', 'vscjava.vscode-java-debug']], + ['node', ['ms-vscode.js-debug']], +]) + +const mapExtensionToBackup = new Map([['ms-vscode.js-debug', 'ms-vscode.js-debug-nightly']]) + +export interface DebugConfig { + functionArn: string + functionName: string + port: number + localRoot: string + remoteRoot: string + skipFiles: string[] + shouldPublishVersion: boolean + lambdaRuntime?: string // Lambda runtime (e.g., nodejs18.x) + debuggerRuntime?: string // VS Code debugger runtime (e.g., node) + outFiles?: string[] + sourceMap?: boolean + justMyCode?: boolean + projectName?: string + otherDebugParams?: string + lambdaTimeout?: number + layerArn?: string + handlerFile?: string +} + +// Helper function to create a human-readable diff message +function createDiffMessage( + config: Lambda.FunctionConfiguration, + currentConfig: Lambda.FunctionConfiguration, + isRevert: boolean = true +): string { + let message = isRevert ? 'The following changes will be reverted:\n\n' : 'The following changes will be made:\n\n' + + message += + '1. Timeout: ' + + (currentConfig.Timeout || 'default') + + ' seconds → ' + + (config.Timeout || 'default') + + ' seconds\n' + + message += '2. Layers: ' + const hasLdkLayer = currentConfig.Layers?.some( + (layer) => layer.Arn?.includes('LDKLayerX86') || layer.Arn?.includes('LDKLayerArm64') + ) + + message += hasLdkLayer ? 'Remove LDK layer\n' : 'No Change\n' + + message += '3. Environment Variables: Remove AWS_LAMBDA_EXEC_WRAPPER and AWS_LDK_DESTINATION_TOKEN\n' + + return message +} + +/** + * Attempts to revert an existing debug configuration if one exists + * @returns true if revert was successful or no config exists, false if revert failed or user chose not to revert + */ +export async function revertExistingConfig(): Promise { + try { + // Check if a debug context exists from a previous session + const savedConfig = getLambdaSnapshot() + + if (!savedConfig) { + // No existing config to revert + return true + } + + // clear the snapshot for it's corrupted + if (!savedConfig.FunctionArn || !savedConfig.FunctionName) { + logger.error('Function ARN or Function Name is missing, cannot revert') + void (await persistLambdaSnapshot(undefined)) + return true + } + + // compare with current config + const currentConfig = await LdkClient.instance.getFunctionDetail(savedConfig.FunctionArn) + // could be permission issues, or user has deleted previous function, we should remove the snapshot + if (!currentConfig) { + logger.error('Failed to get current function state, cannot revert') + void (await persistLambdaSnapshot(undefined)) + return true + } + + if ( + currentConfig?.Timeout === savedConfig?.Timeout && + currentConfig?.Layers?.length === savedConfig?.Layers?.length + ) { + // No changes needed, remove the snapshot + void (await persistLambdaSnapshot(undefined)) + return true + } + + // Create a diff message to show what will be changed + const diffMessage = currentConfig + ? createDiffMessage(savedConfig, currentConfig, true) + : 'Failed to get current function state' + + const response = await showConfirmationMessage({ + prompt: localize( + 'AWS.lambda.remoteDebug.revertPreviousDeployment', + 'A previous debug deployment was detected for {0}. Would you like to revert those changes before proceeding?\n\n{1}', + savedConfig.FunctionName, + diffMessage + ), + confirm: localize('AWS.lambda.remoteDebug.revert', 'Revert'), + cancel: localize('AWS.lambda.remoteDebug.dontShowAgain', "Don't show again"), + type: 'warning', + }) + + if (!response) { + // User chose not to revert, remove the snapshot + void (await persistLambdaSnapshot(undefined)) + return true + } + + await LdkClient.instance.removeDebugDeployment(savedConfig, false) + await persistLambdaSnapshot(undefined) + void showMessage( + 'info', + localize( + 'AWS.lambda.remoteDebug.successfullyReverted', + 'Successfully reverted changes to {0}', + savedConfig.FunctionName + ) + ) + + return true + } catch (error) { + throw ToolkitError.chain(error, `Error in revertExistingConfig`) + } +} + +export async function activateRemoteDebugging(): Promise { + try { + globals.context.subscriptions.push( + Commands.register('aws.lambda.remoteDebugging.clearSnapshot', async () => { + void (await persistLambdaSnapshot(undefined)) + }) + ) + } catch (error) { + logger.error(`Error in registering clearSnapshot command:${error}`) + } + + try { + logger.info('Remote debugging is initiated') + + // Use the revertExistingConfig function to handle any existing debug configurations + await revertExistingConfig() + + // Initialize RemoteDebugController to ensure proper startup state + RemoteDebugController.instance.ensureCleanState() + } catch (error) { + // show warning + void vscode.window.showWarningMessage(`Error in activateRemoteDebugging: ${error}`) + logger.error(`Error in activateRemoteDebugging:${error}`) + } +} + +// this should be called when the debug session is started +async function persistLambdaSnapshot(config: Lambda.FunctionConfiguration | undefined): Promise { + try { + await globals.globalState.update(remoteDebugSnapshotString, config) + } catch (error) { + // TODO raise toolkit error + logger.error(`Error persisting debug sessions:${error}`) + } +} + +export function getLambdaSnapshot(): Lambda.FunctionConfiguration | undefined { + return globals.globalState.get(remoteDebugSnapshotString) +} + +/** + * Helper function to check if a string is a valid VSCode glob pattern + */ +function isVscodeGlob(pattern: string): boolean { + // Check for common glob patterns: *, **, ?, [], {} + return /[*?[\]{}]/.test(pattern) +} + +/** + * Helper function to validate source map files exist for given outFiles patterns + */ +async function validateSourceMapFiles(outFiles: string[]): Promise { + const allAreGlobs = outFiles.every((pattern) => isVscodeGlob(pattern)) + if (!allAreGlobs) { + return false + } + + try { + let jsfileCount = 0 + let mapfileCount = 0 + const jsFiles = await glob(outFiles, { ignore: 'node_modules/**' }) + + for (const file of jsFiles) { + if (file.includes('js')) { + jsfileCount += 1 + } + if (file.includes('.map')) { + mapfileCount += 1 + } + } + + return jsfileCount === 0 || mapfileCount === 0 ? false : true + } catch (error) { + getLogger().warn(`Error validating source map files: ${error}`) + return false + } +} + +function processOutFiles(outFiles: string[], localRoot: string): string[] { + const processedOutFiles: string[] = [] + + for (let outFile of outFiles) { + if (!outFile.includes('*')) { + // add * in the end + outFile = path.join(outFile, '*') + } + if (!path.isAbsolute(outFile)) { + // Find which workspace contains the localRoot path + const workspaceFolders = vscode.workspace.workspaceFolders + if (workspaceFolders) { + let matchingWorkspace: vscode.WorkspaceFolder | undefined + + // Check if localRoot is within any workspace + for (const workspace of workspaceFolders) { + const absoluteLocalRoot = path.resolve(localRoot) + const workspacePath = workspace.uri.fsPath + + if (absoluteLocalRoot.startsWith(workspacePath)) { + matchingWorkspace = workspace + break + } + } + + if (matchingWorkspace) { + // Join workspace folder with the relative outFile path + processedOutFiles.push(path.join(matchingWorkspace.uri.fsPath, outFile)) + } else { + // If no matching workspace found, use the original outFile + processedOutFiles.push(outFile) + } + } else { + // No workspace folders, use the original outFile + processedOutFiles.push(outFile) + } + } else { + // Already absolute path, use as is + processedOutFiles.push(outFile) + } + } + return processedOutFiles +} + +async function getVscodeDebugConfig( + functionConfig: Lambda.FunctionConfiguration, + debugConfig: DebugConfig +): Promise { + // Parse and validate otherDebugParams if provided + let additionalParams: Record = {} + if (debugConfig.otherDebugParams) { + try { + const parsed = JSON.parse(debugConfig.otherDebugParams) + if (typeof parsed === 'object' && !Array.isArray(parsed)) { + additionalParams = parsed + getLogger().info('Additional debug parameters parsed successfully: %O ', additionalParams) + } else { + void vscode.window.showWarningMessage( + localize( + 'AWS.lambda.remoteDebug.invalidDebugParams', + 'Other Debug Parameters must be a valid JSON object. The parameter will be ignored.' + ) + ) + getLogger().warn(`Invalid otherDebugParams format: expected object, got ${typeof parsed}`) + } + } catch (error) { + void vscode.window.showWarningMessage( + localize( + 'AWS.lambda.remoteDebug.failedToParseDebugParams', + 'Failed to parse Other Debug Parameters as JSON: {0}. The parameter will be ignored.', + error instanceof Error ? error.message : 'Invalid JSON' + ) + ) + getLogger().warn(`Failed to parse otherDebugParams as JSON: ${error}`) + } + } + + const debugSessionName = `Debug ${functionConfig.FunctionArn!.split(':').pop()}` + + // Define debugConfig before the try block + const debugType = mapFamilyToDebugType.get(getFamily(functionConfig.Runtime ?? ''), 'unknown') + let vsCodeDebugConfig: vscode.DebugConfiguration + switch (debugType) { + case 'node': + // source map support + if (debugConfig.sourceMap && debugConfig.outFiles) { + // process outFiles first, if they are relative path (not starting with /), + // check local root path is located in which workspace. Then join workspace Folder with outFiles + + // Update debugConfig with processed outFiles + debugConfig.outFiles = processOutFiles(debugConfig.outFiles, debugConfig.localRoot) + + // Use glob to search if there are any matching js file or source map file + const hasSourceMaps = await validateSourceMapFiles(debugConfig.outFiles) + + if (hasSourceMaps) { + // support mapping common sam cli location + additionalParams['sourceMapPathOverrides'] = { + ...additionalParams['sourceMapPathOverrides'], + '?:*/T/?:*/*': path.join(debugConfig.localRoot, '*'), + } + debugConfig.localRoot = debugConfig.outFiles[0].split('*')[0] + } else { + debugConfig.sourceMap = false + debugConfig.outFiles = undefined + await showMessage( + 'warn', + localize( + 'AWS.lambda.remoteDebug.outFileNotFound', + 'outFiles not valid or no js and map file found in outFiles, debug will continue without sourceMap support' + ) + ) + } + } + vsCodeDebugConfig = { + type: debugType, + request: 'attach', + name: debugSessionName, + address: 'localhost', + port: debugConfig.port, + localRoot: debugConfig.localRoot, + remoteRoot: debugConfig.remoteRoot, + skipFiles: debugConfig.skipFiles, + sourceMaps: debugConfig.sourceMap, + outFiles: debugConfig.outFiles, + continueOnAttach: debugConfig.outFiles ? false : true, + stopOnEntry: false, + timeout: 60000, + ...additionalParams, // Merge additional debug parameters + } + break + case 'python': + vsCodeDebugConfig = { + type: debugType, + request: 'attach', + name: debugSessionName, + port: debugConfig.port, + cwd: debugConfig.localRoot, + pathMappings: [ + { + localRoot: debugConfig.localRoot, + remoteRoot: debugConfig.remoteRoot, + }, + ], + justMyCode: debugConfig.justMyCode ?? true, + ...additionalParams, // Merge additional debug parameters + } + break + case 'java': + vsCodeDebugConfig = { + type: debugType, + request: 'attach', + name: debugSessionName, + hostName: 'localhost', + port: debugConfig.port, + sourcePaths: [debugConfig.localRoot], + projectName: debugConfig.projectName, + timeout: 60000, + ...additionalParams, // Merge additional debug parameters + } + break + default: + throw new ToolkitError(`Unsupported debug type: ${debugType}`) + } + getLogger().info('VS Code debug configuration: %O', vsCodeDebugConfig) + return vsCodeDebugConfig +} + +export class RemoteDebugController { + static #instance: RemoteDebugController + isDebugging: boolean = false + qualifier: string | undefined = undefined + private lastDebugStartTime: number = 0 + // private debugSession: DebugSession | undefined + private debugSessionDisposables: Map = new Map() + + public static get instance() { + if (this.#instance !== undefined) { + return this.#instance + } + + const self = (this.#instance = new this()) + return self + } + + constructor() {} + + /** + * Ensures the controller is in a clean state at startup or before a new operation + */ + public ensureCleanState(): void { + this.isDebugging = false + this.qualifier = undefined + + // Clean up any leftover disposables + for (const [key, disposable] of this.debugSessionDisposables.entries()) { + try { + disposable.dispose() + } catch (e) { + // Ignore errors during startup cleanup + } + this.debugSessionDisposables.delete(key) + } + } + + public supportCodeDownload(runtime: string | undefined): boolean { + if (!runtime) { + return false + } + try { + return ['node', 'python'].includes(mapFamilyToDebugType.get(getFamily(runtime)) ?? '') + } catch { + // deprecated runtime + return false + } + } + + public supportRuntimeRemoteDebug(runtime: string | undefined): boolean { + if (!runtime) { + return false + } + try { + return ['node', 'python', 'java'].includes(mapFamilyToDebugType.get(getFamily(runtime)) ?? '') + } catch { + return false + } + } + + public getRemoteDebugLayer( + region: string | undefined, + architectures: Lambda.ArchitecturesList | undefined + ): string | undefined { + if (!region || !architectures) { + return undefined + } + if (architectures.includes('x86_64')) { + return getRemoteDebugLayer(region, 'x86_64') + } + if (architectures.includes('arm64')) { + return getRemoteDebugLayer(region, 'arm64') + } + return undefined + } + + public async installDebugExtension(runtime: string | undefined): Promise { + if (!runtime) { + throw new ToolkitError('Runtime is undefined') + } + + const debugType = mapFamilyToDebugType.get(getFamily(runtime)) + if (!debugType) { + throw new ToolkitError(`Debug type is undefined for runtime ${runtime}`) + } + // Install needed debug extension based on runtime + const extensions = mapDebugTypeToExtensionId.get(debugType) + if (extensions) { + for (const extension of extensions) { + const extensionObj = vscode.extensions.getExtension(extension) + const backupExtensionObj = vscode.extensions.getExtension(mapExtensionToBackup.get(extension) ?? '') + + if (!extensionObj && !backupExtensionObj) { + // Extension is not installed, install it + const choice = await showConfirmationMessage({ + prompt: localize( + 'AWS.lambda.remoteDebug.extensionNotInstalled', + 'You need to install the {0} extension to debug {1} functions. Would you like to install it now?', + extension, + debugType + ), + confirm: localize('AWS.lambda.remoteDebug.install', 'Install'), + cancel: localize('AWS.lambda.remoteDebug.cancel', 'Cancel'), + type: 'warning', + }) + if (!choice) { + return false + } + await vscode.commands.executeCommand('workbench.extensions.installExtension', extension) + if (vscode.extensions.getExtension(extension) === undefined) { + return false + } + } + } + } + + if (debugType === 'java' && !(await findJavaPath())) { + // jvm not available + const choice = await showConfirmationMessage({ + prompt: localize( + 'AWS.lambda.remoteDebug.jvmNotInstalled', + 'You need to install a JVM to debug Java functions. Would you like to install it now?' + ), + confirm: localize('AWS.lambda.remoteDebug.install', 'Install'), + cancel: localize('AWS.lambda.remoteDebug.continueAnyway', 'Continue Anyway'), + type: 'warning', + }) + // open https://developers.redhat.com/products/openjdk/download + if (choice) { + await vscode.env.openExternal( + vscode.Uri.parse('https://developers.redhat.com/products/openjdk/download') + ) + return false + } + } + // passed all checks + return true + } + + public async startDebugging(functionArn: string, runtime: string, debugConfig: DebugConfig): Promise { + if (this.isDebugging) { + getLogger().error('Debug already in progress, remove debug setup to restart') + return + } + + await telemetry.lambda_remoteDebugStart.run(async (span) => { + // Create a copy of debugConfig without functionName and functionArn for telemetry + const debugConfigForTelemetry: Partial = { ...debugConfig } + debugConfigForTelemetry.functionName = undefined + debugConfigForTelemetry.functionArn = undefined + debugConfigForTelemetry.localRoot = undefined + + span.record({ + source: 'remoteDebug', + passive: false, + action: JSON.stringify(debugConfigForTelemetry), + }) + this.lastDebugStartTime = Date.now() + await vscode.window.withProgress( + { + location: vscode.ProgressLocation.Notification, + title: 'Setting up debug session', + cancellable: false, + }, + async (progress) => { + // Reset state before starting + this.ensureCleanState() + + getLogger().info(`Starting debugger for ${functionArn}`) + + const region = getRegionFromArn(functionArn) + if (!region) { + throw new ToolkitError('Could not determine region from Lambda ARN') + } + + // Check if runtime / region is supported for remote debugging + if (!this.supportRuntimeRemoteDebug(runtime)) { + throw new ToolkitError( + `Runtime ${runtime} is not supported for remote debugging. ` + + `Only Python, Node.js, and Java runtimes are supported.` + ) + } + + // Check if a snapshot already exists and revert if needed + // Use the revertExistingConfig function from ldkController + progress.report({ message: 'Checking if snapshot exists...' }) + const revertResult = await revertExistingConfig() + + // If revert failed and user didn't choose to ignore, abort the deployment + if (revertResult === false) { + return + } + try { + // Anything fails before this point doesn't requires reverting + this.isDebugging = true + + // the following will contain changes that requires reverting. + // Create a snapshot of lambda config before debug + // let's preserve this config to a global variable at here + // we will use this config to revert the changes back to it once was, once confirm it's success, update the global to undefined + // if somehow the changes failed to revert, in init phase(activate remote debugging), we will detect this config and prompt user to revert the changes + const ldkClient = LdkClient.instance + // get function config again in case anything changed + const functionConfig = await LdkClient.instance.getFunctionDetail(functionArn) + if (!functionConfig?.Runtime || !functionConfig?.FunctionArn) { + throw new ToolkitError('Could not retrieve Lambda function configuration') + } + await persistLambdaSnapshot(functionConfig) + + // Record runtime in telemetry + span.record({ + runtimeString: functionConfig.Runtime as any, + }) + + // Create or reuse tunnel + progress.report({ message: 'Creating secure tunnel...' }) + getLogger().info('Creating secure tunnel...') + const tunnelInfo = await ldkClient.createOrReuseTunnel(region) + if (!tunnelInfo) { + throw new ToolkitError(`Empty tunnel info response, please retry:${tunnelInfo}`) + } + + if (!isTunnelInfo(tunnelInfo)) { + throw new ToolkitError(`Invalid tunnel info response:${tunnelInfo}`) + } + // start update lambda funcion, await in the end + // Create debug deployment + progress.report({ message: 'Configuring Lambda function for debugging...' }) + getLogger().info('Configuring Lambda function for debugging...') + + const layerArn = + debugConfig.layerArn ?? this.getRemoteDebugLayer(region, functionConfig.Architectures) + if (!layerArn) { + throw new ToolkitError(`No Layer Arn is provided`) + } + // start this request and await in the end + const debugDeployPromise = ldkClient.createDebugDeployment( + functionConfig, + tunnelInfo.destinationToken, + debugConfig.lambdaTimeout ?? 900, + debugConfig.shouldPublishVersion, + layerArn, + progress + ) + + const vscodeDebugConfig = await getVscodeDebugConfig(functionConfig, debugConfig) + // show every field in debugConfig + // getLogger().info(`Debug configuration created successfully ${JSON.stringify(debugConfig)}`) + + // Start local proxy with timeout and better error handling + progress.report({ message: 'Starting local proxy...' }) + + const proxyStartTimeout = new Promise((_, reject) => { + setTimeout(() => reject(new Error('Local proxy start timed out')), 30000) + }) + + const proxyStartAttempt = ldkClient.startProxy(region, tunnelInfo.sourceToken, debugConfig.port) + + const proxyStarted = await Promise.race([proxyStartAttempt, proxyStartTimeout]) + + if (!proxyStarted) { + throw new ToolkitError('Failed to start local proxy') + } + getLogger().info('Local proxy started successfully') + progress.report({ message: 'Starting debugger...' }) + // Start debugging in a non-blocking way + void Promise.resolve(vscode.debug.startDebugging(undefined, vscodeDebugConfig)).then( + async (debugStarted) => { + if (!debugStarted) { + // this could be triggered by another stop debugging, let's check state before stopping. + throw new ToolkitError('Failed to start debug session') + } + } + ) + + const debugSessionEndDisposable = vscode.debug.onDidTerminateDebugSession(async (session) => { + if (session.name === vscodeDebugConfig.name) { + void (await this.stopDebugging()) + } + }) + + // wait until lambda function update is completed + progress.report({ message: 'Waiting for function update...' }) + const qualifier = await debugDeployPromise + if (!qualifier || qualifier === 'Failed') { + throw new ToolkitError('Failed to configure Lambda function for debugging') + } + // store the published version for debugging in version + if (debugConfig.shouldPublishVersion) { + // we already reverted + this.qualifier = qualifier + } + + // Store the disposable + this.debugSessionDisposables.set(functionConfig.FunctionArn, debugSessionEndDisposable) + progress.report({ + message: `Debug session setup completed for ${functionConfig.FunctionArn.split(':').pop()}`, + }) + } catch (error) { + try { + await this.stopDebugging() + } catch (errStop) { + getLogger().error( + 'encountered following error when stoping debug for failed debug session:' + ) + getLogger().error(errStop as Error) + } + + throw ToolkitError.chain(error, 'Error StartDebugging') + } + } + ) + }) + } + + public async stopDebugging(): Promise { + await telemetry.lambda_remoteDebugStop.run(async (span) => { + if (!this.isDebugging) { + void showMessage( + 'info', + localize('AWS.lambda.remoteDebug.debugNotInProgress', 'Debug is not in progress') + ) + return + } + // use sessionDuration to record debug duration + span.record({ sessionDuration: this.lastDebugStartTime === 0 ? 0 : Date.now() - this.lastDebugStartTime }) + try { + await vscode.window.withProgress( + { + location: vscode.ProgressLocation.Notification, + title: 'Stopping debug session', + cancellable: false, + }, + async (progress) => { + progress.report({ message: 'Stopping debugging...' }) + const ldkClient = LdkClient.instance + + // First attempt to clean up resources from Lambda + const savedConfig = getLambdaSnapshot() + if (!savedConfig?.FunctionArn) { + getLogger().error('No saved configuration found during cleanup') + throw new ToolkitError('No saved configuration found during cleanup') + } + + const disposable = this.debugSessionDisposables.get(savedConfig.FunctionArn) + if (disposable) { + disposable.dispose() + this.debugSessionDisposables.delete(savedConfig.FunctionArn) + } + getLogger().info(`Removing debug deployment for function: ${savedConfig.FunctionName}`) + + await vscode.commands.executeCommand('workbench.action.debug.stop') + // Then stop the proxy (with more reliable error handling) + getLogger().info('Stopping proxy during cleanup') + await ldkClient.stopProxy() + // Ensure our resources are properly cleaned up + if (this.qualifier) { + await ldkClient.deleteDebugVersion(savedConfig.FunctionArn, this.qualifier) + } + if (await ldkClient.removeDebugDeployment(savedConfig, true)) { + await persistLambdaSnapshot(undefined) + } + + progress.report({ message: `Debug session stopped` }) + } + ) + void showMessage( + 'info', + localize('AWS.lambda.remoteDebug.debugSessionStopped', 'Debug session stopped') + ) + } catch (error) { + throw ToolkitError.chain(error, 'error when stopping remote debug') + } finally { + this.isDebugging = false + } + }) + } +} diff --git a/packages/core/src/lambda/remoteDebugging/ldkLayers.ts b/packages/core/src/lambda/remoteDebugging/ldkLayers.ts new file mode 100644 index 00000000000..5573a84f980 --- /dev/null +++ b/packages/core/src/lambda/remoteDebugging/ldkLayers.ts @@ -0,0 +1,46 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +interface RegionAccountMapping { + [region: string]: string +} + +// Map region to account ID +export const regionToAccount: RegionAccountMapping = { + 'us-east-1': '166855510987', + 'ap-northeast-1': '435951944084', + 'us-west-1': '397974708477', + 'us-west-2': '116489046076', + 'us-east-2': '372632330791', + 'ca-central-1': '816313119386', + 'eu-west-1': '020236748984', + 'eu-west-2': '199003954714', + 'eu-west-3': '490913546906', + 'eu-central-1': '944487268028', + 'eu-north-1': '351516301086', + 'ap-southeast-1': '812073016575', + 'ap-southeast-2': '185226997092', + 'ap-northeast-2': '241511115815', + 'ap-south-1': '926022987530', + 'sa-east-1': '313162186107', + 'ap-east-1': '416298298123', + 'me-south-1': '511027370648', + 'me-central-1': '766358817862', +} + +// Global layer version +const globalLayerVersion = 1 + +export function getRemoteDebugLayer(region: string, arch: string): string | undefined { + const account = regionToAccount[region] + + if (!account) { + return undefined + } + + const layerName = arch === 'x86_64' ? 'LDKLayerX86' : 'LDKLayerArm64' + + return `arn:aws:lambda:${region}:${account}:layer:${layerName}:${globalLayerVersion}` +} diff --git a/packages/core/src/lambda/remoteDebugging/localProxy.ts b/packages/core/src/lambda/remoteDebugging/localProxy.ts new file mode 100644 index 00000000000..8b228deeb1a --- /dev/null +++ b/packages/core/src/lambda/remoteDebugging/localProxy.ts @@ -0,0 +1,901 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as net from 'net' +import WebSocket from 'ws' +import * as crypto from 'crypto' +import { getLogger } from '../../shared/logger/logger' +import { v4 as uuidv4 } from 'uuid' +import * as protobuf from 'protobufjs' + +const logger = getLogger() + +// Define the message types from the protocol +enum MessageType { + UNKNOWN = 0, + DATA = 1, + STREAM_START = 2, + STREAM_RESET = 3, + SESSION_RESET = 4, + SERVICE_IDS = 5, + CONNECTION_START = 6, + CONNECTION_RESET = 7, +} + +// Interface for tunnel info +export interface TunnelInfo { + tunnelId: string + sourceToken: string + destinationToken: string +} + +// Interface for TCP connection +interface TcpConnection { + socket: net.Socket + streamId: number + connectionId: number +} + +/** + * LocalProxy class that handles WebSocket connection to IoT secure tunneling + * and sets up a TCP adapter as a local proxy + */ +export class LocalProxy { + private ws: WebSocket.WebSocket | undefined = undefined + private tcpServer: net.Server | undefined = undefined + private tcpConnections: Map = new Map() + private isConnected: boolean = false + private reconnectAttempts: number = 0 + private maxReconnectAttempts: number = 10 + private reconnectInterval: number = 2500 // 2.5 seconds + private pingInterval: NodeJS.Timeout | undefined = undefined + private serviceId: string = 'WSS' + private currentStreamId: number = 1 + private nextConnectionId: number = 1 + private localPort: number = 0 + private region: string = '' + private accessToken: string = '' + private Message: protobuf.Type | undefined = undefined + private clientToken: string = '' + private eventHandlers: { [key: string]: any[] } = {} + private isDisposed: boolean = false + + constructor() { + void this.loadProtobufDefinition() + } + + // Define the protobuf schema as a string constant + private static readonly protobufSchema = ` + syntax = "proto3"; + + package com.amazonaws.iot.securedtunneling; + + message Message { + Type type = 1; + int32 streamId = 2; + bool ignorable = 3; + bytes payload = 4; + string serviceId = 5; + repeated string availableServiceIds = 6; + uint32 connectionId = 7; + + enum Type { + UNKNOWN = 0; + DATA = 1; + STREAM_START = 2; + STREAM_RESET = 3; + SESSION_RESET = 4; + SERVICE_IDS = 5; + CONNECTION_START = 6; + CONNECTION_RESET = 7; + } + }` + + /** + * Load the protobuf definition from the embedded schema string + */ + private async loadProtobufDefinition(): Promise { + try { + if (this.Message) { + // Already loaded, don't parse again + return + } + + const root = protobuf.parse(LocalProxy.protobufSchema).root + this.Message = root.lookupType('com.amazonaws.iot.securedtunneling.Message') + + if (!this.Message) { + throw new Error('Failed to load Message type from protobuf definition') + } + + logger.debug('Protobuf definition loaded successfully') + } catch (error) { + logger.error(`Error loading protobuf definition:${error}`) + throw error + } + } + + /** + * Start the local proxy + * @param region AWS region + * @param sourceToken Source token for the tunnel + * @param port Local port to listen on + */ + public async start(region: string, sourceToken: string, port: number = 0): Promise { + // Reset disposal state when starting + this.isDisposed = false + + this.region = region + this.accessToken = sourceToken + + try { + // Start TCP server first + this.localPort = await this.startTcpServer(port) + + // Then connect to WebSocket + await this.connectWebSocket() + + return this.localPort + } catch (error) { + logger.error(`Failed to start local proxy:${error}`) + this.stop() + throw error + } + } + + /** + * Stop the local proxy and clean up all resources + */ + public stop(): void { + if (this.isDisposed) { + logger.debug('LocalProxy already stopped, skipping duplicate stop call') + return + } + + logger.debug('Stopping LocalProxy and cleaning up resources') + + // Cancel any pending reconnect timeouts + if (this.eventHandlers['reconnectTimeouts']) { + for (const timeoutId of this.eventHandlers['reconnectTimeouts']) { + clearTimeout(timeoutId as NodeJS.Timeout) + } + } + + this.stopPingInterval() + this.closeWebSocket() + this.closeTcpServer() + + // Reset all state + this.clientToken = '' + this.isConnected = false + this.reconnectAttempts = 0 + this.currentStreamId = 1 + this.nextConnectionId = 1 + this.localPort = 0 + this.region = '' + this.accessToken = '' + + // Mark as disposed to prevent duplicate stop calls + this.isDisposed = true + + // Clear any remaining event handlers reference + this.eventHandlers = {} + } + + /** + * Start the TCP server + * @param port Port to listen on (0 for random port) + * @returns The port the server is listening on + */ + private startTcpServer(port: number): Promise { + return new Promise((resolve, reject) => { + try { + this.tcpServer = net.createServer((socket) => { + this.handleNewTcpConnection(socket) + }) + + this.tcpServer.on('error', (err) => { + logger.error(`TCP server error:${err}`) + }) + + this.tcpServer.listen(port, '127.0.0.1', () => { + const address = this.tcpServer?.address() as net.AddressInfo + this.localPort = address.port + logger.debug(`TCP server listening on port ${this.localPort}`) + resolve(this.localPort) + }) + } catch (error) { + logger.error(`Failed to start TCP server:${error}`) + reject(error) + } + }) + } + + /** + * Close the TCP server and all connections + */ + private closeTcpServer(): void { + if (this.tcpServer) { + logger.debug('Closing TCP server and connections') + + // Remove all listeners from the server + this.tcpServer.removeAllListeners('error') + this.tcpServer.removeAllListeners('connection') + this.tcpServer.removeAllListeners('listening') + + // Close all TCP connections with proper error handling + for (const connection of this.tcpConnections.values()) { + try { + // Remove all listeners before destroying + connection.socket.removeAllListeners('data') + connection.socket.removeAllListeners('error') + connection.socket.removeAllListeners('close') + connection.socket.destroy() + } catch (err) { + logger.error(`Error closing TCP connection: ${err}`) + } + } + this.tcpConnections.clear() + + // Close the server with proper error handling and timeout + try { + // Set a timeout in case server.close() hangs + const serverCloseTimeout = setTimeout(() => { + logger.warn('TCP server close timed out, forcing closure') + this.tcpServer = undefined + }, 5000) + + this.tcpServer.close(() => { + clearTimeout(serverCloseTimeout) + logger.debug('TCP server closed successfully') + this.tcpServer = undefined + }) + } catch (err) { + logger.error(`Error closing TCP server: ${err}`) + this.tcpServer = undefined + } + } + } + + /** + * Handle a new TCP connection with proper resource management + * @param socket The TCP socket + */ + private handleNewTcpConnection(socket: net.Socket): void { + if (!this.isConnected || this.isDisposed) { + logger.warn('WebSocket not connected or proxy disposed, rejecting TCP connection') + socket.destroy() + return + } + + const connectionId = this.nextConnectionId++ + const streamId = this.currentStreamId + + logger.debug(`New TCP connection: ${connectionId}`) + + // Track event handlers for this connection + const handlers: { [event: string]: (...args: any[]) => void } = {} + + // Data handler + const dataHandler = (data: Buffer) => { + this.sendData(streamId, connectionId, data) + } + socket.on('data', dataHandler) + handlers.data = dataHandler + + // Error handler + const errorHandler = (err: Error) => { + logger.error(`TCP connection ${connectionId} error: ${err}`) + this.sendConnectionReset(streamId, connectionId) + + // Cleanup handlers on error + this.cleanupSocketHandlers(socket, handlers) + } + socket.on('error', errorHandler) + handlers.error = errorHandler + + // Close handler + const closeHandler = () => { + logger.debug(`TCP connection ${connectionId} closed`) + + // Remove from connections map and send reset + this.tcpConnections.delete(connectionId) + this.sendConnectionReset(streamId, connectionId) + + // Cleanup handlers on close + this.cleanupSocketHandlers(socket, handlers) + } + socket.on('close', closeHandler) + handlers.close = closeHandler + + // Set a timeout to close idle connections after 10 minutes + const idleTimeout = setTimeout( + () => { + if (this.tcpConnections.has(connectionId)) { + logger.debug(`Closing idle TCP connection ${connectionId}`) + socket.destroy() + } + }, + 10 * 60 * 1000 + ) + + // Clear timeout on socket close + socket.once('close', () => { + clearTimeout(idleTimeout) + }) + + // Store the connection + const connection: TcpConnection = { + socket, + streamId, + connectionId, + } + this.tcpConnections.set(connectionId, connection) + + // Send StreamStart for the first connection, ConnectionStart for subsequent ones + if (connectionId === 1) { + this.sendStreamStart(streamId, connectionId) + } else { + this.sendConnectionStart(streamId, connectionId) + } + } + + /** + * Helper method to clean up socket event handlers + * @param socket The socket to clean up + * @param handlers The handlers to remove + */ + private cleanupSocketHandlers(socket: net.Socket, handlers: { [event: string]: (...args: any[]) => void }): void { + try { + if (handlers.data) { + socket.removeListener('data', handlers.data as (...args: any[]) => void) + } + if (handlers.error) { + socket.removeListener('error', handlers.error as (...args: any[]) => void) + } + if (handlers.close) { + socket.removeListener('close', handlers.close as (...args: any[]) => void) + } + } catch (error) { + logger.error(`Error cleaning up socket handlers: ${error}`) + } + } + + /** + * Connect to the WebSocket server with proper event tracking + */ + private async connectWebSocket(): Promise { + if (this.ws) { + this.closeWebSocket() + } + + // Reset for new connection + this.isDisposed = false + + return new Promise((resolve, reject) => { + try { + const url = `wss://data.tunneling.iot.${this.region}.amazonaws.com:443/tunnel?local-proxy-mode=source` + + if (!this.clientToken) { + this.clientToken = uuidv4().replace(/-/g, '') + } + + this.ws = new WebSocket.WebSocket(url, ['aws.iot.securetunneling-3.0'], { + headers: { + 'access-token': this.accessToken, + 'client-token': this.clientToken, + }, + handshakeTimeout: 30000, // 30 seconds + }) + + // Track event listeners for proper cleanup + this.eventHandlers['wsOpen'] = [] + this.eventHandlers['wsMessage'] = [] + this.eventHandlers['wsClose'] = [] + this.eventHandlers['wsError'] = [] + this.eventHandlers['wsPing'] = [] + this.eventHandlers['wsPong'] = [] + + // Open handler + const openHandler = () => { + logger.debug('WebSocket connected') + this.isConnected = true + this.reconnectAttempts = 0 + this.startPingInterval() + resolve() + } + this.ws.on('open', openHandler) + this.eventHandlers['wsOpen'].push(openHandler) + + // Message handler + const messageHandler = (data: WebSocket.RawData) => { + this.handleWebSocketMessage(data) + } + this.ws.on('message', messageHandler) + this.eventHandlers['wsMessage'].push(messageHandler) + + // Close handler + const closeHandler = (code: number, reason: Buffer) => { + logger.debug(`WebSocket closed: ${code} ${reason.toString()}`) + this.isConnected = false + this.stopPingInterval() + + // Only attempt reconnect if we haven't explicitly stopped + if (!this.isDisposed) { + void this.attemptReconnect() + } + } + this.ws.on('close', closeHandler) + this.eventHandlers['wsClose'].push(closeHandler) + + // Error handler + const errorHandler = (err: Error) => { + logger.error(`WebSocket error: ${err}`) + reject(err) + } + this.ws.on('error', errorHandler) + this.eventHandlers['wsError'].push(errorHandler) + + // Ping handler + const pingHandler = (data: Buffer) => { + // Respond to ping with pong + if (this.ws && this.ws.readyState === WebSocket.OPEN) { + this.ws.pong(data) + } + } + this.ws.on('ping', pingHandler) + this.eventHandlers['wsPing'].push(pingHandler) + + // Pong handler + const pongHandler = () => { + logger.debug('Received pong') + } + this.ws.on('pong', pongHandler) + this.eventHandlers['wsPong'].push(pongHandler) + + // Set connection timeout + const connectionTimeout = setTimeout(() => { + if (this.ws && this.ws.readyState !== WebSocket.OPEN) { + logger.error('WebSocket connection timed out') + this.closeWebSocket() + reject(new Error('WebSocket connection timed out')) + } + }, 35000) // 35 seconds (slightly longer than handshake timeout) + + // Add a handler to clear the timeout on successful connection + this.ws.once('open', () => { + clearTimeout(connectionTimeout) + }) + } catch (error) { + logger.error(`Failed to connect WebSocket: ${error}`) + this.isConnected = false + reject(error) + } + }) + } + + /** + * Close the WebSocket connection with proper cleanup + */ + private closeWebSocket(): void { + if (this.ws) { + try { + logger.debug('Closing WebSocket connection') + + // Remove all event listeners before closing + this.ws.removeAllListeners('open') + this.ws.removeAllListeners('message') + this.ws.removeAllListeners('close') + this.ws.removeAllListeners('error') + this.ws.removeAllListeners('ping') + this.ws.removeAllListeners('pong') + + // Try to close gracefully first + if (this.ws.readyState === WebSocket.OPEN) { + // Set timeout in case close hangs + const closeTimeout = setTimeout(() => { + logger.warn('WebSocket close timed out, forcing termination') + if (this.ws) { + try { + this.ws.terminate() + } catch (e) { + // Ignore errors on terminate after timeout + } + this.ws = undefined + } + }, 1000) + + // Try graceful closure first + this.ws.close(1000, 'Normal Closure') + + // Set up a handler to clear the timeout if close works normally + this.ws.once('close', () => { + clearTimeout(closeTimeout) + }) + } else { + // If not open, just terminate + this.ws.terminate() + } + } catch (error) { + logger.error(`Error closing WebSocket: ${error}`) + } finally { + this.ws = undefined + } + } + } + + /** + * Start the ping interval to keep the connection alive + */ + private startPingInterval(): void { + this.stopPingInterval() + + // Send ping every 30 seconds to keep the connection alive + this.pingInterval = setInterval(() => { + if (this.ws && this.ws.readyState === WebSocket.OPEN) { + logger.debug('Sending ping') + try { + this.ws.ping(crypto.randomBytes(16)) + } catch (error) { + logger.error(`Error sending ping: ${error}`) + } + } else { + // If websocket is no longer open, stop the interval + this.stopPingInterval() + } + }, 30000) + } + + /** + * Stop the ping interval with better error handling + */ + private stopPingInterval(): void { + try { + if (this.pingInterval) { + clearInterval(this.pingInterval) + this.pingInterval = undefined + logger.debug('Ping interval stopped') + } + } catch (error) { + logger.error(`Error stopping ping interval: ${error}`) + this.pingInterval = undefined + } + } + + /** + * Attempt to reconnect to the WebSocket server with better resource management + */ + private async attemptReconnect(): Promise { + if (this.isDisposed) { + logger.debug('LocalProxy is disposed, not attempting reconnect') + return + } + + if (!this.clientToken) { + logger.debug('stop retrying, ws closed manually') + return + } + + if (this.reconnectAttempts >= this.maxReconnectAttempts) { + logger.error('Max reconnect attempts reached') + // Clean up resources when max attempts reached + this.stop() + return + } + + this.reconnectAttempts++ + const delay = this.reconnectInterval * Math.pow(1.5, this.reconnectAttempts - 1) + + logger.debug(`Attempting to reconnect in ${delay}ms (attempt ${this.reconnectAttempts})`) + + // Use a tracked timeout that we can clear if needed + const reconnectTimeoutId = setTimeout(() => { + if (!this.isDisposed) { + void this.connectWebSocket().catch((err) => { + logger.error(`Reconnect failed: ${err}`) + }) + } else { + logger.debug('Reconnect cancelled because LocalProxy was disposed') + } + }, delay) + + // Store the timeout ID so it can be cleared if stop() is called + if (!this.eventHandlers['reconnectTimeouts']) { + this.eventHandlers['reconnectTimeouts'] = [] + } + this.eventHandlers['reconnectTimeouts'].push(reconnectTimeoutId) + } + + /** + * Handle a WebSocket message + * @param data The message data + */ + private handleWebSocketMessage(data: WebSocket.RawData): void { + try { + // Handle binary data + if (Buffer.isBuffer(data)) { + let offset = 0 + + // Process all messages in the buffer + while (offset < data.length) { + // Read the 2-byte length prefix + if (offset + 2 > data.length) { + logger.error('Incomplete message length prefix') + break + } + + const messageLength = data.readUInt16BE(offset) + offset += 2 + + // Check if we have the complete message + if (offset + messageLength > data.length) { + logger.error('Incomplete message data') + break + } + + // Extract the message data + const messageData = data.slice(offset, offset + messageLength) + offset += messageLength + + // Decode and process the message + this.processMessage(messageData) + } + } else { + logger.warn('Received non-buffer WebSocket message') + } + } catch (error) { + logger.error(`Error handling WebSocket message:${error}`) + } + } + + /** + * Process a decoded message + * @param messageData The message data + */ + private processMessage(messageData: Buffer): void { + try { + if (!this.Message) { + logger.error('Protobuf Message type not loaded') + return + } + + // Decode the message + const message = this.Message.decode(messageData) + + // Process based on message type + const typedMessage = message as any + switch (typedMessage.type) { + case MessageType.DATA: + this.handleDataMessage(message) + break + + case MessageType.STREAM_RESET: + this.handleStreamReset(message) + break + + case MessageType.CONNECTION_RESET: + this.handleConnectionReset(message) + break + + case MessageType.SESSION_RESET: + this.handleSessionReset() + break + + case MessageType.SERVICE_IDS: + this.handleServiceIds(message) + break + + default: + logger.debug(`Received message of type ${typedMessage.type}`) + break + } + } catch (error) { + logger.error(`Error processing message:${error}`) + } + } + + /** + * Handle a DATA message + * @param message The message + */ + private handleDataMessage(message: any): void { + const { streamId, connectionId, payload } = message + + // Validate stream ID + if (streamId !== this.currentStreamId) { + logger.warn(`Received data for invalid stream ID: ${streamId}, current: ${this.currentStreamId}`) + return + } + + // Find the connection + const connection = this.tcpConnections.get(connectionId || 1) + if (!connection) { + logger.warn(`Received data for unknown connection ID: ${connectionId}`) + return + } + + logger.debug(`Received data for connection ${connectionId} in stream ${streamId}`) + + // Write data to the TCP socket + if (connection.socket.writable) { + connection.socket.write(Buffer.from(payload)) + } + } + + /** + * Handle a STREAM_RESET message + * @param message The message + */ + private handleStreamReset(message: any): void { + const { streamId } = message + + logger.debug(`Received STREAM_RESET for stream ${streamId}`) + + // Close all connections for this stream + for (const [connectionId, connection] of this.tcpConnections.entries()) { + if (connection.streamId === streamId) { + connection.socket.destroy() + this.tcpConnections.delete(connectionId) + } + } + } + + /** + * Handle a CONNECTION_RESET message + * @param message The message + */ + private handleConnectionReset(message: any): void { + const { streamId, connectionId } = message + + logger.debug(`Received CONNECTION_RESET for connection ${connectionId} in stream ${streamId}`) + + // Close the specific connection + const connection = this.tcpConnections.get(connectionId) + if (connection) { + connection.socket.destroy() + this.tcpConnections.delete(connectionId) + } + } + + /** + * Handle a SESSION_RESET message + */ + private handleSessionReset(): void { + logger.debug('Received SESSION_RESET') + + // Close all connections + for (const connection of this.tcpConnections.values()) { + connection.socket.destroy() + } + this.tcpConnections.clear() + + // Increment stream ID for new connections + this.currentStreamId++ + } + + /** + * Handle a SERVICE_IDS message + * @param message The message + */ + private handleServiceIds(message: any): void { + const { availableServiceIds } = message + + logger.debug(`Received SERVICE_IDS: ${availableServiceIds}`) + + // Validate service IDs + if (Array.isArray(availableServiceIds) && availableServiceIds.length > 0) { + // Use the first service ID + this.serviceId = availableServiceIds[0] + } + } + + /** + * Send a message over the WebSocket + * @param messageType The message type + * @param streamId The stream ID + * @param connectionId The connection ID + * @param payload The payload + */ + private sendMessage(messageType: MessageType, streamId: number, connectionId: number, payload?: Buffer): void { + if (!this.ws || this.ws.readyState !== WebSocket.OPEN) { + logger.warn('WebSocket not connected, cannot send message') + return + } + + if (!this.Message) { + logger.error('Protobuf Message type not loaded') + return + } + + try { + // Create the message + const message = { + type: messageType, + streamId, + connectionId, + serviceId: this.serviceId, + } + + // Add payload if provided + const typedMessage: any = message + if (payload) { + typedMessage.payload = payload + } + + // Verify and encode the message + const err = this.Message.verify(message) + if (err) { + throw new Error(`Invalid message: ${err}`) + } + + const encodedMessage = this.Message.encode(this.Message.create(message)).finish() + + // Create the frame with 2-byte length prefix + const frameLength = encodedMessage.length + const frame = Buffer.alloc(2 + frameLength) + + // Write the length prefix + frame.writeUInt16BE(frameLength, 0) + + // Copy the encoded message + Buffer.from(encodedMessage).copy(frame, 2) + + // Send the frame + if (this.ws?.readyState === WebSocket.OPEN) { + this.ws.send(frame) + } else { + logger.warn('WebSocket connection lost before sending message') + } + } catch (error) { + logger.error(`Error sending message: ${error}`) + } + } + + /** + * Send a STREAM_START message + * @param streamId The stream ID + * @param connectionId The connection ID + */ + private sendStreamStart(streamId: number, connectionId: number): void { + logger.debug(`Sending STREAM_START for stream ${streamId}, connection ${connectionId}`) + this.sendMessage(MessageType.STREAM_START, streamId, connectionId) + } + + /** + * Send a CONNECTION_START message + * @param streamId The stream ID + * @param connectionId The connection ID + */ + private sendConnectionStart(streamId: number, connectionId: number): void { + logger.debug(`Sending CONNECTION_START for stream ${streamId}, connection ${connectionId}`) + this.sendMessage(MessageType.CONNECTION_START, streamId, connectionId) + } + + /** + * Send a CONNECTION_RESET message + * @param streamId The stream ID + * @param connectionId The connection ID + */ + private sendConnectionReset(streamId: number, connectionId: number): void { + logger.debug(`Sending CONNECTION_RESET for stream ${streamId}, connection ${connectionId}`) + this.sendMessage(MessageType.CONNECTION_RESET, streamId, connectionId) + } + + /** + * Send data over the WebSocket + * @param streamId The stream ID + * @param connectionId The connection ID + * @param data The data to send + */ + private sendData(streamId: number, connectionId: number, data: Buffer): void { + // Split data into chunks if it exceeds the maximum payload size (63kb) + const maxChunkSize = 63 * 1024 // 63kb + + for (let offset = 0; offset < data.length; offset += maxChunkSize) { + const chunk = data.slice(offset, offset + maxChunkSize) + this.sendMessage(MessageType.DATA, streamId, connectionId, chunk) + } + } +} diff --git a/packages/core/src/lambda/remoteDebugging/utils.ts b/packages/core/src/lambda/remoteDebugging/utils.ts new file mode 100644 index 00000000000..6f7256f9f61 --- /dev/null +++ b/packages/core/src/lambda/remoteDebugging/utils.ts @@ -0,0 +1,27 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import IoTSecureTunneling from 'aws-sdk/clients/iotsecuretunneling' +import { DefaultLambdaClient } from '../../shared/clients/lambdaClient' +import { getUserAgent } from '../../shared/telemetry/util' +import globals from '../../shared/extensionGlobals' + +const customUserAgentBase = 'LAMBDA-DEBUG/1.0.0' + +export function getLambdaClientWithAgent(region: string): DefaultLambdaClient { + const customUserAgent = `${customUserAgentBase} ${getUserAgent({ includePlatform: true, includeClientId: true })}` + return new DefaultLambdaClient(region, customUserAgent) +} + +export function getIoTSTClientWithAgent(region: string): Promise { + const customUserAgent = `${customUserAgentBase} ${getUserAgent({ includePlatform: true, includeClientId: true })}` + return globals.sdkClientBuilder.createAwsService( + IoTSecureTunneling, + { + customUserAgent, + }, + region + ) +} diff --git a/packages/core/src/lambda/uriHandlers.ts b/packages/core/src/lambda/uriHandlers.ts new file mode 100644 index 00000000000..8ae1d7b8c35 --- /dev/null +++ b/packages/core/src/lambda/uriHandlers.ts @@ -0,0 +1,58 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' +import * as nls from 'vscode-nls' + +import { SearchParams } from '../shared/vscode/uriHandler' +import { openLambdaFolderForEdit } from './commands/editLambda' +import { showConfirmationMessage } from '../shared/utilities/messages' +import globals from '../shared/extensionGlobals' +import { telemetry } from '../shared/telemetry/telemetry' +import { ToolkitError } from '../shared/errors' + +const localize = nls.loadMessageBundle() + +export function registerLambdaUriHandler() { + async function openFunctionHandler(params: ReturnType) { + await telemetry.lambda_uriHandler.run(async () => { + try { + if (params.isCfn === 'true') { + const response = await showConfirmationMessage({ + prompt: localize( + 'AWS.lambda.open.confirmInStack', + 'The function you are attempting to open is in a CloudFormation stack. Editing the function code could lead to stack drift.' + ), + confirm: localize('AWS.lambda.open.confirmStack', 'Confirm'), + cancel: localize('AWS.lambda.open.cancelStack', 'Cancel'), + }) + if (!response) { + return + } + } + await openLambdaFolderForEdit(params.functionName, params.region) + } catch (e) { + throw new ToolkitError(`Unable to get function ${params.functionName} in region ${params.region}: ${e}`) + } + }) + } + + return vscode.Disposable.from( + globals.uriHandler.onPath('/lambda/load-function', openFunctionHandler, parseOpenParams) + ) +} + +// Sample url: +// vscode://AmazonWebServices.aws-toolkit-vscode/lambda/load-function?functionName=fnf-func-1®ion=us-east-1&isCfn=true +export function parseOpenParams(query: SearchParams) { + return { + functionName: query.getOrThrow( + 'functionName', + localize('AWS.lambda.open.missingName', 'A function name must be provided') + ), + region: query.getOrThrow('region', localize('AWS.lambda.open.missingRegion', 'A region must be provided')), + isCfn: query.get('isCfn'), + } +} diff --git a/packages/core/src/lambda/utils.ts b/packages/core/src/lambda/utils.ts index 79054e02cac..eeea6451342 100644 --- a/packages/core/src/lambda/utils.ts +++ b/packages/core/src/lambda/utils.ts @@ -6,17 +6,21 @@ import * as nls from 'vscode-nls' const localize = nls.loadMessageBundle() +import path from 'path' import xml2js = require('xml2js') import { Lambda } from 'aws-sdk' import * as vscode from 'vscode' import { CloudFormationClient, StackSummary } from '../shared/clients/cloudFormation' -import { LambdaClient } from '../shared/clients/lambdaClient' +import { DefaultLambdaClient, LambdaClient } from '../shared/clients/lambdaClient' import { getFamily, getNodeMajorVersion, RuntimeFamily } from './models/samLambdaRuntime' import { getLogger } from '../shared/logger/logger' import { HttpResourceFetcher } from '../shared/resourcefetcher/httpResourceFetcher' import { FileResourceFetcher } from '../shared/resourcefetcher/fileResourceFetcher' import { sampleRequestManifestPath } from './constants' import globals from '../shared/extensionGlobals' +import { tempDirPath } from '../shared/filesystemUtilities' +import { LambdaFunction } from './commands/uploadLambda' +import { fs } from '../shared/fs/fs' export async function* listCloudFormationStacks(client: CloudFormationClient): AsyncIterableIterator { // TODO: this 'loading' message needs to go under each regional entry @@ -46,6 +50,23 @@ export async function* listLambdaFunctions(client: LambdaClient): AsyncIterableI } } +export async function* listLayerVersions( + client: LambdaClient, + name: string +): AsyncIterableIterator { + const status = vscode.window.setStatusBarMessage( + localize('AWS.message.statusBar.loading.lambda', 'Loading Lambda Layer Versions...') + ) + + try { + yield* client.listLayerVersions(name) + } finally { + if (status) { + status.dispose() + } + } +} + /** * Returns filename and function name corresponding to a Lambda.FunctionConfiguration * Only works for supported languages (Python/JS) @@ -70,6 +91,9 @@ export function getLambdaDetails(configuration: Lambda.FunctionConfiguration): { } break } + case RuntimeFamily.Ruby: + runtimeExtension = 'rb' + break default: throw new Error(`Toolkit does not currently support imports for runtime: ${configuration.Runtime}`) } @@ -124,3 +148,62 @@ async function getSampleRequestManifest(): Promise { } return httpResp.text() } + +function getInfoLocation(lambda: LambdaFunction): string { + return path.join(getTempRegionLocation(lambda.region), `.${lambda.name}`) +} + +export async function getCodeShaLive(lambda: LambdaFunction): Promise { + const lambdaClient = new DefaultLambdaClient(lambda.region) + const func = await lambdaClient.getFunction(lambda.name) + return func.Configuration?.CodeSha256 +} + +export async function compareCodeSha(lambda: LambdaFunction): Promise { + const local = await getFunctionInfo(lambda, 'sha') + const remote = await getCodeShaLive(lambda) + getLogger().info(`local: ${local}, remote: ${remote}`) + return local === remote +} + +export interface FunctionInfo { + lastDeployed?: number + undeployed?: boolean + sha?: string + handlerFile?: string +} + +export async function getFunctionInfo(lambda: LambdaFunction, field?: K) { + try { + const data = JSON.parse(await fs.readFileText(getInfoLocation(lambda))) + getLogger().debug('Data returned from getFunctionInfo for %s: %O', lambda.name, data) + return field ? data[field] : data + } catch { + return field ? undefined : {} + } +} + +export async function setFunctionInfo(lambda: LambdaFunction, info: Partial) { + try { + const existing = await getFunctionInfo(lambda) + const updated: FunctionInfo = { + lastDeployed: info.lastDeployed ?? existing.lastDeployed, + undeployed: info.undeployed ?? true, + sha: info.sha ?? (await getCodeShaLive(lambda)), + handlerFile: info.handlerFile ?? existing.handlerFile, + } + await fs.writeFile(getInfoLocation(lambda), JSON.stringify(updated)) + } catch (err) { + getLogger().warn(`codesha: unable to save information at key "${lambda.name}: %s"`, err) + } +} + +export const lambdaTempPath = path.join(tempDirPath, 'lambda') + +export function getTempRegionLocation(region: string) { + return path.join(lambdaTempPath, region) +} + +export function getTempLocation(functionName: string, region: string) { + return path.join(getTempRegionLocation(region), functionName) +} diff --git a/packages/core/src/lambda/vue/remoteInvoke/invokeLambda.ts b/packages/core/src/lambda/vue/remoteInvoke/invokeLambda.ts index aafde327d7f..9e027bde2bc 100644 --- a/packages/core/src/lambda/vue/remoteInvoke/invokeLambda.ts +++ b/packages/core/src/lambda/vue/remoteInvoke/invokeLambda.ts @@ -7,7 +7,7 @@ import { _Blob } from 'aws-sdk/clients/lambda' import { readFileSync } from 'fs' // eslint-disable-line no-restricted-imports import * as _ from 'lodash' import * as vscode from 'vscode' -import { DefaultLambdaClient, LambdaClient } from '../../../shared/clients/lambdaClient' +import { LambdaClient } from '../../../shared/clients/lambdaClient' import * as picker from '../../../shared/ui/picker' import { ExtContext } from '../../../shared/extensions' @@ -19,7 +19,7 @@ import { getSampleLambdaPayloads, SampleRequest } from '../../utils' import * as nls from 'vscode-nls' import { VueWebview } from '../../../webviews/main' -import { telemetry, Result } from '../../../shared/telemetry/telemetry' +import { telemetry, Result, Runtime } from '../../../shared/telemetry/telemetry' import { runSamCliRemoteTestEvents, SamCliRemoteTestEventsParameters, @@ -29,6 +29,13 @@ import { getSamCliContext } from '../../../shared/sam/cli/samCliContext' import { ToolkitError } from '../../../shared/errors' import { basename } from 'path' import { decodeBase64 } from '../../../shared/utilities/textUtilities' +import { DebugConfig, RemoteDebugController, revertExistingConfig } from '../../remoteDebugging/ldkController' +import { getCachedLocalPath, openLambdaFile, runDownloadLambda } from '../../commands/downloadLambda' +import { getLambdaHandlerFile } from '../../../awsService/appBuilder/utils' +import { runUploadDirectory } from '../../commands/uploadLambda' +import fs from '../../../shared/fs/fs' +import { showConfirmationMessage, showMessage } from '../../../shared/utilities/messages' +import { getLambdaClientWithAgent } from '../../remoteDebugging/utils' const localize = nls.loadMessageBundle() @@ -48,19 +55,75 @@ export interface InitialData { Source?: string StackName?: string LogicalId?: string + Runtime?: string + LocalRootPath?: string + LambdaFunctionNode?: LambdaFunctionNode + supportCodeDownload?: boolean + runtimeSupportsRemoteDebug?: boolean + remoteDebugLayer?: string | undefined } -export interface RemoteInvokeData { - initialData: InitialData +// Debug configuration sub-interface +export interface DebugConfiguration { + debugPort: number + localRootPath: string + remoteRootPath: string + shouldPublishVersion: boolean + lambdaTimeout: number + otherDebugParams: string +} + +// Debug state sub-interface +export interface DebugState { + isDebugging: boolean + debugTimer: number | undefined + debugTimeRemaining: number + showDebugTimer: boolean + handlerFileAvailable: boolean + remoteDebuggingEnabled: boolean +} + +// Runtime-specific debug settings sub-interface +export interface RuntimeDebugSettings { + // Node.js specific + sourceMapEnabled: boolean + skipFiles: string + outFiles: string | undefined + // Python specific + justMyCode: boolean + // Java specific + projectName: string +} + +// UI state sub-interface +export interface UIState { + isCollapsed: boolean + showNameInput: boolean + payload: string +} + +// Payload/Event handling sub-interface +export interface PayloadData { selectedSampleRequest: string sampleText: string selectedFile: string selectedFilePath: string selectedTestEvent: string - payload: string - showNameInput: boolean newTestEventName: string - selectedFunction: string +} + +export interface RemoteInvokeData { + initialData: InitialData + debugConfig: DebugConfiguration + debugState: DebugState + runtimeSettings: RuntimeDebugSettings + uiState: UIState + payloadData: PayloadData +} + +// Event types for communicating state between backend and frontend +export type StateChangeEvent = { + isDebugging?: boolean } interface SampleQuickPickItem extends vscode.QuickPickItem { filename: string @@ -70,6 +133,19 @@ export class RemoteInvokeWebview extends VueWebview { public static readonly sourcePath: string = 'src/lambda/vue/remoteInvoke/index.js' public readonly id = 'remoteInvoke' + // Event emitter for state changes that need to be synchronized with the frontend + public readonly onStateChange = new vscode.EventEmitter() + + // Backend timer that will continue running even when the webview loses focus + private debugTimerHandle: NodeJS.Timeout | undefined + private debugTimeRemaining: number = 0 + private isInvoking: boolean = false + private debugging: boolean = false + private watcherDisposable: vscode.Disposable | undefined + private fileWatcherDisposable: vscode.Disposable | undefined + private handlerFileAvailable: boolean = false + private isStartingDebug: boolean = false + private handlerFile: string | undefined public constructor( private readonly channel: vscode.OutputChannel, private readonly client: LambdaClient, @@ -79,17 +155,137 @@ export class RemoteInvokeWebview extends VueWebview { } public init() { + this.watcherDisposable = vscode.debug.onDidTerminateDebugSession(async (session: vscode.DebugSession) => { + this.resetServerState() + }) return this.data } - public async invokeLambda(input: string, source?: string): Promise { + public resetServerState() { + this.stopDebugTimer() + this.debugging = false + this.isInvoking = false + this.isStartingDebug = false + this.onStateChange.fire({ + isDebugging: false, + }) + } + + public async disposeServer() { + this.watcherDisposable?.dispose() + this.fileWatcherDisposable?.dispose() + if (this.debugging && RemoteDebugController.instance.isDebugging) { + await this.stopDebugging() + } + this.dispose() + } + + private setupFileWatcher() { + // Dispose existing watcher if any + this.fileWatcherDisposable?.dispose() + + if (!this.data.LocalRootPath) { + return + } + + // Create a file system watcher for the local root path + const pattern = new vscode.RelativePattern(this.data.LocalRootPath, '**/*') + const watcher = vscode.workspace.createFileSystemWatcher(pattern) + + // Set up event handlers for file changes + const handleFileChange = async () => { + const result = await showMessage( + 'info', + localize( + 'AWS.lambda.remoteInvoke.codeChangesDetected', + 'Code changes detected in the local directory. Would you like to update the Lambda function {0}@{1}?', + this.data.FunctionName, + this.data.FunctionRegion + ), + ['Yes', 'No'] + ) + + if (result === 'Yes') { + try { + if (this.data.LambdaFunctionNode && this.data.LocalRootPath) { + const lambdaFunction = { + name: this.data.FunctionName, + region: this.data.FunctionRegion, + configuration: this.data.LambdaFunctionNode.configuration, + } + await runUploadDirectory(lambdaFunction, 'zip', vscode.Uri.file(this.data.LocalRootPath)) + } + } catch (error) { + throw ToolkitError.chain( + error, + localize('AWS.lambda.remoteInvoke.updateFailed', 'Failed to update Lambda function') + ) + } + } + } + + // Listen for file changes, creations, and deletions + watcher.onDidChange(handleFileChange) + watcher.onDidCreate(handleFileChange) + watcher.onDidDelete(handleFileChange) + + // Store the disposable so we can clean it up later + this.fileWatcherDisposable = watcher + } + + // Method to start the backend timer + public startDebugTimer() { + // Clear any existing timer + this.stopDebugTimer() + + this.debugTimeRemaining = 60 + + // Create a new timer that ticks every second + this.debugTimerHandle = setInterval(async () => { + this.debugTimeRemaining-- + + // When timer reaches zero, stop debugging + if (this.debugTimeRemaining <= 0) { + await this.handleTimerExpired() + } + }, 1000) + } + + // Method to stop the timer + public stopDebugTimer() { + if (this.debugTimerHandle) { + clearInterval(this.debugTimerHandle) + this.debugTimerHandle = undefined + this.debugTimeRemaining = 0 + } + } + + // Handler for timer expiration + private async handleTimerExpired() { + await this.stopDebugging() + } + + public async invokeLambda(input: string, source?: string, remoteDebugEnabled: boolean = false): Promise { let result: Result = 'Succeeded' + let qualifier: string | undefined = undefined + // if debugging, focus on the first editor + if (remoteDebugEnabled && RemoteDebugController.instance.isDebugging) { + await vscode.commands.executeCommand('workbench.action.focusFirstEditorGroup') + qualifier = RemoteDebugController.instance.qualifier + } + + this.isInvoking = true + + // If debugging is active, reset the timer during invoke + if (RemoteDebugController.instance.isDebugging) { + this.stopDebugTimer() + } this.channel.show() this.channel.appendLine('Loading response...') try { - const funcResponse = await this.client.invoke(this.data.FunctionArn, input) + const funcResponse = await this.client.invoke(this.data.FunctionArn, input, qualifier) const logs = funcResponse.LogResult ? decodeBase64(funcResponse.LogResult) : '' const payload = funcResponse.Payload ? funcResponse.Payload : JSON.stringify({}) @@ -107,13 +303,28 @@ export class RemoteInvokeWebview extends VueWebview { this.channel.appendLine('') result = 'Failed' } finally { - telemetry.lambda_invokeRemote.emit({ result, passive: false, source: source }) + telemetry.lambda_invokeRemote.emit({ + result, + passive: false, + source: source, + runtimeString: this.data.Runtime, + action: remoteDebugEnabled ? 'debug' : 'invoke', + }) + + // Update the session state to indicate we've finished invoking + this.isInvoking = false + + // If debugging is active, restart the timer + if (RemoteDebugController.instance.isDebugging) { + this.startDebugTimer() + } + this.channel.show() } } public async promptFile() { const fileLocations = await vscode.window.showOpenDialog({ - openLabel: 'Open', + openLabel: localize('AWS.lambda.remoteInvoke.open', 'Open'), }) if (!fileLocations || fileLocations.length === 0) { @@ -129,8 +340,66 @@ export class RemoteInvokeWebview extends VueWebview { } } catch (e) { getLogger().error('readFileSync: Failed to read file at path %s %O', fileLocations[0].fsPath, e) - throw ToolkitError.chain(e, 'Failed to read selected file') + throw ToolkitError.chain( + e, + localize('AWS.lambda.remoteInvoke.failedToReadFile', 'Failed to read selected file') + ) + } + } + + public async promptFolder(): Promise { + const fileLocations = await vscode.window.showOpenDialog({ + openLabel: localize('AWS.lambda.remoteInvoke.open', 'Open'), + canSelectFolders: true, + canSelectFiles: false, + canSelectMany: false, + }) + + if (!fileLocations || fileLocations.length === 0) { + return undefined + } + this.data.LocalRootPath = fileLocations[0].fsPath + // try to find the handler file in this folder, open it if not opened already + if (!(await this.tryOpenHandlerFile())) { + const warning = localize( + 'AWS.lambda.remoteInvoke.handlerFileNotFound', + 'Handler {0} not found in selected location. Please select the folder that contains the copy of your handler file', + this.data.LambdaFunctionNode?.configuration.Handler + ) + getLogger().warn(warning) + void vscode.window.showWarningMessage(warning) + } + return fileLocations[0].fsPath + } + + public async tryOpenHandlerFile(path?: string, watchForUpdates: boolean = true): Promise { + this.handlerFile = undefined + if (path) { + // path is provided, override init path + this.data.LocalRootPath = path } + // init path or node not available + if (!this.data.LocalRootPath || !this.data.LambdaFunctionNode) { + return false + } + + const handlerFile = await getLambdaHandlerFile( + vscode.Uri.file(this.data.LocalRootPath), + '', + this.data.LambdaFunctionNode?.configuration.Handler ?? '', + this.data.Runtime ?? 'unknown' + ) + if (!handlerFile || !(await fs.exists(handlerFile))) { + this.handlerFileAvailable = false + return false + } + this.handlerFileAvailable = true + if (watchForUpdates) { + this.setupFileWatcher() + } + await openLambdaFile(handlerFile.fsPath) + this.handlerFile = handlerFile.fsPath + return true } public async loadFile(fileLocations: string) { @@ -152,7 +421,10 @@ export class RemoteInvokeWebview extends VueWebview { } } catch (e) { getLogger().error('readFileSync: Failed to read file at path %s %O', fileLocation.fsPath, e) - throw ToolkitError.chain(e, 'Failed to read selected file') + throw ToolkitError.chain( + e, + localize('AWS.lambda.remoteInvoke.failedToReadFile', 'Failed to read selected file') + ) } } @@ -225,12 +497,234 @@ export class RemoteInvokeWebview extends VueWebview { return sample } catch (err) { getLogger().error('Error getting manifest data..: %O', err as Error) - throw ToolkitError.chain(err, 'getting manifest data') + throw ToolkitError.chain( + err, + localize('AWS.lambda.remoteInvoke.gettingManifestData', 'getting manifest data') + ) } } -} -const Panel = VueWebview.compilePanel(RemoteInvokeWebview) + // Download lambda code and update the local root path + public async downloadRemoteCode(): Promise { + return await telemetry.lambda_import.run(async (span) => { + span.record({ runtime: this.data.Runtime as Runtime | undefined, source: 'RemoteDebug' }) + try { + if (this.data.LambdaFunctionNode) { + const output = await runDownloadLambda(this.data.LambdaFunctionNode, true) + if (output instanceof vscode.Uri) { + this.data.LocalRootPath = output.fsPath + this.handlerFileAvailable = true + this.setupFileWatcher() + + return output.fsPath + } + } else { + getLogger().error( + localize( + 'AWS.lambda.remoteInvoke.lambdaFunctionNodeUndefined', + 'LambdaFunctionNode is undefined' + ) + ) + } + return undefined + } catch (error) { + throw ToolkitError.chain( + error, + localize('AWS.lambda.remoteInvoke.failedToDownloadCode', 'Failed to download remote code') + ) + } + }) + } + + // this serves as a lock for invoke + public checkReadyToInvoke(): boolean { + if (this.isInvoking) { + void vscode.window.showWarningMessage( + localize( + 'AWS.lambda.remoteInvoke.invokeInProgress', + 'A remote invoke is already in progress, please wait for previous invoke, or remove debug setup' + ) + ) + return false + } + if (this.isStartingDebug) { + void vscode.window.showWarningMessage( + localize( + 'AWS.lambda.remoteInvoke.debugSetupInProgress', + 'A debugger setup is already in progress, please wait for previous setup to complete, or remove debug setup' + ) + ) + } + return true + } + + // this check is run when user click remote invoke with remote debugging checked + public async checkReadyToDebug(config: DebugConfig): Promise { + if (!this.data.LambdaFunctionNode) { + return false + } + + if (!this.handlerFileAvailable) { + const result = await showConfirmationMessage({ + prompt: localize( + 'AWS.lambda.remoteInvoke.handlerFileNotLocated', + 'The handler file cannot be located in the specified Local Root Path. As a result, remote debugging will not pause at breakpoints.' + ), + confirm: 'Continue Anyway', + cancel: 'Cancel', + type: 'warning', + }) + if (!result) { + return false + } + } + // check if snapstart is on and we are publishing a version + if ( + config.shouldPublishVersion && + this.data.LambdaFunctionNode.configuration.SnapStart?.ApplyOn === 'PublishedVersions' + ) { + const result = await showConfirmationMessage({ + prompt: localize( + 'AWS.lambda.remoteInvoke.snapstartWarning', + "This function has Snapstart enabled. If you use Remote Debug with the 'publish version' setting, you'll experience notable delays. For faster debugging, consider disabling the 'publish version' option." + ), + confirm: 'Continue Anyway', + cancel: 'Cancel', + type: 'warning', + }) + if (!result) { + // didn't confirm + getLogger().warn( + localize('AWS.lambda.remoteInvoke.userCanceledSnapstart', 'User canceled Snapstart confirm') + ) + return false + } + } + + // ready to debug + return true + } + + public async startDebugging(config: DebugConfig): Promise { + if (!this.data.LambdaFunctionNode) { + return false + } + if (!(await this.checkReadyToDebug(config))) { + return false + } + this.isStartingDebug = true + try { + await RemoteDebugController.instance.startDebugging(this.data.FunctionArn, this.data.Runtime ?? 'unknown', { + ...config, + handlerFile: this.handlerFile, + }) + } catch (e) { + throw ToolkitError.chain( + e, + localize('AWS.lambda.remoteInvoke.failedToStartDebugging', 'Failed to start debugging') + ) + } finally { + this.isStartingDebug = false + } + + this.startDebugTimer() + this.debugging = this.isLDKDebugging() + return this.debugging + } + + public async stopDebugging(): Promise { + if (this.isLDKDebugging()) { + this.resetServerState() + await RemoteDebugController.instance.stopDebugging() + } + this.debugging = this.isLDKDebugging() + return this.debugging + } + + public isLDKDebugging(): boolean { + return RemoteDebugController.instance.isDebugging + } + + public isWebViewDebugging(): boolean { + return this.debugging + } + + public getIsInvoking(): boolean { + return this.isInvoking + } + + public getDebugTimeRemaining(): number { + return this.debugTimeRemaining + } + + public getLocalPath(): string { + return this.data.LocalRootPath ?? '' + } + + public getHandlerAvailable(): boolean { + return this.handlerFileAvailable + } + + // prestatus check run at checkbox click + public async debugPreCheck(): Promise { + return await telemetry.lambda_remoteDebugPrecheck.run(async (span) => { + span.record({ runtimeString: this.data.Runtime, source: 'webview' }) + if (!this.debugging && RemoteDebugController.instance.isDebugging) { + // another debug session in progress + const result = await showConfirmationMessage({ + prompt: localize( + 'AWS.lambda.remoteInvoke.debugSessionActive', + 'A remote debug session is already active. Stop that for this new session?' + ), + confirm: 'Stop Previous Session', + cancel: 'Cancel', + type: 'warning', + }) + + if (result) { + // Stop the previous session + if (await this.stopDebugging()) { + getLogger().error( + localize( + 'AWS.lambda.remoteInvoke.failedToStopPreviousSession', + 'Failed to stop previous debug session.' + ) + ) + return false + } + } else { + // user canceled, Do nothing + return false + } + } + + const result = await RemoteDebugController.instance.installDebugExtension(this.data.Runtime) + if (!result && result === false) { + // install failed + return false + } + + await revertExistingConfig() + + // Check if the function ARN is in the cache and try to open handler file + const cachedPath = getCachedLocalPath(this.data.FunctionArn) + // only check cache if not comming from appbuilder + if (cachedPath && !this.data.LambdaFunctionNode?.localDir) { + getLogger().debug( + `lambda: found cached local path for function ARN: ${this.data.FunctionArn} -> ${cachedPath}` + ) + await this.tryOpenHandlerFile(cachedPath, true) + } + + // this is comming from appbuilder + if (this.data.LambdaFunctionNode?.localDir) { + await this.tryOpenHandlerFile(undefined, false) + } + + return true + }) + } +} export async function invokeRemoteLambda( context: ExtContext, @@ -247,9 +741,22 @@ export async function invokeRemoteLambda( } ) { const inputs = await getSampleLambdaPayloads() - const resource: any = params.functionNode + const resource: LambdaFunctionNode = params.functionNode const source: string = params.source || 'AwsExplorerRemoteInvoke' - const client = new DefaultLambdaClient(resource.regionCode) + const client = getLambdaClientWithAgent(resource.regionCode) + + const Panel = VueWebview.compilePanel(RemoteInvokeWebview) + + // Initialize support and debugging capabilities + const runtime = resource.configuration.Runtime ?? 'unknown' + const region = resource.regionCode + const supportCodeDownload = RemoteDebugController.instance.supportCodeDownload(runtime) + const runtimeSupportsRemoteDebug = RemoteDebugController.instance.supportRuntimeRemoteDebug(runtime) + const remoteDebugLayer = RemoteDebugController.instance.getRemoteDebugLayer( + region, + resource.configuration.Architectures + ) + const wv = new Panel(context.extensionContext, context.outputChannel, client, { FunctionName: resource.configuration.FunctionName ?? '', FunctionArn: resource.configuration.FunctionArn ?? '', @@ -257,9 +764,22 @@ export async function invokeRemoteLambda( InputSamples: inputs, TestEvents: [], Source: source, + Runtime: runtime, + LocalRootPath: params.functionNode.localDir, + LambdaFunctionNode: params.functionNode, + supportCodeDownload: supportCodeDownload, + runtimeSupportsRemoteDebug: runtimeSupportsRemoteDebug, + remoteDebugLayer: remoteDebugLayer, }) + // focus on first group so wv will show up in the side + await vscode.commands.executeCommand('workbench.action.focusFirstEditorGroup') - await wv.show({ + const activePanel = await wv.show({ title: localize('AWS.invokeLambda.title', 'Invoke Lambda {0}', resource.configuration.FunctionName), + viewColumn: vscode.ViewColumn.Beside, + }) + + activePanel.onDidDispose(async () => { + await wv.server.disposeServer() }) } diff --git a/packages/core/src/lambda/vue/remoteInvoke/remoteInvoke.css b/packages/core/src/lambda/vue/remoteInvoke/remoteInvoke.css index 99f124e6b0c..bb7d5054bf2 100644 --- a/packages/core/src/lambda/vue/remoteInvoke/remoteInvoke.css +++ b/packages/core/src/lambda/vue/remoteInvoke/remoteInvoke.css @@ -1,6 +1,8 @@ .Icontainer { margin-inline: auto; - margin-top: 5rem; + margin-top: 2rem; + width: 100%; + min-width: 650px; } h1 { @@ -8,17 +10,35 @@ h1 { margin-bottom: 20px; } +/* Remove fixed width for divs to allow responsive behavior */ div { - width: 521px; + width: 100%; } .form-row { display: grid; grid-template-columns: 150px 1fr; margin-bottom: 10px; + align-items: center; +} + +.form-row-no-align { + display: grid; + grid-template-columns: 150px 1fr; + margin-bottom: 10px; +} + +.form-double-row { + display: grid; + grid-template-rows: 20px 1fr; + margin-inline: 0px; + padding: 0px 0px; + align-items: center; } + .form-row-select { - width: 387px; + width: 100%; + max-width: 387px; height: 28px; border: 1px; border-radius: 5px; @@ -29,16 +49,18 @@ div { .dynamic-span { white-space: nowrap; text-overflow: initial; - overflow: scroll; - width: 381px; - height: 28px; + overflow: auto; + width: 100%; + max-width: 381px; + height: auto; font-weight: 500; font-size: 13px; line-height: 15.51px; } .form-row-event-select { - width: 244px; + width: 100%; + max-width: 244px; height: 28px; margin-bottom: 15px; margin-left: 8px; @@ -52,6 +74,23 @@ div { } label { + font-weight: 500; + font-size: 14px; + margin-right: 10px; +} + +info { + color: var(--vscode-descriptionForeground); + font-weight: 500; + font-size: 13px; + margin-right: 10px; + text-wrap-mode: nowrap; +} + +info-wrap { + color: var(--vscode-descriptionForeground); + font-weight: 500; + font-size: 13px; margin-right: 10px; } @@ -65,6 +104,9 @@ textarea { color: var(--vscode-settings-textInputForeground); background: var(--vscode-settings-textInputBackground); border: 1px solid var(--vscode-settings-textInputBorder); + width: 100%; + box-sizing: border-box; + resize: none; } .payload-options-button { @@ -98,6 +140,17 @@ textarea { cursor: pointer; } +.button-theme-inline { + color: var(--vscode-button-secondaryForeground); + background: var(--vscode-button-secondaryBackground); + border: 1px solid var(--vscode-button-border); + padding: 4px 6px; +} +.button-theme-inline:hover:not(:disabled) { + background: var(--vscode-button-secondaryHoverBackground); + cursor: pointer; +} + .payload-options-buttons { display: flex; align-items: center; @@ -130,3 +183,85 @@ textarea { align-items: center; margin-bottom: 0.5rem; } + +.debug-timer { + padding: 5px 10px; + background-color: var(--vscode-editorWidget-background); + border-radius: 4px; + font-weight: 500; +} + +.collapsible-section { + margin: 15px 0; + border: 1px solid var(--vscode-widget-border); + border-radius: 4px; +} + +.collapsible-header { + padding: 8px 12px; + background-color: var(--vscode-sideBarSectionHeader-background); + cursor: pointer; + font-weight: 500; + max-width: 96%; +} + +.collapsible-content { + padding: 10px; + border-top: 1px solid var(--vscode-widget-border); + max-width: 96%; +} + +/* Ensure buttons in the same line are properly spaced */ +.button-container { + display: flex; + gap: 5px; +} + +/* For buttons that should be disabled */ +button:disabled { + opacity: 0.5; + cursor: not-allowed; +} + +/* Validation error styles */ +.input-error { + border: 1px solid var(--vscode-inputValidation-errorBorder) !important; + background-color: var(--vscode-inputValidation-errorBackground) !important; +} + +.error-message { + color: var(--vscode-inputValidation-errorForeground); + font-size: 12px; + margin-top: 4px; + font-weight: 400; + line-height: 1.2; +} + +/* Enhanced styling for remote debug checkbox to make it more obvious in dark mode */ +.remote-debug-checkbox { + width: 18px !important; + height: 18px !important; + accent-color: var(--vscode-checkbox-foreground); + border: 2px solid var(--vscode-checkbox-border) !important; + border-radius: 3px !important; + background-color: var(--vscode-checkbox-background) !important; + border-color: var(--vscode-checkbox-selectBorder) !important; + cursor: pointer; +} + +.remote-debug-checkbox:checked { + background-color: var(--vscode-checkbox-selectBackground) !important; + border-color: var(--vscode-checkbox-selectBorder) !important; +} + +.remote-debug-checkbox:disabled { + opacity: 0.6; + cursor: not-allowed; + border-color: var(--vscode-checkbox-border); + background-color: var(--vscode-input-background); +} + +.remote-debug-checkbox:focus { + outline: 2px solid var(--vscode-focusBorder); + outline-offset: 2px; +} diff --git a/packages/core/src/lambda/vue/remoteInvoke/remoteInvoke.vue b/packages/core/src/lambda/vue/remoteInvoke/remoteInvoke.vue index 8309fce6990..1743fd4ef00 100644 --- a/packages/core/src/lambda/vue/remoteInvoke/remoteInvoke.vue +++ b/packages/core/src/lambda/vue/remoteInvoke/remoteInvoke.vue @@ -6,124 +6,402 @@ diff --git a/packages/core/src/lambda/vue/remoteInvoke/remoteInvokeFrontend.ts b/packages/core/src/lambda/vue/remoteInvoke/remoteInvokeFrontend.ts index 301b47603e9..b2253a46fd2 100644 --- a/packages/core/src/lambda/vue/remoteInvoke/remoteInvokeFrontend.ts +++ b/packages/core/src/lambda/vue/remoteInvoke/remoteInvokeFrontend.ts @@ -21,54 +21,202 @@ const defaultInitialData = { TestEvents: [], FunctionStack: '', Source: '', + LambdaFunctionNode: undefined, + supportCodeDownload: true, + runtimeSupportsRemoteDebug: true, + remoteDebugLayer: '', } export default defineComponent({ - async created() { - this.initialData = (await client.init()) ?? this.initialData - if (this.initialData.FunctionArn && this.initialData.FunctionRegion) { - this.initialData.TestEvents = await client.listRemoteTestEvents( - this.initialData.FunctionArn, - this.initialData.FunctionRegion - ) - } - }, - data(): RemoteInvokeData { return { initialData: { ...defaultInitialData }, - selectedSampleRequest: '', - sampleText: '{}', - selectedFile: '', - selectedFilePath: '', - payload: 'sampleEvents', - selectedTestEvent: '', - showNameInput: false, - newTestEventName: '', - selectedFunction: 'selectedFunction', + debugConfig: { + debugPort: 9229, + localRootPath: '', + remoteRootPath: '/var/task', + shouldPublishVersion: true, + lambdaTimeout: 900, + otherDebugParams: '', + }, + debugState: { + isDebugging: false, + debugTimer: undefined, + debugTimeRemaining: 60, + showDebugTimer: false, + handlerFileAvailable: false, + remoteDebuggingEnabled: false, + }, + runtimeSettings: { + sourceMapEnabled: true, + skipFiles: '/var/runtime/node_modules/**/*.js,/**', + justMyCode: true, + projectName: '', + outFiles: undefined, + }, + uiState: { + isCollapsed: true, + showNameInput: false, + payload: 'sampleEvents', + }, + payloadData: { + selectedSampleRequest: '', + sampleText: '{}', + selectedFile: '', + selectedFilePath: '', + selectedTestEvent: '', + newTestEventName: '', + }, } }, + + async created() { + // Initialize data from backend + this.initialData = (await client.init()) ?? this.initialData + this.debugConfig.localRootPath = this.initialData.LocalRootPath ?? '' + + // Register for state change events from the backend + void client.onStateChange(async () => { + await this.syncStateFromWorkspace() + }) + + // Check for existing session state and load it + await this.syncStateFromWorkspace() + }, + + computed: { + // Auto-adjust textarea rows based on content + textareaRows(): number { + if (!this.payloadData.sampleText) { + return 5 // Default minimum rows + } + + // Count line breaks to determine basic row count + const lineCount = this.payloadData.sampleText.split('\n').length + let additionalLine = 0 + for (const line of this.payloadData.sampleText.split('\n')) { + if (line.length > 60) { + additionalLine += Math.floor(line.length / 60) + } + } + + // Use the larger of line count or estimated lines, with min 5 and max 20 + const calculatedRows = lineCount + additionalLine + return Math.max(5, Math.min(50, calculatedRows)) + }, + + // Validation computed properties + debugPortError(): string { + if (this.debugConfig.debugPort !== null && this.debugConfig.debugPort !== undefined) { + const port = Number(this.debugConfig.debugPort) + if (isNaN(port) || port < 1 || port > 65535) { + return 'Debug port must be between 1 and 65535' + } + } + return '' + }, + + otherDebugParamsError(): string { + if (this.debugConfig.otherDebugParams && this.debugConfig.otherDebugParams.trim() !== '') { + try { + JSON.parse(this.debugConfig.otherDebugParams) + } catch (error) { + return 'Other Debug Params must be a valid JSON object' + } + } + return '' + }, + + lambdaTimeoutError(): string { + if (this.debugConfig.lambdaTimeout !== undefined) { + const timeout = Number(this.debugConfig.lambdaTimeout) + if (isNaN(timeout) || timeout < 1 || timeout > 900) { + return 'Timeout override must be between 1 and 900 seconds' + } + } + return '' + }, + + // user can override the default provided layer and bring their own layer + // this is useful to support function with code signing config + lambdaLayerError(): string { + if (this.initialData.remoteDebugLayer && this.initialData.remoteDebugLayer.trim() !== '') { + const layerArn = this.initialData.remoteDebugLayer.trim() + + // Validate Lambda layer ARN format + // Expected format: arn:aws:lambda:region:account-id:layer:layer-name:version + const layerArnRegex = /^arn:aws:lambda:[a-z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:\d+$/ + + if (!layerArnRegex.test(layerArn)) { + return 'Layer ARN must be in the format: arn:aws:lambda:::layer::' + } + + // Extract region from ARN to validate it matches the function region + const arnParts = layerArn.split(':') + if (arnParts.length >= 4) { + const layerRegion = arnParts[3] + if (this.initialData.FunctionRegion && layerRegion !== this.initialData.FunctionRegion) { + return `Layer region (${layerRegion}) must match function region (${this.initialData.FunctionRegion})` + } + } + } + return '' + }, + }, + methods: { + // Runtime detection computed properties based on the runtime string + hasRuntimePrefix(prefix: string): boolean { + const runtime = this.initialData.Runtime || '' + return runtime.startsWith(prefix) + }, + // Sync state from workspace storage + async syncStateFromWorkspace() { + try { + // Update debugging state + this.debugState.isDebugging = await client.isWebViewDebugging() + this.debugConfig.localRootPath = await client.getLocalPath() + this.debugState.handlerFileAvailable = await client.getHandlerAvailable() + // Get current session state + + if (this.debugState.isDebugging) { + // Update invoke button state based on session + const isInvoking = await client.getIsInvoking() + + // If debugging is active and we're not showing the timer, + // calculate and show remaining time + this.clearDebugTimer() + if (this.debugState.isDebugging && !isInvoking) { + await this.startDebugTimer() + } + } else { + this.clearDebugTimer() + // no debug session + } + } catch (error) { + console.error('Failed to sync state from workspace:', error) + } + }, async newSelection() { const eventData = { - name: this.selectedTestEvent, + name: this.payloadData.selectedTestEvent, region: this.initialData.FunctionRegion, arn: this.initialData.FunctionArn, } const resp = await client.getRemoteTestEvents(eventData) - this.sampleText = JSON.stringify(JSON.parse(resp), undefined, 4) + this.payloadData.sampleText = JSON.stringify(JSON.parse(resp), undefined, 4) }, async saveEvent() { const eventData = { - name: this.newTestEventName, - event: this.sampleText, + name: this.payloadData.newTestEventName, + event: this.payloadData.sampleText, region: this.initialData.FunctionRegion, arn: this.initialData.FunctionArn, } await client.createRemoteTestEvents(eventData) - this.showNameInput = false - this.newTestEventName = '' - this.selectedTestEvent = eventData.name + this.uiState.showNameInput = false + this.payloadData.newTestEventName = '' + this.payloadData.selectedTestEvent = eventData.name this.initialData.TestEvents = await client.listRemoteTestEvents( this.initialData.FunctionArn, this.initialData.FunctionRegion @@ -77,46 +225,179 @@ export default defineComponent({ async promptForFileLocation() { const resp = await client.promptFile() if (resp) { - this.selectedFile = resp.selectedFile - this.selectedFilePath = resp.selectedFilePath + this.payloadData.selectedFile = resp.selectedFile + this.payloadData.selectedFilePath = resp.selectedFilePath + } + }, + async promptForFolderLocation() { + const resp = await client.promptFolder() + if (resp) { + this.debugConfig.localRootPath = resp + this.debugState.handlerFileAvailable = await client.getHandlerAvailable() } }, + onFileChange(event: Event) { const input = event.target as HTMLInputElement if (input.files && input.files.length > 0) { const file = input.files[0] - this.selectedFile = file.name + this.payloadData.selectedFile = file.name // Use Blob.text() to read the file as text file.text() .then((text) => { - this.sampleText = text + this.payloadData.sampleText = text }) .catch((error) => { console.error('Error reading file:', error) }) } }, + async debugPreCheck() { + if (!this.debugState.remoteDebuggingEnabled) { + // don't check if unchecking + this.debugState.remoteDebuggingEnabled = false + if (this.debugState.isDebugging) { + await client.stopDebugging() + } + } else { + // check when user is checking box + this.debugState.remoteDebuggingEnabled = await client.debugPreCheck() + this.debugConfig.localRootPath = await client.getLocalPath() + this.debugState.handlerFileAvailable = await client.getHandlerAvailable() + } + }, showNameField() { if (this.initialData.FunctionRegion || this.initialData.FunctionRegion) { - this.showNameInput = true + this.uiState.showNameInput = true } }, async sendInput() { + // Tell the backend to set the button state. This state is maintained even if webview loses focus + if (this.debugState.remoteDebuggingEnabled) { + // check few outof bound issue + if ( + this.debugConfig.lambdaTimeout && + (this.debugConfig.lambdaTimeout > 900 || this.debugConfig.lambdaTimeout < 0) + ) { + this.debugConfig.lambdaTimeout = 900 + } + if ( + this.debugConfig.debugPort && + (this.debugConfig.debugPort > 65535 || this.debugConfig.debugPort <= 0) + ) { + this.debugConfig.debugPort = 9229 + } + + // acquire invoke lock + if (this.debugState.remoteDebuggingEnabled && !(await client.checkReadyToInvoke())) { + return + } + + if (!this.debugState.isDebugging) { + this.debugState.isDebugging = await client.startDebugging({ + functionArn: this.initialData.FunctionArn, + functionName: this.initialData.FunctionName, + port: this.debugConfig.debugPort ?? 9229, + sourceMap: this.runtimeSettings.sourceMapEnabled, + localRoot: this.debugConfig.localRootPath, + shouldPublishVersion: this.debugConfig.shouldPublishVersion, + remoteRoot: + this.debugConfig.remoteRootPath !== '' ? this.debugConfig.remoteRootPath : '/var/task', + skipFiles: (this.runtimeSettings.skipFiles !== '' + ? this.runtimeSettings.skipFiles + : '/**' + ).split(','), + justMyCode: this.runtimeSettings.justMyCode, + projectName: this.runtimeSettings.projectName, + otherDebugParams: this.debugConfig.otherDebugParams, + layerArn: this.initialData.remoteDebugLayer, + lambdaTimeout: this.debugConfig.lambdaTimeout ?? 900, + outFiles: this.runtimeSettings.outFiles?.split(','), + }) + if (!this.debugState.isDebugging) { + // user cancel or failed to start debugging + return + } + } + this.debugState.showDebugTimer = false + } + let event = '' - if (this.payload === 'sampleEvents' || this.payload === 'savedEvents') { - event = this.sampleText - } else if (this.payload === 'localFile') { - if (this.selectedFile && this.selectedFilePath) { - const resp = await client.loadFile(this.selectedFilePath) + if (this.uiState.payload === 'sampleEvents' || this.uiState.payload === 'savedEvents') { + event = this.payloadData.sampleText + } else if (this.uiState.payload === 'localFile') { + if (this.payloadData.selectedFile && this.payloadData.selectedFilePath) { + const resp = await client.loadFile(this.payloadData.selectedFilePath) if (resp) { event = resp.sample } } } - await client.invokeLambda(event, this.initialData.Source) + + await client.invokeLambda(event, this.initialData.Source, this.debugState.remoteDebuggingEnabled) + await this.syncStateFromWorkspace() + }, + + async removeDebugSetup() { + this.debugState.isDebugging = await client.stopDebugging() + }, + + async startDebugTimer() { + this.debugState.debugTimeRemaining = await client.getDebugTimeRemaining() + if (this.debugState.debugTimeRemaining <= 0) { + return + } + this.debugState.showDebugTimer = true + this.debugState.debugTimer = window.setInterval(() => { + this.debugState.debugTimeRemaining-- + if (this.debugState.debugTimeRemaining <= 0) { + this.clearDebugTimer() + } + }, 1000) as number | undefined + }, + + clearDebugTimer() { + if (this.debugState.debugTimer) { + window.clearInterval(this.debugState.debugTimer) + this.debugState.debugTimeRemaining = 0 + this.debugState.debugTimer = undefined + this.debugState.showDebugTimer = false + } + }, + + toggleCollapsible() { + this.uiState.isCollapsed = !this.uiState.isCollapsed + }, + + async openHandler() { + await client.tryOpenHandlerFile() + }, + + async openHandlerWithDelay() { + const preValue = this.debugConfig.localRootPath + // user is inputting the dir, only try to open dir if user stopped typing for 1 second + await new Promise((resolve) => setTimeout(resolve, 1000)) + if (preValue !== this.debugConfig.localRootPath) { + return + } + // try open if user stop input for 1 second + await client.tryOpenHandlerFile(this.debugConfig.localRootPath) + this.debugState.handlerFileAvailable = await client.getHandlerAvailable() + }, + + async downloadRemoteCode() { + try { + const path = await client.downloadRemoteCode() + if (path) { + this.debugConfig.localRootPath = path + this.debugState.handlerFileAvailable = await client.getHandlerAvailable() + } + } catch (error) { + console.error('Failed to download remote code:', error) + } }, loadSampleEvent() { @@ -125,7 +406,7 @@ export default defineComponent({ if (!sample) { return } - this.sampleText = JSON.stringify(JSON.parse(sample), undefined, 4) + this.payloadData.sampleText = JSON.stringify(JSON.parse(sample), undefined, 4) }, (e) => { console.error('client.getSamplePayload failed: %s', (e as Error).message) @@ -135,10 +416,9 @@ export default defineComponent({ async loadRemoteTestEvents() { const shouldLoadEvents = - this.payload === 'savedEvents' && + this.uiState.payload === 'savedEvents' && this.initialData.FunctionArn && - this.initialData.FunctionRegion && - !this.initialData.TestEvents + this.initialData.FunctionRegion if (shouldLoadEvents) { this.initialData.TestEvents = await client.listRemoteTestEvents( @@ -148,5 +428,6 @@ export default defineComponent({ } }, }, + mixins: [saveData], }) diff --git a/packages/core/src/login/webview/commonAuthViewProvider.ts b/packages/core/src/login/webview/commonAuthViewProvider.ts index f805d7cf759..8ad5c71bcd1 100644 --- a/packages/core/src/login/webview/commonAuthViewProvider.ts +++ b/packages/core/src/login/webview/commonAuthViewProvider.ts @@ -148,6 +148,10 @@ export class CommonAuthViewProvider implements WebviewViewProvider { const entrypoint = serverHostname !== undefined ? Uri.parse(serverHostname).with({ path: `/${this.source}` }) : scriptUri + // Get Vue.js from dist/libs directory + const vueUri = Uri.joinPath(assetsPath, 'dist', 'libs', 'vue.min.js') + const vueScript = webview.asWebviewUri(vueUri) + return ` @@ -158,7 +162,7 @@ export class CommonAuthViewProvider implements WebviewViewProvider { Base View Extension - + diff --git a/packages/core/src/login/webview/vue/login.vue b/packages/core/src/login/webview/vue/login.vue index 312aa18029b..7973844f4d4 100644 --- a/packages/core/src/login/webview/vue/login.vue +++ b/packages/core/src/login/webview/vue/login.vue @@ -239,6 +239,11 @@
IAM Credentials:
Credentials will be added to the appropriate ~/.aws/ files
+ Learn More
Profile Name
The identifier for these credentials
implements vscode.Dispo public constructor( public readonly regionCode: string, - private readonly clientType: AwsClientConstructor + private readonly clientType: AwsClientConstructor, + private readonly isSageMaker: boolean = false ) {} protected getClient(ignoreCache: boolean = false) { - const args = { serviceClient: this.clientType, region: this.regionCode } + const args = { + serviceClient: this.clientType, + region: this.regionCode, + ...(this.isSageMaker + ? { + clientOptions: { + endpoint: `https://sagemaker.${this.regionCode}.amazonaws.com`, + region: this.regionCode, + }, + } + : {}), + } return ignoreCache ? globals.sdkClientBuilderV3.createAwsService(args) : globals.sdkClientBuilderV3.getAwsService(args) diff --git a/packages/core/src/shared/clients/lambdaClient.ts b/packages/core/src/shared/clients/lambdaClient.ts index 331564521ee..137af843e65 100644 --- a/packages/core/src/shared/clients/lambdaClient.ts +++ b/packages/core/src/shared/clients/lambdaClient.ts @@ -10,21 +10,30 @@ import globals from '../extensionGlobals' import { getLogger } from '../logger/logger' import { ClassToInterfaceType } from '../utilities/tsUtils' +import { LambdaClient as LambdaSdkClient, GetFunctionCommand, GetFunctionCommandOutput } from '@aws-sdk/client-lambda' +import { CancellationError } from '../utilities/timeoutUtils' +import { fromSSO } from '@aws-sdk/credential-provider-sso' +import { getIAMConnection } from '../../auth/utils' + export type LambdaClient = ClassToInterfaceType export class DefaultLambdaClient { private readonly defaultTimeoutInMs: number - public constructor(public readonly regionCode: string) { + public constructor( + public readonly regionCode: string, + public readonly userAgent: string | undefined = undefined + ) { this.defaultTimeoutInMs = 5 * 60 * 1000 // 5 minutes (SDK default is 2 minutes) } - public async deleteFunction(name: string): Promise { + public async deleteFunction(name: string, qualifier?: string): Promise { const sdkClient = await this.createSdkClient() const response = await sdkClient .deleteFunction({ FunctionName: name, + Qualifier: qualifier, }) .promise() @@ -33,7 +42,7 @@ export class DefaultLambdaClient { } } - public async invoke(name: string, payload?: _Blob): Promise { + public async invoke(name: string, payload?: _Blob, version?: string): Promise { const sdkClient = await this.createSdkClient() const response = await sdkClient @@ -41,6 +50,7 @@ export class DefaultLambdaClient { FunctionName: name, LogType: 'Tail', Payload: payload, + Qualifier: version, }) .promise() @@ -80,6 +90,39 @@ export class DefaultLambdaClient { } } + public async getLayerVersion(name: string, version: number): Promise { + getLogger().debug(`getLayerVersion called for LayerName: ${name}, VersionNumber ${version}`) + const client = await this.createSdkClient() + + try { + const response = await client.getLayerVersion({ LayerName: name, VersionNumber: version }).promise() + // prune `Code` from logs so we don't reveal a signed link to customer resources. + getLogger().debug('getLayerVersion returned response (code section pruned): %O', { + ...response, + Code: 'Pruned', + }) + return response + } catch (e) { + getLogger().error('Failed to get function: %s', e) + throw e + } + } + + public async *listLayerVersions(name: string): AsyncIterableIterator { + const client = await this.createSdkClient() + + const request: Lambda.ListLayerVersionsRequest = { LayerName: name } + do { + const response: Lambda.ListLayerVersionsResponse = await client.listLayerVersions(request).promise() + + if (response.LayerVersions) { + yield* response.LayerVersions + } + + request.Marker = response.NextMarker + } while (request.Marker) + } + public async getFunctionUrlConfigs(name: string): Promise { getLogger().debug(`GetFunctionUrlConfig called for function: ${name}`) const client = await this.createSdkClient() @@ -120,11 +163,145 @@ export class DefaultLambdaClient { } } + public async updateFunctionConfiguration( + params: Lambda.UpdateFunctionConfigurationRequest, + options: { + maxRetries?: number + initialDelayMs?: number + backoffMultiplier?: number + waitForUpdate?: boolean + } = {} + ): Promise { + const client = await this.createSdkClient() + const maxRetries = options.maxRetries ?? 5 + const initialDelayMs = options.initialDelayMs ?? 1000 + const backoffMultiplier = options.backoffMultiplier ?? 2 + // return until lambda update is completed + const waitForUpdate = options.waitForUpdate ?? false + + let retryCount = 0 + let lastError: any + + // there could be race condition, if function is being updated, wait and retry + while (retryCount <= maxRetries) { + try { + const response = await client.updateFunctionConfiguration(params).promise() + getLogger().debug('updateFunctionConfiguration returned response: %O', response) + if (waitForUpdate) { + // don't return if wait for result + break + } + return response + } catch (e) { + lastError = e + + // Check if this is an "update in progress" error + if (this.isUpdateInProgressError(e) && retryCount < maxRetries) { + const delayMs = initialDelayMs * Math.pow(backoffMultiplier, retryCount) + getLogger().info( + `Update in progress for Lambda function ${params.FunctionName}. ` + + `Retrying in ${delayMs}ms (attempt ${retryCount + 1}/${maxRetries})` + ) + + await new Promise((resolve) => setTimeout(resolve, delayMs)) + retryCount++ + } else { + getLogger().error('Failed to run updateFunctionConfiguration: %s', e) + throw e + } + } + } + + // check if lambda update is completed, use client.getFunctionConfiguration to poll until + // LastUpdateStatus is Successful or Failed + if (waitForUpdate) { + let lastUpdateStatus = 'InProgress' + while (lastUpdateStatus === 'InProgress') { + await new Promise((resolve) => setTimeout(resolve, 1000)) + const response = await client.getFunctionConfiguration({ FunctionName: params.FunctionName }).promise() + lastUpdateStatus = response.LastUpdateStatus ?? 'Failed' + if (lastUpdateStatus === 'Successful') { + return response + } else if (lastUpdateStatus === 'Failed') { + getLogger().error('Failed to update function configuration: %O', response) + throw new Error(`Failed to update function configuration: ${response.LastUpdateStatusReason}`) + } + } + } + + getLogger().error(`Failed to update function configuration after ${maxRetries} retries: %s`, lastError) + throw lastError + } + + public async publishVersion( + name: string, + options: { waitForUpdate?: boolean } = {} + ): Promise { + const client = await this.createSdkClient() + // return until lambda update is completed + const waitForUpdate = options.waitForUpdate ?? false + const response = await client + .publishVersion({ + FunctionName: name, + }) + .promise() + + if (waitForUpdate) { + let state = 'Pending' + while (state === 'Pending') { + await new Promise((resolve) => setTimeout(resolve, 1000)) + const statusResponse = await client + .getFunctionConfiguration({ FunctionName: name, Qualifier: response.Version }) + .promise() + state = statusResponse.State ?? 'Failed' + if (state === 'Active' || state === 'InActive') { + // version creation finished + return statusResponse + } else if (state === 'Failed') { + getLogger().error('Failed to create Version: %O', statusResponse) + throw new Error(`Failed to create Version: ${statusResponse.LastUpdateStatusReason}`) + } + } + } + + return response + } + + private isUpdateInProgressError(error: any): boolean { + return ( + error?.message && + error.message.includes( + 'The operation cannot be performed at this time. An update is in progress for resource:' + ) + ) + } + private async createSdkClient(): Promise { return await globals.sdkClientBuilder.createAwsService( Lambda, - { httpOptions: { timeout: this.defaultTimeoutInMs } }, + { + httpOptions: { timeout: this.defaultTimeoutInMs }, + customUserAgent: this.userAgent, + }, this.regionCode ) } } + +export async function getFunctionWithCredentials(region: string, name: string): Promise { + const connection = await getIAMConnection({ + prompt: true, + messageText: 'Opening a Lambda Function requires you to be authenticated.', + }) + + if (!connection) { + throw new CancellationError('user') + } + + const credentials = + connection.type === 'iam' ? await connection.getCredentials() : fromSSO({ profile: connection.id }) + const client = new LambdaSdkClient({ region, credentials }) + + const command = new GetFunctionCommand({ FunctionName: name }) + return client.send(command) +} diff --git a/packages/core/src/shared/clients/sagemaker.ts b/packages/core/src/shared/clients/sagemaker.ts new file mode 100644 index 00000000000..8a8e138dd85 --- /dev/null +++ b/packages/core/src/shared/clients/sagemaker.ts @@ -0,0 +1,318 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' +import { + AppDetails, + CreateAppCommand, + CreateAppCommandInput, + CreateAppCommandOutput, + DeleteAppCommand, + DeleteAppCommandInput, + DeleteAppCommandOutput, + DescribeAppCommand, + DescribeAppCommandInput, + DescribeAppCommandOutput, + DescribeDomainCommand, + DescribeDomainCommandInput, + DescribeDomainCommandOutput, + DescribeDomainResponse, + DescribeSpaceCommand, + DescribeSpaceCommandInput, + DescribeSpaceCommandOutput, + ListAppsCommandInput, + ListSpacesCommandInput, + ResourceSpec, + SageMakerClient, + SpaceDetails, + UpdateSpaceCommand, + UpdateSpaceCommandInput, + UpdateSpaceCommandOutput, + paginateListApps, + paginateListSpaces, +} from '@amzn/sagemaker-client' +import { isEmpty } from 'lodash' +import { sleep } from '../utilities/timeoutUtils' +import { ClientWrapper } from './clientWrapper' +import { AsyncCollection } from '../utilities/asyncCollection' +import { + InstanceTypeError, + InstanceTypeMinimum, + InstanceTypeInsufficientMemory, + InstanceTypeInsufficientMemoryMessage, + InstanceTypeNotSelectedMessage, +} from '../../awsService/sagemaker/constants' +import { getDomainSpaceKey } from '../../awsService/sagemaker/utils' +import { getLogger } from '../logger/logger' +import { ToolkitError } from '../errors' +import { yes, no, continueText, cancel } from '../localizedText' + +export interface SagemakerSpaceApp extends SpaceDetails { + App?: AppDetails + DomainSpaceKey: string +} +export class SagemakerClient extends ClientWrapper { + public constructor(public override readonly regionCode: string) { + super(regionCode, SageMakerClient, true) + } + + public listSpaces(request: ListSpacesCommandInput = {}): AsyncCollection { + // @ts-ignore: Suppressing type mismatch on paginator return type + return this.makePaginatedRequest(paginateListSpaces, request, (page) => page.Spaces) + } + + public listApps(request: ListAppsCommandInput = {}): AsyncCollection { + // @ts-ignore: Suppressing type mismatch on paginator return type + return this.makePaginatedRequest(paginateListApps, request, (page) => page.Apps) + } + + public describeApp(request: DescribeAppCommandInput): Promise { + return this.makeRequest(DescribeAppCommand, request) + } + + public describeDomain(request: DescribeDomainCommandInput): Promise { + return this.makeRequest(DescribeDomainCommand, request) + } + + public describeSpace(request: DescribeSpaceCommandInput): Promise { + return this.makeRequest(DescribeSpaceCommand, request) + } + + public updateSpace(request: UpdateSpaceCommandInput): Promise { + return this.makeRequest(UpdateSpaceCommand, request) + } + + public createApp(request: CreateAppCommandInput): Promise { + return this.makeRequest(CreateAppCommand, request) + } + + public deleteApp(request: DeleteAppCommandInput): Promise { + return this.makeRequest(DeleteAppCommand, request) + } + + public async startSpace(spaceName: string, domainId: string) { + let spaceDetails: DescribeSpaceCommandOutput + + // Get existing space details + try { + spaceDetails = await this.describeSpace({ + DomainId: domainId, + SpaceName: spaceName, + }) + } catch (err) { + throw this.handleStartSpaceError(err) + } + + // Get app type + const appType = spaceDetails.SpaceSettings?.AppType + if (appType !== 'JupyterLab' && appType !== 'CodeEditor') { + throw new ToolkitError(`Unsupported AppType "${appType}" for space "${spaceName}"`) + } + + // Get app resource spec + const requestedResourceSpec = + appType === 'JupyterLab' + ? spaceDetails.SpaceSettings?.JupyterLabAppSettings?.DefaultResourceSpec + : spaceDetails.SpaceSettings?.CodeEditorAppSettings?.DefaultResourceSpec + + let instanceType = requestedResourceSpec?.InstanceType + + // Is InstanceType defined and has enough memory? + if (instanceType && instanceType in InstanceTypeInsufficientMemory) { + // Prompt user to select one with sufficient memory (1 level up from their chosen one) + const response = await vscode.window.showErrorMessage( + InstanceTypeInsufficientMemoryMessage( + spaceDetails.SpaceName || '', + instanceType, + InstanceTypeInsufficientMemory[instanceType] + ), + yes, + no + ) + + if (response === no) { + throw new ToolkitError('InstanceType has insufficient memory.', { code: InstanceTypeError }) + } + + instanceType = InstanceTypeInsufficientMemory[instanceType] + } else if (!instanceType) { + // Prompt user to select the minimum supported instance type + const response = await vscode.window.showErrorMessage( + InstanceTypeNotSelectedMessage(spaceDetails.SpaceName || ''), + continueText, + cancel + ) + + if (response === cancel) { + throw new ToolkitError('InstanceType not defined.', { code: InstanceTypeError }) + } + + instanceType = InstanceTypeMinimum + } + + // Get remote access flag + if (!spaceDetails.SpaceSettings?.RemoteAccess || spaceDetails.SpaceSettings?.RemoteAccess === 'DISABLED') { + try { + await this.updateSpace({ + DomainId: domainId, + SpaceName: spaceName, + SpaceSettings: { + RemoteAccess: 'ENABLED', + }, + }) + await this.waitForSpaceInService(spaceName, domainId) + } catch (err) { + throw this.handleStartSpaceError(err) + } + } + + const resourceSpec: ResourceSpec = { + // Default values + SageMakerImageArn: 'arn:aws:sagemaker:us-west-2:542918446943:image/sagemaker-distribution-cpu', + SageMakerImageVersionAlias: '3.2.0', + + // The existing resource spec + ...requestedResourceSpec, + + // The instance type user has chosen + InstanceType: instanceType, + } + + const cleanedResourceSpec = + resourceSpec && 'EnvironmentArn' in resourceSpec + ? { ...resourceSpec, EnvironmentArn: undefined, EnvironmentVersionArn: undefined } + : resourceSpec + + const createAppRequest: CreateAppCommandInput = { + DomainId: domainId, + SpaceName: spaceName, + AppType: appType, + AppName: 'default', + ResourceSpec: cleanedResourceSpec, + } + + try { + await this.createApp(createAppRequest) + } catch (err) { + throw this.handleStartSpaceError(err) + } + } + + public async fetchSpaceAppsAndDomains(): Promise< + [Map, Map] + > { + try { + const appMap: Map = await this.listApps() + .flatten() + .filter((app) => !!app.DomainId && !!app.SpaceName) + .filter((app) => app.AppType === 'JupyterLab' || app.AppType === 'CodeEditor') + .toMap((app) => getDomainSpaceKey(app.DomainId || '', app.SpaceName || '')) + + const spaceApps: Map = await this.listSpaces() + .flatten() + .filter((space) => !!space.DomainId && !!space.SpaceName) + .map((space) => { + const key = getDomainSpaceKey(space.DomainId || '', space.SpaceName || '') + return { ...space, App: appMap.get(key), DomainSpaceKey: key } + }) + .toMap((space) => getDomainSpaceKey(space.DomainId || '', space.SpaceName || '')) + + // Get de-duped list of domain IDs for all of the spaces + const domainIds: string[] = [...new Set([...spaceApps].map(([_, spaceApp]) => spaceApp.DomainId || ''))] + + // Get details for each domain + const domains: [string, DescribeDomainResponse][] = await Promise.all( + domainIds.map(async (domainId, index) => { + await sleep(index * 100) + const response = await this.describeDomain({ DomainId: domainId }) + return [domainId, response] + }) + ) + + const domainsMap = new Map(domains) + + const filteredSpaceApps = new Map( + [...spaceApps] + // Filter out SageMaker Unified Studio domains + .filter(([_, spaceApp]) => + isEmpty(domainsMap.get(spaceApp.DomainId || '')?.DomainSettings?.UnifiedStudioSettings) + ) + ) + + return [filteredSpaceApps, domainsMap] + } catch (err) { + const error = err as Error + getLogger().error('Failed to fetch space apps: %s', err) + if (error.name === 'AccessDeniedException') { + void vscode.window.showErrorMessage( + 'AccessDeniedException: You do not have permission to view spaces. Please contact your administrator', + { modal: false, detail: 'AWS Toolkit' } + ) + } + throw err + } + } + + private async waitForSpaceInService( + spaceName: string, + domainId: string, + maxRetries = 30, + intervalMs = 5000 + ): Promise { + for (let attempt = 0; attempt < maxRetries; attempt++) { + const result = await this.describeSpace({ SpaceName: spaceName, DomainId: domainId }) + + if (result.Status === 'InService') { + return + } + + await sleep(intervalMs) + } + + throw new ToolkitError( + `Timed out waiting for space "${spaceName}" in domain "${domainId}" to reach "InService" status.` + ) + } + + public async waitForAppInService( + domainId: string, + spaceName: string, + appType: string, + maxRetries = 30, + intervalMs = 5000 + ): Promise { + for (let attempt = 0; attempt < maxRetries; attempt++) { + const { Status } = await this.describeApp({ + DomainId: domainId, + SpaceName: spaceName, + AppType: appType as any, + AppName: 'default', + }) + + if (Status === 'InService') { + return + } + + if (['Failed', 'DeleteFailed'].includes(Status ?? '')) { + throw new ToolkitError(`App failed to start. Status: ${Status}`) + } + + await sleep(intervalMs) + } + + throw new ToolkitError(`Timed out waiting for app "${spaceName}" to reach "InService" status.`) + } + + private handleStartSpaceError(err: unknown) { + const error = err as Error + if (error.name === 'AccessDeniedException') { + throw new ToolkitError('You do not have permission to start spaces. Please contact your administrator', { + cause: error, + }) + } else { + throw err + } + } +} diff --git a/packages/core/src/shared/clients/stepFunctions.ts b/packages/core/src/shared/clients/stepFunctions.ts new file mode 100644 index 00000000000..22483307654 --- /dev/null +++ b/packages/core/src/shared/clients/stepFunctions.ts @@ -0,0 +1,68 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import { + CreateStateMachineCommand, + CreateStateMachineCommandInput, + CreateStateMachineCommandOutput, + DescribeStateMachineCommand, + DescribeStateMachineCommandInput, + DescribeStateMachineCommandOutput, + ListStateMachinesCommand, + ListStateMachinesCommandInput, + ListStateMachinesCommandOutput, + SFNClient, + StartExecutionCommand, + StartExecutionCommandInput, + StartExecutionCommandOutput, + StateMachineListItem, + TestStateCommand, + TestStateCommandInput, + TestStateCommandOutput, + UpdateStateMachineCommand, + UpdateStateMachineCommandInput, + UpdateStateMachineCommandOutput, +} from '@aws-sdk/client-sfn' +import { ClientWrapper } from './clientWrapper' + +export class StepFunctionsClient extends ClientWrapper { + public constructor(regionCode: string) { + super(regionCode, SFNClient) + } + + public async *listStateMachines( + request: ListStateMachinesCommandInput = {} + ): AsyncIterableIterator { + do { + const response: ListStateMachinesCommandOutput = await this.makeRequest(ListStateMachinesCommand, request) + if (response.stateMachines) { + yield* response.stateMachines + } + request.nextToken = response.nextToken + } while (request.nextToken) + } + + public async getStateMachineDetails( + request: DescribeStateMachineCommandInput + ): Promise { + return this.makeRequest(DescribeStateMachineCommand, request) + } + + public async executeStateMachine(request: StartExecutionCommandInput): Promise { + return this.makeRequest(StartExecutionCommand, request) + } + + public async createStateMachine(request: CreateStateMachineCommandInput): Promise { + return this.makeRequest(CreateStateMachineCommand, request) + } + + public async updateStateMachine(request: UpdateStateMachineCommandInput): Promise { + return this.makeRequest(UpdateStateMachineCommand, request) + } + + public async testState(request: TestStateCommandInput): Promise { + return this.makeRequest(TestStateCommand, request) + } +} diff --git a/packages/core/src/shared/clients/stepFunctionsClient.ts b/packages/core/src/shared/clients/stepFunctionsClient.ts deleted file mode 100644 index 66d45bcd58a..00000000000 --- a/packages/core/src/shared/clients/stepFunctionsClient.ts +++ /dev/null @@ -1,79 +0,0 @@ -/*! - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -import { StepFunctions } from 'aws-sdk' -import globals from '../extensionGlobals' -import { ClassToInterfaceType } from '../utilities/tsUtils' - -export type StepFunctionsClient = ClassToInterfaceType -export class DefaultStepFunctionsClient { - public constructor(public readonly regionCode: string) {} - - public async *listStateMachines(): AsyncIterableIterator { - const client = await this.createSdkClient() - - const request: StepFunctions.ListStateMachinesInput = {} - do { - const response: StepFunctions.ListStateMachinesOutput = await client.listStateMachines(request).promise() - - if (response.stateMachines) { - yield* response.stateMachines - } - - request.nextToken = response.nextToken - } while (request.nextToken) - } - - public async getStateMachineDetails(arn: string): Promise { - const client = await this.createSdkClient() - - const request: StepFunctions.DescribeStateMachineInput = { - stateMachineArn: arn, - } - - const response: StepFunctions.DescribeStateMachineOutput = await client.describeStateMachine(request).promise() - - return response - } - - public async executeStateMachine(arn: string, input?: string): Promise { - const client = await this.createSdkClient() - - const request: StepFunctions.StartExecutionInput = { - stateMachineArn: arn, - input: input, - } - - const response: StepFunctions.StartExecutionOutput = await client.startExecution(request).promise() - - return response - } - - public async createStateMachine( - params: StepFunctions.CreateStateMachineInput - ): Promise { - const client = await this.createSdkClient() - - return client.createStateMachine(params).promise() - } - - public async updateStateMachine( - params: StepFunctions.UpdateStateMachineInput - ): Promise { - const client = await this.createSdkClient() - - return client.updateStateMachine(params).promise() - } - - public async testState(params: StepFunctions.TestStateInput): Promise { - const client = await this.createSdkClient() - - return await client.testState(params).promise() - } - - private async createSdkClient(): Promise { - return await globals.sdkClientBuilder.createAwsService(StepFunctions, undefined, this.regionCode) - } -} diff --git a/packages/core/src/shared/cloudformation/cloudformation.ts b/packages/core/src/shared/cloudformation/cloudformation.ts index 5d08bb836dc..690a5aee73c 100644 --- a/packages/core/src/shared/cloudformation/cloudformation.ts +++ b/packages/core/src/shared/cloudformation/cloudformation.ts @@ -16,6 +16,10 @@ import { isUntitledScheme, normalizeVSCodeUri } from '../utilities/vsCodeUtils' export const SERVERLESS_API_TYPE = 'AWS::Serverless::Api' // eslint-disable-line @typescript-eslint/naming-convention export const SERVERLESS_FUNCTION_TYPE = 'AWS::Serverless::Function' // eslint-disable-line @typescript-eslint/naming-convention export const LAMBDA_FUNCTION_TYPE = 'AWS::Lambda::Function' // eslint-disable-line @typescript-eslint/naming-convention +export const LAMBDA_LAYER_TYPE = 'AWS::Lambda::LayerVersion' // eslint-disable-line @typescript-eslint/naming-convention +export const LAMBDA_URL_TYPE = 'AWS::Lambda::Url' // eslint-disable-line @typescript-eslint/naming-convention +export const SERVERLESS_LAYER_TYPE = 'AWS::Serverless::LayerVersion' // eslint-disable-line @typescript-eslint/naming-convention + export const serverlessTableType = 'AWS::Serverless::SimpleTable' export const s3BucketType = 'AWS::S3::Bucket' export const appRunnerType = 'AWS::AppRunner::Service' diff --git a/packages/core/src/shared/constants.ts b/packages/core/src/shared/constants.ts index 48e64342e57..95d2aaac309 100644 --- a/packages/core/src/shared/constants.ts +++ b/packages/core/src/shared/constants.ts @@ -4,6 +4,7 @@ */ import * as vscode from 'vscode' +import { manageAccessGuideURL } from '../amazonq/webview/ui/texts/constants' export const profileSettingKey = 'profile' export const productName: string = 'aws-toolkit-vscode' @@ -196,3 +197,11 @@ export const amazonQVscodeMarketplace = export const crashMonitoringDirName = 'crashMonitoring' export const amazonQTabSuffix = '(Generated by Amazon Q)' + +/** + * Common strings used throughout the application + */ + +export const uploadCodeError = `I'm sorry, I couldn't upload your workspace artifacts to Amazon S3 to help you with this task. You might need to allow access to the S3 bucket. For more information, see the [Amazon Q documentation](${manageAccessGuideURL}) or contact your network or organization administrator.` + +export const featureName = 'Amazon Q Developer Agent for software development' diff --git a/packages/core/src/shared/datetime.ts b/packages/core/src/shared/datetime.ts index 6123421666a..8043f94d343 100644 --- a/packages/core/src/shared/datetime.ts +++ b/packages/core/src/shared/datetime.ts @@ -154,3 +154,25 @@ export function formatDateTimestamp(forceUTC: boolean, d: Date = new Date()): st // trim 'Z' (last char of iso string) and add offset string return `${iso.substring(0, iso.length - 1)}${offsetString}` } + +/** + * Checks if a given timestamp is within 30 days of the current day + * @param timeStamp + * @returns true if timeStamp is within 30 days, false otherwise + */ +export function isWithin30Days(timeStamp: string): boolean { + if (!timeStamp) { + return false // No timestamp given + } + + const startDate = new Date(timeStamp) + const currentDate = new Date() + + // Calculate the difference in milliseconds + const timeDifference = currentDate.getTime() - startDate.getTime() + + // Convert milliseconds to days (1000ms * 60s * 60min * 24hr) + const daysDifference = timeDifference / (1000 * 60 * 60 * 24) + + return daysDifference <= 30 +} diff --git a/packages/core/src/shared/db/chatDb/util.ts b/packages/core/src/shared/db/chatDb/util.ts index fc681b2b5a5..316cbe5660c 100644 --- a/packages/core/src/shared/db/chatDb/util.ts +++ b/packages/core/src/shared/db/chatDb/util.ts @@ -267,16 +267,10 @@ function getTabTypeIcon(tabType: TabType): MynahIconsType { switch (tabType) { case 'cwc': return 'chat' - case 'doc': - return 'file' case 'review': return 'bug' case 'gumby': return 'transform' - case 'testgen': - return 'check-list' - case 'featuredev': - return 'code-block' default: return 'chat' } diff --git a/packages/core/src/shared/errors.ts b/packages/core/src/shared/errors.ts index 7cec122acaf..5d114043be3 100644 --- a/packages/core/src/shared/errors.ts +++ b/packages/core/src/shared/errors.ts @@ -15,7 +15,7 @@ import type * as os from 'os' import { CodeWhispererStreamingServiceException } from '@amzn/codewhisperer-streaming' import { driveLetterRegex } from './utilities/pathUtils' import { getLogger } from './logger/logger' -import { crashMonitoringDirName } from './constants' +import { crashMonitoringDirName, uploadCodeError } from './constants' import { RequestCancelledError } from './request' let _username = 'unknown-user' @@ -849,6 +849,21 @@ export class ServiceError extends ToolkitError { } } +export class UploadURLExpired extends ClientError { + constructor() { + super( + "I’m sorry, I wasn't able to generate code. A connection timed out or became unavailable. Please try again or check the following:\n\n- Exclude non-essential files in your workspace’s .gitignore.\n\n- Check that your network connection is stable.", + { code: 'UploadURLExpired' } + ) + } +} + +export class UploadCodeError extends ServiceError { + constructor(statusCode: string) { + super(uploadCodeError, { code: `UploadCode-${statusCode}` }) + } +} + export class ContentLengthError extends ClientError { constructor(message: string, info: ErrorInformation = { code: 'ContentLengthError' }) { super(message, info) diff --git a/packages/core/src/shared/extensionUtilities.ts b/packages/core/src/shared/extensionUtilities.ts index 9675f060951..80bedf1e0f6 100644 --- a/packages/core/src/shared/extensionUtilities.ts +++ b/packages/core/src/shared/extensionUtilities.ts @@ -11,7 +11,7 @@ import { getLogger } from './logger/logger' import { VSCODE_EXTENSION_ID, extensionAlphaVersion } from './extensions' import { Ec2MetadataClient } from './clients/ec2MetadataClient' import { DefaultEc2MetadataClient } from './clients/ec2MetadataClient' -import { extensionVersion, getCodeCatalystDevEnvId } from './vscode/env' +import { extensionVersion, getCodeCatalystDevEnvId, hasSageMakerEnvVars } from './vscode/env' import globals from './extensionGlobals' import { once } from './utilities/functionUtils' import { @@ -150,7 +150,11 @@ function createCloud9Properties(company: string): IdeProperties { } } -function isSageMakerUnifiedStudio(): boolean { +/** + * export method - for testing purposes only + * @internal + */ +export function isSageMakerUnifiedStudio(): boolean { if (serviceName === notInitialized) { serviceName = process.env.SERVICE_NAME ?? '' isSMUS = serviceName === sageMakerUnifiedStudio @@ -158,6 +162,15 @@ function isSageMakerUnifiedStudio(): boolean { return isSMUS } +/** + * Reset cached SageMaker state - for testing purposes only + * @internal + */ +export function resetSageMakerState(): void { + serviceName = notInitialized + isSMUS = false +} + /** * Decides if the current system is (the specified flavor of) Cloud9. */ @@ -176,18 +189,35 @@ export function isCloud9(flavor: 'classic' | 'codecatalyst' | 'any' = 'any'): bo * @returns true if the current system is SageMaker(SMAI or SMUS) */ export function isSageMaker(appName: 'SMAI' | 'SMUS' = 'SMAI'): boolean { + // Check for SageMaker-specific environment variables first + let hasSMEnvVars: boolean = false + if (hasSageMakerEnvVars()) { + getLogger().debug('SageMaker environment detected via environment variables') + hasSMEnvVars = true + } + switch (appName) { case 'SMAI': - return vscode.env.appName === sageMakerAppname + return vscode.env.appName === sageMakerAppname && hasSMEnvVars case 'SMUS': - return vscode.env.appName === sageMakerAppname && isSageMakerUnifiedStudio() + return vscode.env.appName === sageMakerAppname && isSageMakerUnifiedStudio() && hasSMEnvVars default: return false } } export function isCn(): boolean { - return getComputeRegion()?.startsWith('cn') ?? false + try { + const region = getComputeRegion() + if (!region || region === 'notInitialized') { + getLogger().debug('isCn called before compute region initialized, defaulting to false') + return false + } + return region.startsWith('cn') + } catch (err) { + getLogger().error(`Error in isCn method: ${err}`) + return false + } } /** diff --git a/packages/core/src/shared/featureConfig.ts b/packages/core/src/shared/featureConfig.ts index d7acb9657be..c7b111b3243 100644 --- a/packages/core/src/shared/featureConfig.ts +++ b/packages/core/src/shared/featureConfig.ts @@ -55,6 +55,9 @@ export const featureDefinitions = new Map([ export class FeatureConfigProvider { private featureConfigs = new Map() + private fetchPromise: Promise | undefined = undefined + private lastFetchTime = 0 + private readonly minFetchInterval = 5000 // 5 seconds minimum between fetches static #instance: FeatureConfigProvider @@ -123,6 +126,28 @@ export class FeatureConfigProvider { return } + // Debounce multiple concurrent calls + const now = performance.now() + if (this.fetchPromise && now - this.lastFetchTime < this.minFetchInterval) { + getLogger().debug('amazonq: Debouncing feature config fetch') + return this.fetchPromise + } + + if (this.fetchPromise) { + return this.fetchPromise + } + + this.lastFetchTime = now + this.fetchPromise = this._fetchFeatureConfigsInternal() + + try { + await this.fetchPromise + } finally { + this.fetchPromise = undefined + } + } + + private async _fetchFeatureConfigsInternal(): Promise { getLogger().debug('amazonq: Fetching feature configs') try { const response = await this.listFeatureEvaluations() diff --git a/packages/core/src/shared/filesystemUtilities.ts b/packages/core/src/shared/filesystemUtilities.ts index 54ca5b4b0e1..6414fd11b66 100644 --- a/packages/core/src/shared/filesystemUtilities.ts +++ b/packages/core/src/shared/filesystemUtilities.ts @@ -20,8 +20,6 @@ export const tempDirPath = path.join( 'aws-toolkit-vscode' ) -export const testGenerationLogsDir = path.join(tempDirPath, 'testGenerationLogs') - export async function getDirSize(dirPath: string, startTime: number, duration: number): Promise { if (performance.now() - startTime > duration) { getLogger().warn('getDirSize: exceeds time limit') diff --git a/packages/core/src/shared/globalState.ts b/packages/core/src/shared/globalState.ts index 13db46b430a..e8e6a3bff44 100644 --- a/packages/core/src/shared/globalState.ts +++ b/packages/core/src/shared/globalState.ts @@ -79,6 +79,10 @@ export type globalKey = | 'aws.toolkit.lambda.walkthroughSelected' | 'aws.toolkit.lambda.walkthroughCompleted' | 'aws.toolkit.appComposer.templateToOpenOnStart' + | 'aws.lambda.remoteDebugContext' + | 'aws.lambda.remoteDebugSnapshot' + // List of Domain-Users to show/hide Sagemaker SpaceApps in AWS Explorer. + | 'aws.sagemaker.selectedDomainUsers' /** * Extension-local (not visible to other vscode extensions) shared state which persists after IDE diff --git a/packages/core/src/shared/index.ts b/packages/core/src/shared/index.ts index 226ae6280b8..8b62fd3c5dc 100644 --- a/packages/core/src/shared/index.ts +++ b/packages/core/src/shared/index.ts @@ -27,7 +27,7 @@ export { Prompter } from './ui/prompter' export { VirtualFileSystem } from './virtualFilesystem' export { VirtualMemoryFile } from './virtualMemoryFile' export { AmazonqCreateUpload, Metric } from './telemetry/telemetry' -export { getClientId, getOperatingSystem, getOptOutPreference } from './telemetry/util' +export { getClientId, getClientName, getOperatingSystem, getOptOutPreference } from './telemetry/util' export { extensionVersion } from './vscode/env' export { cast } from './utilities/typeConstructors' export * as workspaceUtils from './utilities/workspaceUtils' @@ -52,6 +52,7 @@ export * from './utilities/pathUtils' export * from './utilities/zipStream' export * as editorUtilities from './utilities/editorUtilities' export * as functionUtilities from './utilities/functionUtils' +export * as diffUtilities from './utilities/diffUtils' export * as vscodeUtilities from './utilities/vsCodeUtils' export * from './errors' export { isTextEditor } from './utilities/editorUtilities' @@ -79,3 +80,4 @@ export * as BaseLspInstaller from './lsp/baseLspInstaller' export * as collectionUtil from './utilities/collectionUtils' export * from './datetime' export * from './performance/marks' +export * as mementoUtils from './utilities/mementos' diff --git a/packages/core/src/shared/logger/logger.ts b/packages/core/src/shared/logger/logger.ts index eb2602c30b9..95c4c7af769 100644 --- a/packages/core/src/shared/logger/logger.ts +++ b/packages/core/src/shared/logger/logger.ts @@ -22,6 +22,7 @@ export type LogTopic = | 'resourceCache' | 'telemetry' | 'proxyUtil' + | 'sagemaker' class ErrorLog { constructor( diff --git a/packages/core/src/shared/lsp/utils/platform.ts b/packages/core/src/shared/lsp/utils/platform.ts index 67f3b95c296..190a29f7ab1 100644 --- a/packages/core/src/shared/lsp/utils/platform.ts +++ b/packages/core/src/shared/lsp/utils/platform.ts @@ -3,15 +3,18 @@ * SPDX-License-Identifier: Apache-2.0 */ +import * as vscode from 'vscode' import { ToolkitError } from '../../errors' -import { Logger, getLogger } from '../../logger/logger' +import { Logger } from '../../logger/logger' import { ChildProcess } from '../../utilities/processUtils' import { waitUntil } from '../../utilities/timeoutUtils' -import { isDebugInstance } from '../../vscode/env' -import { tmpdir } from 'os' -import { join } from 'path' -import * as nodefs from 'fs' // eslint-disable-line no-restricted-imports -import * as vscode from 'vscode' +import { isDebugInstance, isRemoteWorkspace } from '../../vscode/env' +import { isSageMaker } from '../../extensionUtilities' +import { getLogger } from '../../logger/logger' + +interface SagemakerCookie { + authMode?: 'Sso' | 'Iam' +} export function getNodeExecutableName(): string { return process.platform === 'win32' ? 'node.exe' : 'node' @@ -85,67 +88,18 @@ export async function validateNodeExe(nodePath: string[], lsp: string, args: str } } -/** - * Gets proxy settings and certificates from VS Code - */ -export async function getVSCodeSettings(): Promise<{ proxyUrl?: string; certificatePath?: string }> { - const result: { proxyUrl?: string; certificatePath?: string } = {} - const logger = getLogger('amazonqLsp') - - try { - // Get proxy settings from VS Code configuration - const httpConfig = vscode.workspace.getConfiguration('http') - const proxy = httpConfig.get('proxy') - if (proxy) { - result.proxyUrl = proxy - logger.info(`Using proxy from VS Code settings: ${proxy}`) - } - } catch (err) { - logger.error(`Failed to get VS Code settings: ${err}`) - return result - } - try { - const tls = await import('tls') - // @ts-ignore Get system certificates - const systemCerts = tls.getCACertificates('system') - // @ts-ignore Get any existing extra certificates - const extraCerts = tls.getCACertificates('extra') - const allCerts = [...systemCerts, ...extraCerts] - if (allCerts && allCerts.length > 0) { - logger.info(`Found ${allCerts.length} certificates in system's trust store`) - - const tempDir = join(tmpdir(), 'aws-toolkit-vscode') - if (!nodefs.existsSync(tempDir)) { - nodefs.mkdirSync(tempDir, { recursive: true }) - } - - const certPath = join(tempDir, 'vscode-ca-certs.pem') - const certContent = allCerts.join('\n') - - nodefs.writeFileSync(certPath, certContent) - result.certificatePath = certPath - logger.info(`Created certificate file at: ${certPath}`) - } - } catch (err) { - logger.error(`Failed to extract certificates: ${err}`) - } - return result -} - export function createServerOptions({ encryptionKey, executable, serverModule, execArgv, warnThresholds, - env, }: { encryptionKey: Buffer executable: string[] serverModule: string execArgv: string[] warnThresholds?: { cpu?: number; memory?: number } - env?: Record }) { return async () => { const bin = executable[0] @@ -154,42 +108,47 @@ export function createServerOptions({ args.unshift('--inspect=6080') } - // Merge environment variables - const processEnv = { ...process.env } - if (env) { - Object.assign(processEnv, env) - } - - // Get settings from VS Code - const settings = await getVSCodeSettings() - const logger = getLogger('amazonqLsp') - - // Add proxy settings to the Node.js process - if (settings.proxyUrl) { - processEnv.HTTPS_PROXY = settings.proxyUrl - } - - // Add certificate path if available - if (settings.certificatePath) { - processEnv.NODE_EXTRA_CA_CERTS = settings.certificatePath - logger.info(`Using certificate file: ${settings.certificatePath}`) - } - - // Get SSL verification settings - const httpConfig = vscode.workspace.getConfiguration('http') - const strictSSL = httpConfig.get('proxyStrictSSL', true) + // Set USE_IAM_AUTH environment variable for SageMaker environments based on cookie detection + // This tells the language server to use IAM authentication mode instead of SSO mode + const env = { ...process.env } + if (isSageMaker()) { + try { + // The command `sagemaker.parseCookies` is registered in VS Code SageMaker environment + const result = (await vscode.commands.executeCommand('sagemaker.parseCookies')) as SagemakerCookie + if (result.authMode !== 'Sso') { + env.USE_IAM_AUTH = 'true' + getLogger().info( + `[SageMaker Debug] Setting USE_IAM_AUTH=true for language server process (authMode: ${result.authMode})` + ) + } else { + getLogger().info(`[SageMaker Debug] Using SSO auth mode, not setting USE_IAM_AUTH`) + } + } catch (err) { + if (isRemoteWorkspace() && env.SERVICE_NAME !== 'SageMakerUnifiedStudio') { + getLogger().warn( + `[SageMaker Debug] Failed to parse SageMaker cookies in remote space, not SMUS env, not defaulting to IAM auth: ${err}` + ) + } else { + getLogger().warn( + `[SageMaker Debug] Failed to parse SageMaker cookies, defaulting to IAM auth: ${err}` + ) + env.USE_IAM_AUTH = 'true' + } + } - // Handle SSL certificate verification - if (!strictSSL) { - processEnv.NODE_TLS_REJECT_UNAUTHORIZED = '0' - logger.info('SSL verification disabled via VS Code settings') + // Log important environment variables for debugging + getLogger().info(`[SageMaker Debug] Environment variables for language server:`) + getLogger().info(`[SageMaker Debug] USE_IAM_AUTH: ${env.USE_IAM_AUTH}`) + getLogger().info( + `[SageMaker Debug] AWS_CONTAINER_CREDENTIALS_RELATIVE_URI: ${env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI}` + ) + getLogger().info(`[SageMaker Debug] AWS_DEFAULT_REGION: ${env.AWS_DEFAULT_REGION}`) + getLogger().info(`[SageMaker Debug] AWS_REGION: ${env.AWS_REGION}`) } const lspProcess = new ChildProcess(bin, args, { warnThresholds, - spawnOptions: { - env: processEnv, - }, + spawnOptions: { env }, }) // this is a long running process, awaiting it will never resolve diff --git a/packages/core/src/shared/lsp/utils/setupStage.ts b/packages/core/src/shared/lsp/utils/setupStage.ts index cd9dcfa319a..8f43ba16f3f 100644 --- a/packages/core/src/shared/lsp/utils/setupStage.ts +++ b/packages/core/src/shared/lsp/utils/setupStage.ts @@ -5,6 +5,7 @@ import { LanguageServerSetup, LanguageServerSetupStage, telemetry } from '../../telemetry/telemetry' import { tryFunctions } from '../../utilities/tsUtils' +import { AuthUtil } from '../../../codewhisperer/util/authUtil' /** * Runs the designated stage within a telemetry span and optionally uses the getMetadata extractor to record metadata from the result of the stage. @@ -20,6 +21,7 @@ export async function lspSetupStage( ) { return await telemetry.languageServer_setup.run(async (span) => { span.record({ languageServerSetupStage: stageName }) + span.record({ credentialStartUrl: AuthUtil.instance.startUrl ?? 'Undefined' }) const result = await runStage() if (getMetadata) { span.record(getMetadata(result)) diff --git a/packages/core/src/shared/remoteSession.ts b/packages/core/src/shared/remoteSession.ts index 282b629df51..b45bdb3ca9c 100644 --- a/packages/core/src/shared/remoteSession.ts +++ b/packages/core/src/shared/remoteSession.ts @@ -25,6 +25,11 @@ import { EvaluationResult } from '@aws-sdk/client-iam' const policyAttachDelay = 5000 +export enum RemoteSessionError { + ExtensionVersionTooLow = 'ExtensionVersionTooLow', + MissingExtension = 'MissingExtension', +} + export interface MissingTool { readonly name: 'code' | 'ssm' | 'ssh' readonly reason?: string @@ -114,13 +119,13 @@ export async function ensureRemoteSshInstalled(): Promise { if (isExtensionInstalled(VSCODE_EXTENSION_ID.remotessh)) { throw new ToolkitError('Remote SSH extension version is too low', { cancelled: true, - code: 'ExtensionVersionTooLow', + code: RemoteSessionError.ExtensionVersionTooLow, details: { expected: vscodeExtensionMinVersion.remotessh }, }) } else { throw new ToolkitError('Remote SSH extension not installed', { cancelled: true, - code: 'MissingExtension', + code: RemoteSessionError.MissingExtension, }) } } diff --git a/packages/core/src/shared/settings-toolkit.gen.ts b/packages/core/src/shared/settings-toolkit.gen.ts index 10020cf51f9..55bc77f9828 100644 --- a/packages/core/src/shared/settings-toolkit.gen.ts +++ b/packages/core/src/shared/settings-toolkit.gen.ts @@ -44,14 +44,16 @@ export const toolkitSettings = { "jsonResourceModification": {}, "amazonqLSP": {}, "amazonqLSPInline": {}, + "amazonqChatLSP": {}, "amazonqLSPInlineChat": {}, - "amazonqChatLSP": {} + "amazonqLSPNEP": {} }, "aws.resources.enabledResources": {}, "aws.lambda.recentlyUploaded": {}, "aws.accessAnalyzer.policyChecks.checkNoNewAccessFilePath": {}, "aws.accessAnalyzer.policyChecks.checkAccessNotGrantedFilePath": {}, - "aws.accessAnalyzer.policyChecks.cloudFormationParameterFilePath": {} + "aws.accessAnalyzer.policyChecks.cloudFormationParameterFilePath": {}, + "aws.sagemaker.studio.spaces.enableIdentityFiltering": {} } export default toolkitSettings diff --git a/packages/core/src/shared/sshConfig.ts b/packages/core/src/shared/sshConfig.ts index 2c60b423ab3..bba23b9a4d8 100644 --- a/packages/core/src/shared/sshConfig.ts +++ b/packages/core/src/shared/sshConfig.ts @@ -40,6 +40,9 @@ export class SshConfig { } protected async getProxyCommand(command: string): Promise> { + // Use %n for SageMaker to preserve original hostname case (avoids SSH canonicalization lowercasing and DNS lookup) + const hostnameToken = this.scriptPrefix === 'sagemaker_connect' ? '%n' : '%h' + if (this.isWin()) { // Some older versions of OpenSSH (7.8 and below) have a bug where attempting to use powershell.exe directly will fail without an absolute path const proc = new ChildProcess('powershell.exe', ['-Command', '(get-command powershell.exe).Path']) @@ -47,9 +50,9 @@ export class SshConfig { if (r.exitCode !== 0) { return Result.err(new ToolkitError('Failed to get absolute path for powershell', { cause: r.error })) } - return Result.ok(`"${r.stdout}" -ExecutionPolicy RemoteSigned -File "${command}" %h`) + return Result.ok(`"${r.stdout}" -ExecutionPolicy RemoteSigned -File "${command}" ${hostnameToken}`) } else { - return Result.ok(`'${command}' '%h'`) + return Result.ok(`'${command}' '${hostnameToken}'`) } } @@ -192,8 +195,21 @@ Host ${this.configHostName} ` } + private getSageMakerSSHConfig(proxyCommand: string): string { + return ` +# Created by AWS Toolkit for VSCode. https://github.com/aws/aws-toolkit-vscode +Host ${this.configHostName} + ForwardAgent yes + AddKeysToAgent yes + StrictHostKeyChecking accept-new + ProxyCommand ${proxyCommand} + ` + } + protected createSSHConfigSection(proxyCommand: string): string { - if (this.keyPath) { + if (this.scriptPrefix === 'sagemaker_connect') { + return `${this.getSageMakerSSHConfig(proxyCommand)}User '%r'\n` + } else if (this.keyPath) { return `${this.getBaseSSHConfig(proxyCommand)}IdentityFile '${this.keyPath}'\n User '%r'\n` } return this.getBaseSSHConfig(proxyCommand) diff --git a/packages/core/src/shared/telemetry/service-2.json b/packages/core/src/shared/telemetry/service-2.json index 9711b3473cc..a0ca9f7b14e 100644 --- a/packages/core/src/shared/telemetry/service-2.json +++ b/packages/core/src/shared/telemetry/service-2.json @@ -205,7 +205,8 @@ "AWSProduct", "AWSProductVersion", "ClientID", - "MetricData" + "MetricData", + "CredentialStartUrl" ], "members":{ "AWSProduct":{"shape":"AWSProduct"}, @@ -217,7 +218,8 @@ "ComputeEnv": {"shape":"ComputeEnv"}, "ParentProduct":{"shape":"Value"}, "ParentProductVersion":{"shape":"Value"}, - "MetricData":{"shape":"MetricData"} + "MetricData":{"shape":"MetricData"}, + "CredentialStartUrl": {"shape":"Value"} } }, "Sentiment":{ diff --git a/packages/core/src/shared/telemetry/telemetryClient.ts b/packages/core/src/shared/telemetry/telemetryClient.ts index 139b4b48814..97ec2508cfc 100644 --- a/packages/core/src/shared/telemetry/telemetryClient.ts +++ b/packages/core/src/shared/telemetry/telemetryClient.ts @@ -17,6 +17,7 @@ import globals from '../extensionGlobals' import { DevSettings } from '../settings' import { ClassToInterfaceType } from '../utilities/tsUtils' import { getComputeEnvType, getSessionId } from './util' +import { AuthUtil } from '../../codewhisperer/util/authUtil' export const accountMetadataKey = 'awsAccount' export const regionKey = 'awsRegion' @@ -112,6 +113,7 @@ export class DefaultTelemetryClient implements TelemetryClient { ParentProduct: vscode.env.appName, ParentProductVersion: vscode.version, MetricData: batch, + CredentialStartUrl: AuthUtil.instance.startUrl ?? 'Undefined', }) .promise() this.logger.info(`telemetry: sent batch (size=${batch.length})`) diff --git a/packages/core/src/shared/telemetry/util.ts b/packages/core/src/shared/telemetry/util.ts index 310c36b82d6..e6c7254e878 100644 --- a/packages/core/src/shared/telemetry/util.ts +++ b/packages/core/src/shared/telemetry/util.ts @@ -481,3 +481,20 @@ export function withTelemetryContext(opts: TelemetryContextArgs) { }) } } + +/** + * Used to identify the q client info and send the respective origin parameter from LSP to invoke Maestro service at CW API level + * + * Returns default value of vscode appName or AmazonQ-For-SMUS-CE in case of a sagemaker unified studio environment + * Returns default value of vscode appName + * OR AmazonQ-For-SMUS-CE in case of SMUS + * OR AmazonQ-For-SMAI-CE in case of SMAI + */ +export function getClientName(): string { + if (isSageMaker('SMUS')) { + return 'AmazonQ-For-SMUS-CE' + } else if (isSageMaker('SMAI')) { + return 'AmazonQ-For-SMAI-CE' + } + return env.appName +} diff --git a/packages/core/src/shared/telemetry/vscodeTelemetry.json b/packages/core/src/shared/telemetry/vscodeTelemetry.json index b28aeec4847..1128eef8ab6 100644 --- a/packages/core/src/shared/telemetry/vscodeTelemetry.json +++ b/packages/core/src/shared/telemetry/vscodeTelemetry.json @@ -241,6 +241,42 @@ } ], "metrics": [ + { + "name": "sagemaker_openRemoteConnection", + "description": "Perform a connection to a SageMaker Space", + "metadata": [ + { + "type": "result" + } + ] + }, + { + "name": "sagemaker_stopSpace", + "description": "Stop a SageMaker Space", + "metadata": [ + { + "type": "result" + } + ] + }, + { + "name": "sagemaker_filterSpaces", + "description": "Filter SageMaker Spaces", + "metadata": [ + { + "type": "result" + } + ] + }, + { + "name": "sagemaker_deeplinkConnect", + "description": "Connect to SageMake Space via a deeplink", + "metadata": [ + { + "type": "result" + } + ] + }, { "name": "amazonq_didSelectProfile", "description": "Emitted after the user's Q Profile has been set, whether the user was prompted with a dialog, or a profile was automatically assigned after signing in.", @@ -1110,6 +1146,117 @@ { "name": "docdb_addRegion", "description": "User clicked on add region command" + }, + { + "name": "appbuilder_lambda2sam", + "description": "User click Convert a lambda function to SAM project" + }, + { + "name": "lambda_remoteDebugStop", + "description": "user stop remote debugging", + "metadata": [ + { + "type": "sessionDuration", + "required": false + } + ] + }, + { + "name": "lambda_remoteDebugStart", + "description": "user start remote debugging", + "metadata": [ + { + "type": "runtimeString", + "required": false + }, + { + "type": "source", + "required": false + }, + { + "type": "action", + "required": false + } + ] + }, + { + "name": "lambda_remoteDebugPrecheck", + "description": "user click remote debug checkbox", + "metadata": [ + { + "type": "runtimeString", + "required": false + }, + { + "type": "source", + "required": false + }, + { + "type": "action", + "required": false + } + ] + }, + { + "name": "lambda_invokeRemote", + "description": "Called when invoking lambdas remotely", + "metadata": [ + { + "type": "result" + }, + { + "type": "runtime", + "required": false + }, + { + "type": "source", + "required": false + }, + { + "type": "runtimeString", + "required": false + }, + { + "type": "action", + "required": false + } + ] + }, + { + "name": "languageServer_setup", + "description": "Sets up a language server", + "unit": "Milliseconds", + "passive": true, + "metadata": [ + { + "type": "id", + "required": true + }, + { + "type": "languageServerSetupStage", + "required": true + }, + { + "type": "languageServerLocation", + "required": false + }, + { + "type": "languageServerVersion", + "required": false + }, + { + "type": "manifestLocation", + "required": false + }, + { + "type": "manifestSchemaVersion", + "required": false + }, + { + "type": "credentialStartUrl", + "required": false + } + ] } ] } diff --git a/packages/core/src/shared/utilities/diffUtils.ts b/packages/core/src/shared/utilities/diffUtils.ts index f6dcd9d3fe4..994f91a5434 100644 --- a/packages/core/src/shared/utilities/diffUtils.ts +++ b/packages/core/src/shared/utilities/diffUtils.ts @@ -11,6 +11,7 @@ import { amazonQDiffScheme } from '../constants' import { ContentProvider } from '../../amazonq/commons/controllers/contentController' import { disposeOnEditorClose } from './editorUtilities' import { getLogger } from '../logger/logger' +import jaroWinkler from 'jaro-winkler' /** * Get the patched code from a file and a patch. @@ -24,7 +25,7 @@ import { getLogger } from '../logger/logger' */ export async function getPatchedCode(filePath: string, patch: string, snippetMode = false) { const document = await vscode.workspace.openTextDocument(filePath) - const fileContent = document.getText() + const fileContent = document.getText().replaceAll('\r\n', '\n') // Usage with the existing getPatchedCode function: let updatedPatch = patch @@ -149,3 +150,40 @@ export function getDiffCharsAndLines( addedLines, } } + +/** + * Extracts modified lines by comparing added and removed lines. + * @param addedLines The array of added lines. + * @param removedLines The array of removed lines. + * @returns A Map where keys are removed lines and values are the corresponding modified (added) lines. + */ +export function getModifiedLinesFromCode(addedLines: string[], removedLines: string[]): Map { + const modifiedMap = new Map() + let addedIndex = 0 + + // For each removed line, find the most similar added line + for (const removedLine of removedLines) { + let bestMatchIndex = -1 + + for (let i = addedIndex; i < addedLines.length; i++) { + const addedLine = addedLines[i] + const score = jaroWinkler(removedLine, addedLine) + if (score > 0.5) { + bestMatchIndex = i + break + } + } + + if (bestMatchIndex !== -1) { + // Map the removed line to the most similar added line + modifiedMap.set(removedLine, addedLines[bestMatchIndex]) + // Move addedIndex to the next line after the match + addedIndex = bestMatchIndex + 1 + } else { + // No match found for this removed line, move on + continue + } + } + + return modifiedMap +} diff --git a/packages/core/src/shared/utilities/index.ts b/packages/core/src/shared/utilities/index.ts index ecf753090ca..a361834406c 100644 --- a/packages/core/src/shared/utilities/index.ts +++ b/packages/core/src/shared/utilities/index.ts @@ -7,3 +7,5 @@ export { isExtensionInstalled, isExtensionActive } from './vsCodeUtils' export { VSCODE_EXTENSION_ID } from '../extensions' export * from './functionUtils' export * as messageUtils from './messages' +export * as CommentUtils from './commentUtils' +export * from './editorUtilities' diff --git a/packages/core/src/shared/utilities/messages.ts b/packages/core/src/shared/utilities/messages.ts index 26fd745c8d6..b3cc178cabb 100644 --- a/packages/core/src/shared/utilities/messages.ts +++ b/packages/core/src/shared/utilities/messages.ts @@ -5,6 +5,7 @@ import * as vscode from 'vscode' import * as nls from 'vscode-nls' +import * as path from 'path' import * as localizedText from '../localizedText' import { getLogger } from '../../shared/logger/logger' import { ProgressEntry } from '../../shared/vscode/window' @@ -14,6 +15,8 @@ import { Timeout } from './timeoutUtils' import { addCodiconToString } from './textUtilities' import { getIcon, codicon } from '../icons' import globals from '../extensionGlobals' +import { ToolkitError } from '../../shared/errors' +import { fs } from '../../shared/fs/fs' import { openUrl } from './vsCodeUtils' import { AmazonQPromptSettings, ToolkitPromptSettings } from '../../shared/settings' import { telemetry, ToolkitShowNotification } from '../telemetry/telemetry' @@ -140,6 +143,41 @@ export async function showViewLogsMessage( }) } +/** + * Checks if a path exists and prompts user for overwrite confirmation if it does. + * @param path The file or directory path to check + * @param itemName The name of the item for display in the message + * @returns Promise - true if should proceed (path doesn't exist or user confirmed overwrite) + */ +export async function handleOverwriteConflict(location: vscode.Uri): Promise { + if (!(await fs.exists(location))) { + return true + } + + const choice = showConfirmationMessage({ + prompt: localize( + 'AWS.toolkit.confirmOverwrite', + '{0} already exists in the selected directory, overwrite?', + location.fsPath + ), + confirm: localize('AWS.generic.overwrite', 'Yes'), + cancel: localize('AWS.generic.cancel', 'No'), + type: 'warning', + }) + + if (!choice) { + throw new ToolkitError(`Folder already exists: ${path.basename(location.fsPath)}`) + } + + try { + await fs.delete(location, { recursive: true, force: true }) + } catch (error) { + throw ToolkitError.chain(error, `Failed to delete existing folder: ${path.basename(location.fsPath)}`) + } + + return true +} + /** * Shows a modal confirmation (warning) message with buttons to confirm or cancel. * diff --git a/packages/core/src/shared/utilities/pathFind.ts b/packages/core/src/shared/utilities/pathFind.ts index 04622733a66..a0eea9e38ae 100644 --- a/packages/core/src/shared/utilities/pathFind.ts +++ b/packages/core/src/shared/utilities/pathFind.ts @@ -18,6 +18,7 @@ let vscPath: string let sshPath: string let gitPath: string let bashPath: string +let javaPath: string const pathMap = new Map() /** @@ -145,6 +146,44 @@ export async function findSshPath(useCache: boolean = true): Promise { + if (javaPath !== undefined) { + return javaPath + } + + const paths = [ + 'java', // Try $PATH first + '/usr/bin/java', + '/usr/local/bin/java', + '/opt/java/bin/java', + // Common Oracle JDK locations + '/usr/lib/jvm/default-java/bin/java', + '/usr/lib/jvm/java-11-openjdk/bin/java', + '/usr/lib/jvm/java-8-openjdk/bin/java', + // Windows locations + 'C:/Program Files/Java/jre1.8.0_301/bin/java.exe', + 'C:/Program Files/Java/jdk1.8.0_301/bin/java.exe', + 'C:/Program Files/OpenJDK/openjdk-11.0.2/bin/java.exe', + 'C:/Program Files (x86)/Java/jre1.8.0_301/bin/java.exe', + 'C:/Program Files (x86)/Java/jdk1.8.0_301/bin/java.exe', + // macOS locations + '/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java', + '/usr/libexec/java_home', + ] + for (const p of paths) { + if (!p || ('java' !== p && !(await fs.exists(p)))) { + continue + } + if (await tryRun(p, ['-version'])) { + javaPath = p + return p + } + } +} + /** * Gets the configured `git` path, or falls back to "ssh" (not absolute), * or tries common locations, or returns undefined. diff --git a/packages/core/src/shared/utilities/proxyUtil.ts b/packages/core/src/shared/utilities/proxyUtil.ts index 5c37c5e3e46..06150b9fc01 100644 --- a/packages/core/src/shared/utilities/proxyUtil.ts +++ b/packages/core/src/shared/utilities/proxyUtil.ts @@ -8,6 +8,8 @@ import { getLogger } from '../logger/logger' interface ProxyConfig { proxyUrl: string | undefined + noProxy: string | undefined + proxyStrictSSL: boolean | true certificateAuthority: string | undefined } @@ -23,11 +25,11 @@ export class ProxyUtil { * See documentation here for setting the environement variables which are inherited by Flare LS process: * https://github.com/aws/language-server-runtimes/blob/main/runtimes/docs/proxy.md */ - public static configureProxyForLanguageServer(): void { + public static async configureProxyForLanguageServer(): Promise { try { const proxyConfig = this.getProxyConfiguration() - this.setProxyEnvironmentVariables(proxyConfig) + await this.setProxyEnvironmentVariables(proxyConfig) } catch (err) { this.logger.error(`Failed to configure proxy: ${err}`) } @@ -41,6 +43,13 @@ export class ProxyUtil { const proxyUrl = httpConfig.get('proxy') this.logger.debug(`Proxy URL Setting in VSCode Settings: ${proxyUrl}`) + const noProxy = httpConfig.get('noProxy') + if (noProxy) { + this.logger.info(`Using noProxy from VS Code settings: ${noProxy}`) + } + + const proxyStrictSSL = httpConfig.get('proxyStrictSSL', true) + const amazonQConfig = vscode.workspace.getConfiguration('amazonQ') const proxySettings = amazonQConfig.get<{ certificateAuthority?: string @@ -48,6 +57,8 @@ export class ProxyUtil { return { proxyUrl, + noProxy, + proxyStrictSSL, certificateAuthority: proxySettings.certificateAuthority, } } @@ -55,7 +66,10 @@ export class ProxyUtil { /** * Sets environment variables based on proxy configuration */ - private static setProxyEnvironmentVariables(config: ProxyConfig): void { + private static async setProxyEnvironmentVariables(config: ProxyConfig): Promise { + // Always enable experimental proxy support for better handling of both explicit and transparent proxies + process.env.EXPERIMENTAL_HTTP_PROXY_SUPPORT = 'true' + const proxyUrl = config.proxyUrl // Set proxy environment variables if (proxyUrl) { @@ -64,7 +78,22 @@ export class ProxyUtil { this.logger.debug(`Set proxy environment variables: ${proxyUrl}`) } - // Set certificate bundle environment variables if configured + // set NO_PROXY vals + const noProxy = config.noProxy + if (noProxy) { + process.env.NO_PROXY = noProxy + this.logger.debug(`Set NO_PROXY environment variable: ${noProxy}`) + } + + const strictSSL = config.proxyStrictSSL + // Handle SSL certificate verification + if (!strictSSL) { + process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0' + this.logger.info('SSL verification disabled via VS Code settings') + return // No need to set CA certs when SSL verification is disabled + } + + // Set certificate bundle environment variables if user configured if (config.certificateAuthority) { process.env.NODE_EXTRA_CA_CERTS = config.certificateAuthority process.env.AWS_CA_BUNDLE = config.certificateAuthority diff --git a/packages/core/src/shared/utilities/resourceCache.ts b/packages/core/src/shared/utilities/resourceCache.ts index c0beee61cd6..a399dea66ca 100644 --- a/packages/core/src/shared/utilities/resourceCache.ts +++ b/packages/core/src/shared/utilities/resourceCache.ts @@ -60,6 +60,21 @@ export abstract class CachedResource { abstract resourceProvider(): Promise async getResource(): Promise { + // Check cache without locking first + const quickCheck = this.readCacheOrDefault() + if (quickCheck.resource.result && !quickCheck.resource.locked) { + const duration = now() - quickCheck.resource.timestamp + if (duration < this.expirationInMilli) { + logger.debug( + `cache hit (fast path), duration(%sms) is less than expiration(%sms), returning cached value: %s`, + duration, + this.expirationInMilli, + this.key + ) + return quickCheck.resource.result + } + } + const cachedValue = await this.tryLoadResourceAndLock() const resource = cachedValue?.resource diff --git a/packages/core/src/shared/utilities/workspaceUtils.ts b/packages/core/src/shared/utilities/workspaceUtils.ts index 12cce75b3ff..122f2a185f4 100644 --- a/packages/core/src/shared/utilities/workspaceUtils.ts +++ b/packages/core/src/shared/utilities/workspaceUtils.ts @@ -19,7 +19,6 @@ import * as parser from '@gerhobbelt/gitignore-parser' import fs from '../fs/fs' import { ChildProcess } from './processUtils' import { isWin } from '../vscode/env' -import { maxRepoSizeBytes } from '../../amazonqFeatureDev/constants' type GitIgnoreRelativeAcceptor = { folderPath: string @@ -378,6 +377,8 @@ export async function collectFiles( const includeContent = options?.includeContent ?? true const maxFileSizeBytes = options?.maxFileSizeBytes ?? 1024 * 1024 * 10 + // Max allowed size for file collection + const maxRepoSizeBytes = 200 * 1024 * 1024 const excludeByGitIgnore = options?.excludeByGitIgnore ?? true const failOnLimit = options?.failOnLimit ?? true const inputExcludePatterns = options?.excludePatterns ?? defaultExcludePatterns diff --git a/packages/core/src/shared/vscode/env.ts b/packages/core/src/shared/vscode/env.ts index 02d46ae6695..abd9c58ae2d 100644 --- a/packages/core/src/shared/vscode/env.ts +++ b/packages/core/src/shared/vscode/env.ts @@ -125,13 +125,56 @@ export function isRemoteWorkspace(): boolean { } /** - * There is Amazon Linux 2. + * Checks if the current environment has SageMaker-specific environment variables + * @returns true if SageMaker environment variables are detected + */ +export function hasSageMakerEnvVars(): boolean { + // Check both old and new environment variable names + // SageMaker is renaming their environment variables in their Docker images + return ( + // Original environment variables + process.env.SAGEMAKER_APP_TYPE !== undefined || + process.env.SAGEMAKER_INTERNAL_IMAGE_URI !== undefined || + process.env.STUDIO_LOGGING_DIR?.includes('/var/log/studio') === true || + // New environment variables (update these with the actual new names) + process.env.SM_APP_TYPE !== undefined || + process.env.SM_INTERNAL_IMAGE_URI !== undefined || + process.env.SERVICE_NAME === 'SageMakerUnifiedStudio' + ) +} + +/** + * Checks if the current environment is running on Amazon Linux 2. * - * Use {@link isCloudDesktop()} to know if we are specifically using internal Amazon Linux 2. + * This function attempts to detect if we're running in a container on an AL2 host + * by checking both the OS release and container-specific indicators. * * Example: `5.10.220-188.869.amzn2int.x86_64` or `5.10.236-227.928.amzn2.x86_64` (Cloud Dev Machine) */ export function isAmazonLinux2() { + // First check if we're in a SageMaker environment, which should not be treated as AL2 + // even if the underlying host is AL2 + if (hasSageMakerEnvVars()) { + return false + } + + // Check if we're in a container environment that's not AL2 + if (process.env.container === 'docker' || process.env.DOCKER_HOST || process.env.DOCKER_BUILDKIT) { + // Additional check for container OS - if we can determine it's not AL2 + try { + const fs = require('fs') + if (fs.existsSync('/etc/os-release')) { + const osRelease = fs.readFileSync('/etc/os-release', 'utf8') + if (!osRelease.includes('Amazon Linux 2') && !osRelease.includes('amzn2')) { + return false + } + } + } catch (e) { + // If we can't read the file, fall back to the os.release() check + } + } + + // Standard check for AL2 in the OS release string return (os.release().includes('.amzn2int.') || os.release().includes('.amzn2.')) && process.platform === 'linux' } @@ -264,6 +307,15 @@ export async function getMachineId(): Promise { // TODO: use `vscode.env.machineId` instead? return 'browser' } + // Eclipse Che-based envs (backing compute rotates, not classified as a web instance) + // TODO: use `vscode.env.machineId` instead? + if (process.env.CHE_WORKSPACE_ID) { + return process.env.CHE_WORKSPACE_ID + } + // RedHat Dev Workspaces (run some VSC web variant) + if (process.env.DEVWORKSPACE_ID) { + return process.env.DEVWORKSPACE_ID + } const proc = new ChildProcess('hostname', [], { collect: true, logging: 'no' }) // TODO: check exit code. return (await proc.run()).stdout.trim() ?? 'unknown-host' diff --git a/packages/core/src/shared/vscode/setContext.ts b/packages/core/src/shared/vscode/setContext.ts index b630a708d15..7cfaf4092f8 100644 --- a/packages/core/src/shared/vscode/setContext.ts +++ b/packages/core/src/shared/vscode/setContext.ts @@ -29,6 +29,7 @@ export type contextKey = | 'aws.toolkit.amazonqInstall.dismissed' | 'aws.stepFunctions.isWorkflowStudioFocused' | 'aws.toolkit.notifications.show' + | 'aws.amazonq.editSuggestionActive' // Deprecated/legacy names. New keys should start with "aws.". | 'codewhisperer.activeLine' | 'gumby.isPlanAvailable' @@ -39,6 +40,7 @@ export type contextKey = | 'gumby.wasQCodeTransformationUsed' | 'amazonq.inline.codelensShortcutEnabled' | 'aws.toolkit.lambda.walkthroughSelected' + | 'aws.amazonq.amazonqChatLSP.isFocus' const contextMap: Partial> = {} diff --git a/packages/core/src/shared/vscode/uriHandler.ts b/packages/core/src/shared/vscode/uriHandler.ts index 24be2b26321..c8beda72fc4 100644 --- a/packages/core/src/shared/vscode/uriHandler.ts +++ b/packages/core/src/shared/vscode/uriHandler.ts @@ -46,7 +46,8 @@ export class UriHandler implements vscode.UriHandler { const { handler, parser } = this.handlers.get(uri.path)! let parsedQuery: Parameters[0] - const url = new URL(uri.toString(true)) + // Ensure '+' is treated as a literal plus sign, not a space, by encoding it as '%2B' + const url = new URL(uri.toString(true).replace(/\+/g, '%2B')) const params = new SearchParams(url.searchParams) try { diff --git a/packages/core/src/stepFunctions/activation.ts b/packages/core/src/stepFunctions/activation.ts index 4898fc36b54..ab37cb7a09a 100644 --- a/packages/core/src/stepFunctions/activation.ts +++ b/packages/core/src/stepFunctions/activation.ts @@ -96,7 +96,7 @@ async function registerStepFunctionCommands( }), Commands.register('aws.stepfunctions.publishStateMachine', async (node?: any) => { const region: string | undefined = node?.regionCode - await publishStateMachine(awsContext, outputChannel, region) + await publishStateMachine({ awsContext: awsContext, outputChannel: outputChannel, region: region }) }) ) } diff --git a/packages/core/src/stepFunctions/commands/downloadStateMachineDefinition.ts b/packages/core/src/stepFunctions/commands/downloadStateMachineDefinition.ts index f26fc8a793b..e89dad1ffcd 100644 --- a/packages/core/src/stepFunctions/commands/downloadStateMachineDefinition.ts +++ b/packages/core/src/stepFunctions/commands/downloadStateMachineDefinition.ts @@ -7,10 +7,10 @@ import * as nls from 'vscode-nls' import * as os from 'os' const localize = nls.loadMessageBundle() -import { StepFunctions } from 'aws-sdk' +import * as StepFunctions from '@aws-sdk/client-sfn' import * as path from 'path' import * as vscode from 'vscode' -import { DefaultStepFunctionsClient, StepFunctionsClient } from '../../shared/clients/stepFunctionsClient' +import { StepFunctionsClient } from '../../shared/clients/stepFunctions' import { getLogger, Logger } from '../../shared/logger/logger' import { Result } from '../../shared/telemetry/telemetry' @@ -28,10 +28,11 @@ export async function downloadStateMachineDefinition(params: { let downloadResult: Result = 'Succeeded' const stateMachineName = params.stateMachineNode.details.name try { - const client: StepFunctionsClient = new DefaultStepFunctionsClient(params.stateMachineNode.regionCode) - const stateMachineDetails: StepFunctions.DescribeStateMachineOutput = await client.getStateMachineDetails( - params.stateMachineNode.details.stateMachineArn - ) + const client: StepFunctionsClient = new StepFunctionsClient(params.stateMachineNode.regionCode) + const stateMachineDetails: StepFunctions.DescribeStateMachineCommandOutput = + await client.getStateMachineDetails({ + stateMachineArn: params.stateMachineNode.details.stateMachineArn, + }) if (params.isPreviewAndRender) { const doc = await vscode.workspace.openTextDocument({ @@ -53,7 +54,7 @@ export async function downloadStateMachineDefinition(params: { if (fileInfo) { const filePath = fileInfo.fsPath - await fs.writeFile(filePath, stateMachineDetails.definition, 'utf8') + await fs.writeFile(filePath, stateMachineDetails.definition || '', 'utf8') const openPath = vscode.Uri.file(filePath) const doc = await vscode.workspace.openTextDocument(openPath) await vscode.window.showTextDocument(doc) diff --git a/packages/core/src/stepFunctions/commands/publishStateMachine.ts b/packages/core/src/stepFunctions/commands/publishStateMachine.ts index e07b21b86f2..799d5b2a724 100644 --- a/packages/core/src/stepFunctions/commands/publishStateMachine.ts +++ b/packages/core/src/stepFunctions/commands/publishStateMachine.ts @@ -7,7 +7,7 @@ import { load } from 'js-yaml' import * as vscode from 'vscode' import * as nls from 'vscode-nls' import { AwsContext } from '../../shared/awsContext' -import { DefaultStepFunctionsClient, StepFunctionsClient } from '../../shared/clients/stepFunctionsClient' +import { StepFunctionsClient } from '../../shared/clients/stepFunctions' import { getLogger, Logger } from '../../shared/logger/logger' import { showViewLogsMessage } from '../../shared/utilities/messages' import { VALID_SFN_PUBLISH_FORMATS, YAML_FORMATS } from '../constants/aslFormats' @@ -15,14 +15,21 @@ import { refreshStepFunctionsTree } from '../explorer/stepFunctionsNodes' import { PublishStateMachineWizard, PublishStateMachineWizardState } from '../wizards/publishStateMachineWizard' const localize = nls.loadMessageBundle() -export async function publishStateMachine( - awsContext: AwsContext, - outputChannel: vscode.OutputChannel, +interface publishStateMachineParams { + awsContext: AwsContext + outputChannel: vscode.OutputChannel region?: string -) { + text?: vscode.TextDocument +} +export async function publishStateMachine(params: publishStateMachineParams) { const logger: Logger = getLogger() + let textDocument: vscode.TextDocument | undefined - const textDocument = vscode.window.activeTextEditor?.document + if (params.text) { + textDocument = params.text + } else { + textDocument = vscode.window.activeTextEditor?.document + } if (!textDocument) { logger.error('Could not get active text editor for state machine definition') @@ -53,17 +60,17 @@ export async function publishStateMachine( } try { - const response = await new PublishStateMachineWizard(region).run() + const response = await new PublishStateMachineWizard(params.region).run() if (!response) { return } - const client = new DefaultStepFunctionsClient(response.region) + const client = new StepFunctionsClient(response.region) if (response?.createResponse) { - await createStateMachine(response.createResponse, text, outputChannel, response.region, client) + await createStateMachine(response.createResponse, text, params.outputChannel, response.region, client) refreshStepFunctionsTree(response.region) } else if (response?.updateResponse) { - await updateStateMachine(response.updateResponse, text, outputChannel, response.region, client) + await updateStateMachine(response.updateResponse, text, params.outputChannel, response.region, client) } } catch (err) { logger.error(err as Error) @@ -102,7 +109,7 @@ async function createStateMachine( wizardResponse.name ) ) - outputChannel.appendLine(result.stateMachineArn) + outputChannel.appendLine(result.stateMachineArn || '') logger.info(`Created "${result.stateMachineArn}"`) } catch (err) { const msg = localize( diff --git a/packages/core/src/stepFunctions/explorer/stepFunctionsNodes.ts b/packages/core/src/stepFunctions/explorer/stepFunctionsNodes.ts index 2fcf62a9eb6..8b693d3bb9e 100644 --- a/packages/core/src/stepFunctions/explorer/stepFunctionsNodes.ts +++ b/packages/core/src/stepFunctions/explorer/stepFunctionsNodes.ts @@ -7,9 +7,9 @@ import * as os from 'os' import * as nls from 'vscode-nls' const localize = nls.loadMessageBundle() -import { StepFunctions } from 'aws-sdk' +import * as StepFunctions from '@aws-sdk/client-sfn' import * as vscode from 'vscode' -import { DefaultStepFunctionsClient } from '../../shared/clients/stepFunctionsClient' +import { StepFunctionsClient } from '../../shared/clients/stepFunctions' import { AWSResourceNode } from '../../shared/treeview/nodes/awsResourceNode' import { AWSTreeNodeBase } from '../../shared/treeview/nodes/awsTreeNodeBase' @@ -40,7 +40,7 @@ export class StepFunctionsNode extends AWSTreeNodeBase { public constructor( public override readonly regionCode: string, - private readonly client = new DefaultStepFunctionsClient(regionCode) + private readonly client = new StepFunctionsClient(regionCode) ) { super('Step Functions', vscode.TreeItemCollapsibleState.Collapsed) this.stateMachineNodes = new Map() @@ -101,7 +101,7 @@ export class StateMachineNode extends AWSTreeNodeBase implements AWSResourceNode } public get arn(): string { - return this.details.stateMachineArn + return this.details.stateMachineArn || '' } public get name(): string { diff --git a/packages/core/src/stepFunctions/utils.ts b/packages/core/src/stepFunctions/utils.ts index fedea23acc5..f578d6cda86 100644 --- a/packages/core/src/stepFunctions/utils.ts +++ b/packages/core/src/stepFunctions/utils.ts @@ -5,10 +5,10 @@ import * as nls from 'vscode-nls' const localize = nls.loadMessageBundle() -import { StepFunctions } from 'aws-sdk' +import * as StepFunctions from '@aws-sdk/client-sfn' import * as yaml from 'js-yaml' import * as vscode from 'vscode' -import { StepFunctionsClient } from '../shared/clients/stepFunctionsClient' +import { StepFunctionsClient } from '../shared/clients/stepFunctions' import { DiagnosticSeverity, DocumentLanguageSettings, diff --git a/packages/core/src/stepFunctions/vue/executeStateMachine/executeStateMachine.ts b/packages/core/src/stepFunctions/vue/executeStateMachine/executeStateMachine.ts index 985f2494e52..b4e47bc65f6 100644 --- a/packages/core/src/stepFunctions/vue/executeStateMachine/executeStateMachine.ts +++ b/packages/core/src/stepFunctions/vue/executeStateMachine/executeStateMachine.ts @@ -6,7 +6,7 @@ import * as nls from 'vscode-nls' const localize = nls.loadMessageBundle() -import { DefaultStepFunctionsClient } from '../../../shared/clients/stepFunctionsClient' +import { StepFunctionsClient } from '../../../shared/clients/stepFunctions' import { getLogger } from '../../../shared/logger/logger' import { Result } from '../../../shared/telemetry/telemetry' @@ -56,11 +56,14 @@ export class ExecuteStateMachineWebview extends VueWebview { this.channel.appendLine('') try { - const client = new DefaultStepFunctionsClient(this.stateMachine.region) - const startExecResponse = await client.executeStateMachine(this.stateMachine.arn, input) + const client = new StepFunctionsClient(this.stateMachine.region) + const startExecResponse = await client.executeStateMachine({ + stateMachineArn: this.stateMachine.arn, + input, + }) this.logger.info('started execution for Step Functions State Machine') this.channel.appendLine(localize('AWS.stepFunctions.executeStateMachine.info.started', 'Execution started')) - this.channel.appendLine(startExecResponse.executionArn) + this.channel.appendLine(startExecResponse.executionArn || '') } catch (e) { executeResult = 'Failed' const error = e as Error @@ -82,8 +85,8 @@ const Panel = VueWebview.compilePanel(ExecuteStateMachineWebview) export async function executeStateMachine(context: ExtContext, node: StateMachineNode): Promise { const wv = new Panel(context.extensionContext, context.outputChannel, { - arn: node.details.stateMachineArn, - name: node.details.name, + arn: node.details.stateMachineArn || '', + name: node.details.name || '', region: node.regionCode, }) diff --git a/packages/core/src/stepFunctions/wizards/publishStateMachineWizard.ts b/packages/core/src/stepFunctions/wizards/publishStateMachineWizard.ts index 866d7f5bb03..ed141ac1894 100644 --- a/packages/core/src/stepFunctions/wizards/publishStateMachineWizard.ts +++ b/packages/core/src/stepFunctions/wizards/publishStateMachineWizard.ts @@ -22,7 +22,7 @@ import { Wizard, WIZARD_BACK } from '../../shared/wizards/wizard' import { isStepFunctionsRole } from '../utils' import { createRolePrompter } from '../../shared/ui/common/roles' import { IamClient } from '../../shared/clients/iam' -import { DefaultStepFunctionsClient } from '../../shared/clients/stepFunctionsClient' +import { StepFunctionsClient } from '../../shared/clients/stepFunctions' export enum PublishStateMachineAction { QuickCreate, @@ -109,14 +109,14 @@ function createStepFunctionsRolePrompter(region: string) { } async function* listStateMachines(region: string) { - const client = new DefaultStepFunctionsClient(region) + const client = new StepFunctionsClient(region) for await (const machine of client.listStateMachines()) { yield [ { - label: machine.name, - data: machine.stateMachineArn, - description: machine.stateMachineArn, + label: machine.name || '', + data: machine.stateMachineArn || '', + description: machine.stateMachineArn || '', }, ] } diff --git a/packages/core/src/stepFunctions/workflowStudio/handleMessage.ts b/packages/core/src/stepFunctions/workflowStudio/handleMessage.ts index 13477db19e2..2b548ab957f 100644 --- a/packages/core/src/stepFunctions/workflowStudio/handleMessage.ts +++ b/packages/core/src/stepFunctions/workflowStudio/handleMessage.ts @@ -202,15 +202,22 @@ async function saveFileMessageHandler(request: SaveFileRequestMessage, context: } /** - * Handler for saving a file and starting the state machine deployment flow, while also switching to default editor. + * Handler for saving a file and starting the state machine deployment flow while staying in WFS view. * Triggered when the user triggers 'Save and Deploy' action in WFS * @param request The request message containing the file contents. * @param context The webview context containing the necessary information for saving the file. */ async function saveFileAndDeployMessageHandler(request: SaveFileRequestMessage, context: WebviewContext) { await saveFileMessageHandler(request, context) - await closeCustomEditorMessageHandler(context) - await publishStateMachine(globals.awsContext, globals.outputChannel) + await publishStateMachine({ + awsContext: globals.awsContext, + outputChannel: globals.outputChannel, + text: context.textDocument, + }) + + telemetry.ui_click.emit({ + elementId: 'stepfunctions_saveAndDeploy', + }) } /** diff --git a/packages/core/src/stepFunctions/workflowStudio/types.ts b/packages/core/src/stepFunctions/workflowStudio/types.ts index 989ef4517d6..5edf944eb2c 100644 --- a/packages/core/src/stepFunctions/workflowStudio/types.ts +++ b/packages/core/src/stepFunctions/workflowStudio/types.ts @@ -2,7 +2,8 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ -import { IAM, StepFunctions } from 'aws-sdk' +import { IAM } from 'aws-sdk' +import * as StepFunctions from '@aws-sdk/client-sfn' import * as vscode from 'vscode' export enum WorkflowMode { diff --git a/packages/core/src/stepFunctions/workflowStudio/workflowStudioApiHandler.ts b/packages/core/src/stepFunctions/workflowStudio/workflowStudioApiHandler.ts index 8b7244cd844..6c0fb850b9d 100644 --- a/packages/core/src/stepFunctions/workflowStudio/workflowStudioApiHandler.ts +++ b/packages/core/src/stepFunctions/workflowStudio/workflowStudioApiHandler.ts @@ -3,9 +3,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { StepFunctions } from 'aws-sdk' +import * as StepFunctions from '@aws-sdk/client-sfn' import { IamClient, IamRole } from '../../shared/clients/iam' -import { DefaultStepFunctionsClient } from '../../shared/clients/stepFunctionsClient' +import { StepFunctionsClient } from '../../shared/clients/stepFunctions' import { ApiAction, ApiCallRequestMessage, Command, MessageType, WebviewContext } from './types' import { telemetry } from '../../shared/telemetry/telemetry' import { ListRolesRequest } from '@aws-sdk/client-iam' @@ -15,7 +15,7 @@ export class WorkflowStudioApiHandler { region: string, private readonly context: WebviewContext, private readonly clients = { - sfn: new DefaultStepFunctionsClient(region), + sfn: new StepFunctionsClient(region), iam: new IamClient(region), } ) {} diff --git a/packages/core/src/stepFunctions/workflowStudio/workflowStudioEditor.ts b/packages/core/src/stepFunctions/workflowStudio/workflowStudioEditor.ts index da1a9f2e9bf..ba719856516 100644 --- a/packages/core/src/stepFunctions/workflowStudio/workflowStudioEditor.ts +++ b/packages/core/src/stepFunctions/workflowStudio/workflowStudioEditor.ts @@ -147,16 +147,18 @@ export class WorkflowStudioEditor { // The text document acts as our model, thus we send and event to the webview on file save to trigger update contextObject.disposables.push( - vscode.workspace.onDidSaveTextDocument(async () => { - await telemetry.stepfunctions_saveFile.run(async (span) => { - span.record({ - id: contextObject.fileId, - saveType: 'MANUAL_SAVE', - source: 'VSCODE', - isInvalidJson: isInvalidJsonFile(contextObject.textDocument), + vscode.workspace.onDidSaveTextDocument(async (savedDocument) => { + if (savedDocument.uri.toString() === this.documentUri.toString()) { + await telemetry.stepfunctions_saveFile.run(async (span) => { + span.record({ + id: contextObject.fileId, + saveType: 'MANUAL_SAVE', + source: 'VSCODE', + isInvalidJson: isInvalidJsonFile(contextObject.textDocument), + }) + await broadcastFileChange(contextObject, 'MANUAL_SAVE') }) - await broadcastFileChange(contextObject, 'MANUAL_SAVE') - }) + } }) ) diff --git a/packages/core/src/test/amazonq/common/diff.test.ts b/packages/core/src/test/amazonq/common/diff.test.ts index 0fc81403a59..a8f3bea8747 100644 --- a/packages/core/src/test/amazonq/common/diff.test.ts +++ b/packages/core/src/test/amazonq/common/diff.test.ts @@ -13,7 +13,6 @@ import * as path from 'path' import * as vscode from 'vscode' import sinon from 'sinon' import { FileSystem } from '../../../shared/fs/fs' -import { featureDevScheme } from '../../../amazonqFeatureDev' import { createAmazonQUri, getFileDiffUris, @@ -28,6 +27,7 @@ describe('diff', () => { const filePath = path.join('/', 'foo', 'fi') const rightPath = path.join('foo', 'fee') const tabId = '0' + const featureDevScheme = 'aws-featureDev' let sandbox: sinon.SinonSandbox let executeCommandSpy: sinon.SinonSpy diff --git a/packages/core/src/test/amazonq/session/sessionState.test.ts b/packages/core/src/test/amazonq/session/sessionState.test.ts deleted file mode 100644 index dcff3398cea..00000000000 --- a/packages/core/src/test/amazonq/session/sessionState.test.ts +++ /dev/null @@ -1,153 +0,0 @@ -/*! - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -import * as vscode from 'vscode' -import sinon from 'sinon' -import { CodeGenBase } from '../../../amazonq/session/sessionState' -import { RunCommandLogFileName } from '../../../amazonq/session/sessionState' -import assert from 'assert' -import * as workspaceUtils from '../../../shared/utilities/workspaceUtils' -import { TelemetryHelper } from '../../../amazonq/util/telemetryHelper' -import { assertLogsContain } from '../../globalSetup.test' - -describe('CodeGenBase generateCode log file handling', () => { - class TestCodeGen extends CodeGenBase { - public generatedFiles: any[] = [] - constructor(config: any, tabID: string) { - super(config, tabID) - } - protected handleProgress(_messenger: any): void { - // No-op for test. - } - protected getScheme(): string { - return 'file' - } - protected getTimeoutErrorCode(): string { - return 'test_timeout' - } - protected handleGenerationComplete(_messenger: any, newFileInfo: any[]): void { - this.generatedFiles = newFileInfo - } - protected handleError(_messenger: any, _codegenResult: any): Error { - throw new Error('handleError called') - } - } - - let fakeProxyClient: any - let testConfig: any - let fsMock: any - let messengerMock: any - let testAction: any - - beforeEach(async () => { - const ret = { - testworkspacefolder: { - uri: vscode.Uri.file('/path/to/testworkspacefolder'), - name: 'testworkspacefolder', - index: 0, - }, - } - sinon.stub(workspaceUtils, 'getWorkspaceFoldersByPrefixes').returns(ret) - - fakeProxyClient = { - getCodeGeneration: sinon.stub().resolves({ - codeGenerationStatus: { status: 'Complete' }, - codeGenerationRemainingIterationCount: 0, - codeGenerationTotalIterationCount: 1, - }), - exportResultArchive: sinon.stub(), - } - - testConfig = { - conversationId: 'conv_test', - uploadId: 'upload_test', - workspaceRoots: ['/path/to/testworkspacefolder'], - proxyClient: fakeProxyClient, - } - - fsMock = { - writeFile: sinon.stub().resolves(), - registerProvider: sinon.stub().resolves(), - } - - messengerMock = { sendAnswer: sinon.spy() } - - testAction = { - fs: fsMock, - messenger: messengerMock, - tokenSource: { - token: { - isCancellationRequested: false, - onCancellationRequested: () => {}, - }, - }, - } - }) - - afterEach(() => { - sinon.restore() - }) - - const runGenerateCode = async (codeGenerationId: string) => { - const testCodeGen = new TestCodeGen(testConfig, 'tab1') - return await testCodeGen.generateCode({ - messenger: messengerMock, - fs: fsMock, - codeGenerationId, - telemetry: new TelemetryHelper(), - workspaceFolders: [testConfig.workspaceRoots[0]], - action: testAction, - }) - } - - const createExpectedNewFile = (fileObj: { zipFilePath: string; fileContent: string }) => ({ - zipFilePath: fileObj.zipFilePath, - fileContent: fileObj.fileContent, - changeApplied: false, - rejected: false, - relativePath: fileObj.zipFilePath, - virtualMemoryUri: vscode.Uri.file(`/upload_test/${fileObj.zipFilePath}`), - workspaceFolder: { - index: 0, - name: 'testworkspacefolder', - uri: vscode.Uri.file('/path/to/testworkspacefolder'), - }, - }) - - it('adds the log content to logger if present and excludes it from new files', async () => { - const logFileInfo = { - zipFilePath: RunCommandLogFileName, - fileContent: 'Log content', - } - const otherFile = { zipFilePath: 'other.ts', fileContent: 'other content' } - fakeProxyClient.exportResultArchive.resolves({ - newFileContents: [logFileInfo, otherFile], - deletedFiles: [], - references: [], - }) - const result = await runGenerateCode('codegen1') - - assertLogsContain(`sessionState: Run Command logs, Log content`, false, 'info') - - const expectedNewFile = createExpectedNewFile(otherFile) - assert.deepStrictEqual(result.newFiles[0].fileContent, expectedNewFile.fileContent) - }) - - it('skips log file handling if log file is not present', async () => { - const file1 = { zipFilePath: 'file1.ts', fileContent: 'content1' } - fakeProxyClient.exportResultArchive.resolves({ - newFileContents: [file1], - deletedFiles: [], - references: [], - }) - - const result = await runGenerateCode('codegen2') - - assert.throws(() => assertLogsContain(`sessionState: Run Command logs, Log content`, false, 'info')) - - const expectedNewFile = createExpectedNewFile(file1) - assert.deepStrictEqual(result.newFiles[0].fileContent, expectedNewFile.fileContent) - }) -}) diff --git a/packages/core/src/test/amazonq/session/testSetup.ts b/packages/core/src/test/amazonq/session/testSetup.ts deleted file mode 100644 index 76f2c90f94f..00000000000 --- a/packages/core/src/test/amazonq/session/testSetup.ts +++ /dev/null @@ -1,74 +0,0 @@ -/*! - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -import sinon from 'sinon' -import { createBasicTestConfig, createMockSessionStateConfig, TestSessionMocks } from '../utils' -import { SessionStateConfig } from '../../../amazonq' - -export function createSessionTestSetup() { - const conversationId = 'conversation-id' - const uploadId = 'upload-id' - const tabId = 'tab-id' - const currentCodeGenerationId = '' - - return { - conversationId, - uploadId, - tabId, - currentCodeGenerationId, - } -} - -export async function createTestConfig( - testMocks: TestSessionMocks, - conversationId: string, - uploadId: string, - currentCodeGenerationId: string -) { - testMocks.getCodeGeneration = sinon.stub() - testMocks.exportResultArchive = sinon.stub() - testMocks.createUploadUrl = sinon.stub() - const basicConfig = await createBasicTestConfig(conversationId, uploadId, currentCodeGenerationId) - const testConfig = createMockSessionStateConfig(basicConfig, testMocks) - return testConfig -} - -export interface TestContext { - conversationId: string - uploadId: string - tabId: string - currentCodeGenerationId: string - testConfig: SessionStateConfig - testMocks: Record -} - -export function createTestContext(): TestContext { - const { conversationId, uploadId, tabId, currentCodeGenerationId } = createSessionTestSetup() - - return { - conversationId, - uploadId, - tabId, - currentCodeGenerationId, - testConfig: {} as SessionStateConfig, - testMocks: {}, - } -} - -export function setupTestHooks(context: TestContext) { - beforeEach(async () => { - context.testMocks = {} - context.testConfig = await createTestConfig( - context.testMocks, - context.conversationId, - context.uploadId, - context.currentCodeGenerationId - ) - }) - - afterEach(() => { - sinon.restore() - }) -} diff --git a/packages/core/src/test/amazonq/utils.ts b/packages/core/src/test/amazonq/utils.ts deleted file mode 100644 index ec2e7020e4e..00000000000 --- a/packages/core/src/test/amazonq/utils.ts +++ /dev/null @@ -1,182 +0,0 @@ -/*! - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -import * as vscode from 'vscode' -import * as sinon from 'sinon' -import { MessagePublisher } from '../../amazonq/messages/messagePublisher' -import { ChatControllerEventEmitters, FeatureDevController } from '../../amazonqFeatureDev/controllers/chat/controller' -import { FeatureDevChatSessionStorage } from '../../amazonqFeatureDev/storages/chatSession' -import { createTestWorkspaceFolder } from '../testUtil' -import { Session } from '../../amazonqFeatureDev/session/session' -import { SessionState, SessionStateAction, SessionStateConfig } from '../../amazonq/commons/types' -import { FeatureDevClient } from '../../amazonqFeatureDev/client/featureDev' -import { VirtualMemoryFile } from '../../shared/virtualMemoryFile' -import path from 'path' -import { featureDevChat } from '../../amazonqFeatureDev/constants' -import { Messenger } from '../../amazonq/commons/connector/baseMessenger' -import { AppToWebViewMessageDispatcher } from '../../amazonq/commons/connector/connectorMessages' -import { createSessionConfig } from '../../amazonq/commons/session/sessionConfigFactory' -import { VirtualFileSystem } from '../../shared' -import { TelemetryHelper } from '../../amazonq/util/telemetryHelper' -import { FeatureClient } from '../../amazonq/client/client' - -export function createMessenger(): Messenger { - return new Messenger( - new AppToWebViewMessageDispatcher(new MessagePublisher(sinon.createStubInstance(vscode.EventEmitter))), - featureDevChat - ) -} - -export function createMockChatEmitters(): ChatControllerEventEmitters { - return { - processHumanChatMessage: new vscode.EventEmitter(), - followUpClicked: new vscode.EventEmitter(), - openDiff: new vscode.EventEmitter(), - processChatItemVotedMessage: new vscode.EventEmitter(), - processChatItemFeedbackMessage: new vscode.EventEmitter(), - stopResponse: new vscode.EventEmitter(), - tabOpened: new vscode.EventEmitter(), - tabClosed: new vscode.EventEmitter(), - authClicked: new vscode.EventEmitter(), - processResponseBodyLinkClick: new vscode.EventEmitter(), - insertCodeAtPositionClicked: new vscode.EventEmitter(), - fileClicked: new vscode.EventEmitter(), - storeCodeResultMessageId: new vscode.EventEmitter(), - } -} - -export interface ControllerSetup { - emitters: ChatControllerEventEmitters - workspaceFolder: vscode.WorkspaceFolder - messenger: Messenger - sessionStorage: FeatureDevChatSessionStorage -} - -export async function createSession({ - messenger, - sessionState, - scheme, - conversationID = '0', - tabID = '0', - uploadID = '0', -}: { - messenger: Messenger - scheme: string - sessionState?: Omit - conversationID?: string - tabID?: string - uploadID?: string -}) { - const sessionConfig = await createSessionConfig(scheme) - - const client = sinon.createStubInstance(FeatureDevClient) - client.createConversation.resolves(conversationID) - const session = new Session(sessionConfig, messenger, tabID, sessionState, client) - - sinon.stub(session, 'conversationId').get(() => conversationID) - sinon.stub(session, 'uploadId').get(() => uploadID) - - return session -} - -export async function sessionRegisterProvider(session: Session, uri: vscode.Uri, fileContents: Uint8Array) { - session.config.fs.registerProvider(uri, new VirtualMemoryFile(fileContents)) -} - -export function generateVirtualMemoryUri(uploadID: string, filePath: string, scheme: string) { - const generationFilePath = path.join(uploadID, filePath) - const uri = vscode.Uri.from({ scheme, path: generationFilePath }) - return uri -} - -export async function sessionWriteFile(session: Session, uri: vscode.Uri, encodedContent: Uint8Array) { - await session.config.fs.writeFile(uri, encodedContent, { - create: true, - overwrite: true, - }) -} - -export async function createController(): Promise { - const messenger = createMessenger() - - // Create a new workspace root - const testWorkspaceFolder = await createTestWorkspaceFolder() - sinon.stub(vscode.workspace, 'workspaceFolders').value([testWorkspaceFolder]) - - const sessionStorage = new FeatureDevChatSessionStorage(messenger) - - const mockChatControllerEventEmitters = createMockChatEmitters() - - new FeatureDevController( - mockChatControllerEventEmitters, - messenger, - sessionStorage, - sinon.createStubInstance(vscode.EventEmitter).event - ) - - return { - emitters: mockChatControllerEventEmitters, - workspaceFolder: testWorkspaceFolder, - messenger, - sessionStorage, - } -} - -export function createMockSessionStateAction(msg?: string): SessionStateAction { - return { - task: 'test-task', - msg: msg ?? 'test-msg', - fs: new VirtualFileSystem(), - messenger: new Messenger( - new AppToWebViewMessageDispatcher(new MessagePublisher(new vscode.EventEmitter())), - featureDevChat - ), - telemetry: new TelemetryHelper(), - uploadHistory: {}, - } -} - -export interface TestSessionMocks { - getCodeGeneration?: sinon.SinonStub - exportResultArchive?: sinon.SinonStub - createUploadUrl?: sinon.SinonStub -} - -export interface SessionTestConfig { - conversationId: string - uploadId: string - workspaceFolder: vscode.WorkspaceFolder - currentCodeGenerationId?: string -} - -export function createMockSessionStateConfig(config: SessionTestConfig, mocks: TestSessionMocks): SessionStateConfig { - return { - workspaceRoots: ['fake-source'], - workspaceFolders: [config.workspaceFolder], - conversationId: config.conversationId, - proxyClient: { - createConversation: () => sinon.stub(), - createUploadUrl: () => mocks.createUploadUrl!(), - startCodeGeneration: () => sinon.stub(), - getCodeGeneration: () => mocks.getCodeGeneration!(), - exportResultArchive: () => mocks.exportResultArchive!(), - } as unknown as FeatureClient, - uploadId: config.uploadId, - currentCodeGenerationId: config.currentCodeGenerationId, - } -} - -export async function createBasicTestConfig( - conversationId: string = 'conversation-id', - uploadId: string = 'upload-id', - currentCodeGenerationId: string = '' -): Promise { - return { - conversationId, - uploadId, - workspaceFolder: await createTestWorkspaceFolder('fake-root'), - currentCodeGenerationId, - } -} diff --git a/packages/core/src/test/amazonqDoc/controller.test.ts b/packages/core/src/test/amazonqDoc/controller.test.ts deleted file mode 100644 index d69edc47fd7..00000000000 --- a/packages/core/src/test/amazonqDoc/controller.test.ts +++ /dev/null @@ -1,577 +0,0 @@ -/*! - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ -import * as vscode from 'vscode' -import sinon from 'sinon' -import { - assertTelemetry, - ControllerSetup, - createController, - createExpectedEvent, - createExpectedMetricData, - createSession, - EventMetrics, - FollowUpSequences, - generateVirtualMemoryUri, - updateFilePaths, -} from './utils' -import { CurrentWsFolders, MetricDataOperationName, MetricDataResult, NewFileInfo } from '../../amazonqDoc/types' -import { DocCodeGenState, docScheme, Session } from '../../amazonqDoc' -import { AuthUtil } from '../../codewhisperer' -import { - ApiClientError, - ApiServiceError, - CodeIterationLimitError, - FeatureDevClient, - getMetricResult, - MonthlyConversationLimitError, - PrepareRepoFailedError, - TabIdNotFoundError, - UploadCodeError, - UploadURLExpired, - UserMessageNotFoundError, - ZipFileError, -} from '../../amazonqFeatureDev' -import { i18n, ToolkitError, waitUntil } from '../../shared' -import { FollowUpTypes } from '../../amazonq/commons/types' -import { FileSystem } from '../../shared/fs/fs' -import { ReadmeBuilder } from './mockContent' -import * as path from 'path' -import { - ContentLengthError, - NoChangeRequiredException, - PromptRefusalException, - PromptTooVagueError, - PromptUnrelatedError, - ReadmeTooLargeError, - ReadmeUpdateTooLargeError, - WorkspaceEmptyError, -} from '../../amazonqDoc/errors' -import { LlmError } from '../../amazonq/errors' -describe('Controller - Doc Generation', () => { - const firstTabID = '123' - const firstConversationID = '123' - const firstUploadID = '123' - - const secondTabID = '456' - const secondConversationID = '456' - const secondUploadID = '456' - - let controllerSetup: ControllerSetup - let session: Session - let sendDocTelemetrySpy: sinon.SinonStub - let sendDocTelemetrySpyForSecondTab: sinon.SinonStub - let mockGetCodeGeneration: sinon.SinonStub - let getSessionStub: sinon.SinonStub - let modifiedReadme: string - const generatedReadme = ReadmeBuilder.createBaseReadme() - let sandbox: sinon.SinonSandbox - - const getFilePaths = (controllerSetup: ControllerSetup, uploadID: string): NewFileInfo[] => [ - { - zipFilePath: path.normalize('README.md'), - relativePath: path.normalize('README.md'), - fileContent: generatedReadme, - rejected: false, - virtualMemoryUri: generateVirtualMemoryUri(uploadID, path.normalize('README.md'), docScheme), - workspaceFolder: controllerSetup.workspaceFolder, - changeApplied: false, - }, - ] - - async function createCodeGenState( - sandbox: sinon.SinonSandbox, - tabID: string, - conversationID: string, - uploadID: string - ) { - mockGetCodeGeneration = sandbox.stub().resolves({ codeGenerationStatus: { status: 'Complete' } }) - - const workspaceFolders = [controllerSetup.workspaceFolder] as CurrentWsFolders - const testConfig = { - conversationId: conversationID, - proxyClient: { - createConversation: () => sandbox.stub(), - createUploadUrl: () => sandbox.stub(), - generatePlan: () => sandbox.stub(), - startCodeGeneration: () => sandbox.stub(), - getCodeGeneration: () => mockGetCodeGeneration(), - exportResultArchive: () => sandbox.stub(), - } as unknown as FeatureDevClient, - workspaceRoots: [''], - uploadId: uploadID, - workspaceFolders, - } - - const codeGenState = new DocCodeGenState( - testConfig, - getFilePaths(controllerSetup, uploadID), - [], - [], - tabID, - 0, - {} - ) - return createSession({ - messenger: controllerSetup.messenger, - sessionState: codeGenState, - conversationID, - tabID, - uploadID, - scheme: docScheme, - sandbox, - }) - } - async function fireFollowUps(followUpTypes: FollowUpTypes[], stub: sinon.SinonStub, tabID: string) { - for (const type of followUpTypes) { - controllerSetup.emitters.followUpClicked.fire({ - tabID, - followUp: { type }, - }) - await waitForStub(stub) - } - } - - async function waitForStub(stub: sinon.SinonStub) { - await waitUntil(() => Promise.resolve(stub.callCount > 0), {}) - } - - async function performAction( - action: 'generate' | 'update' | 'makeChanges' | 'accept' | 'edit', - getSessionStub: sinon.SinonStub, - message?: string, - tabID = firstTabID, - conversationID = firstConversationID - ) { - const sequences = { - generate: FollowUpSequences.generateReadme, - update: FollowUpSequences.updateReadme, - edit: FollowUpSequences.editReadme, - makeChanges: FollowUpSequences.makeChanges, - accept: FollowUpSequences.acceptContent, - } - - await fireFollowUps(sequences[action], getSessionStub, tabID) - - if ((action === 'makeChanges' || action === 'edit') && message) { - controllerSetup.emitters.processHumanChatMessage.fire({ - tabID, - conversationID, - message, - }) - await waitForStub(getSessionStub) - } - } - - async function setupTest(sandbox: sinon.SinonSandbox, isMultiTabs?: boolean, error?: ToolkitError) { - controllerSetup = await createController(sandbox) - session = await createCodeGenState(sandbox, firstTabID, firstConversationID, firstUploadID) - sendDocTelemetrySpy = sandbox.stub(session, 'sendDocTelemetryEvent').resolves() - sandbox.stub(session, 'preloader').resolves() - error ? sandbox.stub(session, 'send').throws(error) : sandbox.stub(session, 'send').resolves() - Object.defineProperty(session, '_conversationId', { - value: firstConversationID, - writable: true, - configurable: true, - }) - - sandbox.stub(AuthUtil.instance, 'getChatAuthState').resolves({ - codewhispererCore: 'connected', - codewhispererChat: 'connected', - amazonQ: 'connected', - }) - sandbox.stub(FileSystem.prototype, 'exists').resolves(false) - if (isMultiTabs) { - const secondSession = await createCodeGenState(sandbox, secondTabID, secondConversationID, secondUploadID) - sendDocTelemetrySpyForSecondTab = sandbox.stub(secondSession, 'sendDocTelemetryEvent').resolves() - sandbox.stub(secondSession, 'preloader').resolves() - sandbox.stub(secondSession, 'send').resolves() - Object.defineProperty(secondSession, '_conversationId', { - value: secondConversationID, - writable: true, - configurable: true, - }) - getSessionStub = sandbox - .stub(controllerSetup.sessionStorage, 'getSession') - .callsFake(async (tabId: string): Promise => { - if (tabId === firstTabID) { - return session - } - if (tabId === secondTabID) { - return secondSession - } - throw new Error(`Unknown tab ID: ${tabId}`) - }) - } else { - getSessionStub = sandbox.stub(controllerSetup.sessionStorage, 'getSession').resolves(session) - } - modifiedReadme = ReadmeBuilder.createReadmeWithRepoStructure() - sandbox - .stub(vscode.workspace, 'openTextDocument') - .callsFake(async (options?: string | vscode.Uri | { language?: string; content?: string }) => { - let documentPath = '' - if (typeof options === 'string') { - documentPath = options - } else if (options && 'path' in options) { - documentPath = options.path - } - - const isTempFile = documentPath === 'empty' - return { - getText: () => (isTempFile ? generatedReadme : modifiedReadme), - } as any - }) - } - - const retryTest = async ( - testMethod: () => Promise, - isMultiTabs?: boolean, - error?: ToolkitError, - maxRetries: number = 3, - delayMs: number = 1000 - ): Promise => { - let lastError: Error | undefined - - for (let attempt = 1; attempt <= maxRetries + 1; attempt++) { - sandbox = sinon.createSandbox() - sandbox.useFakeTimers({ - now: new Date('2025-03-20T12:00:00.000Z'), - toFake: ['Date'], - }) - try { - await setupTest(sandbox, isMultiTabs, error) - await testMethod() - sandbox.restore() - return - } catch (error) { - lastError = error as Error - sandbox.restore() - - if (attempt > maxRetries) { - console.error(`Test failed after ${maxRetries} retries:`, lastError) - throw lastError - } - - console.log(`Test attempt ${attempt} failed, retrying...`) - await new Promise((resolve) => setTimeout(resolve, delayMs)) - } - } - } - - after(() => { - if (sandbox) { - sandbox.restore() - } - }) - - it('should emit generation telemetry for initial README generation', async () => { - await retryTest(async () => { - await performAction('generate', getSessionStub) - - const expectedEvent = createExpectedEvent({ - type: 'generation', - ...EventMetrics.INITIAL_README, - interactionType: 'GENERATE_README', - conversationId: firstConversationID, - }) - - await assertTelemetry({ - spy: sendDocTelemetrySpy, - expectedEvent, - type: 'generation', - sandbox, - }) - }) - }) - it('should emit another generation telemetry for make changes operation after initial README generation', async () => { - await retryTest(async () => { - await performAction('generate', getSessionStub) - const firstExpectedEvent = createExpectedEvent({ - type: 'generation', - ...EventMetrics.INITIAL_README, - interactionType: 'GENERATE_README', - conversationId: firstConversationID, - }) - - await assertTelemetry({ - spy: sendDocTelemetrySpy, - expectedEvent: firstExpectedEvent, - type: 'generation', - sandbox, - }) - - await updateFilePaths(session, modifiedReadme, firstUploadID, docScheme, controllerSetup.workspaceFolder) - await performAction('makeChanges', getSessionStub, 'add repository structure section') - - const secondExpectedEvent = createExpectedEvent({ - type: 'generation', - ...EventMetrics.REPO_STRUCTURE, - interactionType: 'GENERATE_README', - conversationId: firstConversationID, - }) - - await assertTelemetry({ - spy: sendDocTelemetrySpy, - expectedEvent: secondExpectedEvent, - type: 'generation', - sandbox, - }) - }) - }) - - it('should emit acceptance telemetry for README generation', async () => { - await retryTest(async () => { - await performAction('generate', getSessionStub) - await new Promise((resolve) => setTimeout(resolve, 100)) - const expectedEvent = createExpectedEvent({ - type: 'acceptance', - ...EventMetrics.INITIAL_README, - interactionType: 'GENERATE_README', - conversationId: firstConversationID, - }) - - await performAction('accept', getSessionStub) - await assertTelemetry({ - spy: sendDocTelemetrySpy, - expectedEvent, - type: 'acceptance', - sandbox, - }) - }) - }) - it('should emit generation telemetry for README update', async () => { - await retryTest(async () => { - await performAction('update', getSessionStub) - - const expectedEvent = createExpectedEvent({ - type: 'generation', - ...EventMetrics.REPO_STRUCTURE, - interactionType: 'UPDATE_README', - conversationId: firstConversationID, - }) - - await assertTelemetry({ - spy: sendDocTelemetrySpy, - expectedEvent, - type: 'generation', - sandbox, - }) - }) - }) - it('should emit another generation telemetry for make changes operation after README update', async () => { - await retryTest(async () => { - await performAction('update', getSessionStub) - await new Promise((resolve) => setTimeout(resolve, 100)) - - modifiedReadme = ReadmeBuilder.createReadmeWithDataFlow() - await updateFilePaths(session, modifiedReadme, firstUploadID, docScheme, controllerSetup.workspaceFolder) - - await performAction('makeChanges', getSessionStub, 'add data flow section') - - const expectedEvent = createExpectedEvent({ - type: 'generation', - ...EventMetrics.DATA_FLOW, - interactionType: 'UPDATE_README', - conversationId: firstConversationID, - }) - - await assertTelemetry({ - spy: sendDocTelemetrySpy, - expectedEvent, - type: 'generation', - sandbox, - }) - }) - }) - - it('should emit acceptance telemetry for README update', async () => { - await retryTest(async () => { - await performAction('update', getSessionStub) - await new Promise((resolve) => setTimeout(resolve, 100)) - - const expectedEvent = createExpectedEvent({ - type: 'acceptance', - ...EventMetrics.REPO_STRUCTURE, - interactionType: 'UPDATE_README', - conversationId: firstConversationID, - }) - - await performAction('accept', getSessionStub) - await assertTelemetry({ - spy: sendDocTelemetrySpy, - expectedEvent, - type: 'acceptance', - sandbox, - }) - }) - }) - - it('should emit generation telemetry for README edit', async () => { - await retryTest(async () => { - await performAction('edit', getSessionStub, 'add repository structure section') - - const expectedEvent = createExpectedEvent({ - type: 'generation', - ...EventMetrics.REPO_STRUCTURE, - interactionType: 'EDIT_README', - conversationId: firstConversationID, - }) - - await assertTelemetry({ - spy: sendDocTelemetrySpy, - expectedEvent, - type: 'generation', - sandbox, - }) - }) - }) - it('should emit acceptance telemetry for README edit', async () => { - await retryTest(async () => { - await performAction('edit', getSessionStub, 'add repository structure section') - await new Promise((resolve) => setTimeout(resolve, 100)) - - const expectedEvent = createExpectedEvent({ - type: 'acceptance', - ...EventMetrics.REPO_STRUCTURE, - interactionType: 'EDIT_README', - conversationId: firstConversationID, - }) - - await performAction('accept', getSessionStub) - await assertTelemetry({ - spy: sendDocTelemetrySpy, - expectedEvent, - type: 'acceptance', - sandbox, - }) - }) - }) - it('should emit separate telemetry events when executing /doc in different tabs', async () => { - await retryTest(async () => { - const firstSession = await getSessionStub(firstTabID) - const secondSession = await getSessionStub(secondTabID) - await performAction('generate', firstSession) - await performAction('update', secondSession, undefined, secondTabID, secondConversationID) - - const expectedEvent = createExpectedEvent({ - type: 'generation', - ...EventMetrics.INITIAL_README, - interactionType: 'GENERATE_README', - conversationId: firstConversationID, - }) - - await assertTelemetry({ - spy: sendDocTelemetrySpy, - expectedEvent, - type: 'generation', - sandbox, - }) - - const expectedEventForSecondTab = createExpectedEvent({ - type: 'generation', - ...EventMetrics.REPO_STRUCTURE, - interactionType: 'UPDATE_README', - conversationId: secondConversationID, - }) - - await assertTelemetry({ - spy: sendDocTelemetrySpyForSecondTab, - expectedEvent: expectedEventForSecondTab, - type: 'generation', - sandbox, - }) - }, true) - }) - - describe('Doc Generation Error Handling', () => { - const errors = [ - { - name: 'MonthlyConversationLimitError', - error: new MonthlyConversationLimitError('Service Quota Exceeded'), - }, - { - name: 'DocGenerationGuardrailsException', - error: new ApiClientError( - i18n('AWS.amazonq.doc.error.docGen.default'), - 'GetTaskAssistCodeGeneration', - 'GuardrailsException', - 400 - ), - }, - { - name: 'DocGenerationEmptyPatchException', - error: new LlmError(i18n('AWS.amazonq.doc.error.docGen.default'), { - code: 'EmptyPatchException', - }), - }, - { - name: 'DocGenerationThrottlingException', - error: new ApiClientError( - i18n('AWS.amazonq.featureDev.error.throttling'), - 'GetTaskAssistCodeGeneration', - 'ThrottlingException', - 429 - ), - }, - { name: 'UploadCodeError', error: new UploadCodeError('403: Forbiden') }, - { name: 'UserMessageNotFoundError', error: new UserMessageNotFoundError() }, - { name: 'TabIdNotFoundError', error: new TabIdNotFoundError() }, - { name: 'PrepareRepoFailedError', error: new PrepareRepoFailedError() }, - { name: 'PromptRefusalException', error: new PromptRefusalException(0) }, - { name: 'ZipFileError', error: new ZipFileError() }, - { name: 'CodeIterationLimitError', error: new CodeIterationLimitError() }, - { name: 'UploadURLExpired', error: new UploadURLExpired() }, - { name: 'NoChangeRequiredException', error: new NoChangeRequiredException() }, - { name: 'ReadmeTooLargeError', error: new ReadmeTooLargeError() }, - { name: 'ReadmeUpdateTooLargeError', error: new ReadmeUpdateTooLargeError(0) }, - { name: 'ContentLengthError', error: new ContentLengthError() }, - { name: 'WorkspaceEmptyError', error: new WorkspaceEmptyError() }, - { name: 'PromptUnrelatedError', error: new PromptUnrelatedError(0) }, - { name: 'PromptTooVagueError', error: new PromptTooVagueError(0) }, - { name: 'PromptRefusalException', error: new PromptRefusalException(0) }, - { - name: 'default', - error: new ApiServiceError( - i18n('AWS.amazonq.doc.error.docGen.default'), - 'GetTaskAssistCodeGeneration', - 'UnknownException', - 500 - ), - }, - ] - for (const { name, error } of errors) { - it(`should emit failure operation telemetry when ${name} occurs`, async () => { - await retryTest( - async () => { - await performAction('generate', getSessionStub) - - const expectedSuccessMetric = createExpectedMetricData( - MetricDataOperationName.StartDocGeneration, - MetricDataResult.Success - ) - await assertTelemetry({ - spy: sendDocTelemetrySpy, - expectedEvent: expectedSuccessMetric, - type: 'metric', - sandbox, - }) - - const expectedFailureMetric = createExpectedMetricData( - MetricDataOperationName.EndDocGeneration, - getMetricResult(error) - ) - await assertTelemetry({ - spy: sendDocTelemetrySpy, - expectedEvent: expectedFailureMetric, - type: 'metric', - sandbox, - }) - }, - undefined, - error - ) - }) - } - }) -}) diff --git a/packages/core/src/test/amazonqDoc/mockContent.ts b/packages/core/src/test/amazonqDoc/mockContent.ts deleted file mode 100644 index 1f3e68f6a58..00000000000 --- a/packages/core/src/test/amazonqDoc/mockContent.ts +++ /dev/null @@ -1,86 +0,0 @@ -/*! - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ -export const ReadmeSections = { - HEADER: `# My Awesome Project - -This is a demo project showcasing various features and capabilities.`, - - GETTING_STARTED: `## Getting Started -1. Clone the repository -2. Run npm install -3. Start the application`, - - FEATURES: `## Features -- Fast processing -- Easy to use -- Well documented`, - - LICENSE: '## License\nMIT License', - - REPO_STRUCTURE: `## Repository Structure -/src - /components - /utils -/tests - /unit -/docs`, - - DATA_FLOW: `## Data Flow -1. Input processing - - Data validation - - Format conversion -2. Core processing - - Business logic - - Data transformation -3. Output generation - - Result formatting - - Response delivery`, -} as const - -export class ReadmeBuilder { - private sections: string[] = [] - - addSection(section: string): this { - this.sections.push(section.replace(/\r\n/g, '\n')) - return this - } - - build(): string { - return this.sections.join('\n\n').replace(/\r\n/g, '\n') - } - - static createBaseReadme(): string { - return new ReadmeBuilder() - .addSection(ReadmeBuilder.normalizeSection(ReadmeSections.HEADER)) - .addSection(ReadmeBuilder.normalizeSection(ReadmeSections.GETTING_STARTED)) - .addSection(ReadmeBuilder.normalizeSection(ReadmeSections.FEATURES)) - .addSection(ReadmeBuilder.normalizeSection(ReadmeSections.LICENSE)) - .build() - } - - static createReadmeWithRepoStructure(): string { - return new ReadmeBuilder() - .addSection(ReadmeBuilder.normalizeSection(ReadmeSections.HEADER)) - .addSection(ReadmeBuilder.normalizeSection(ReadmeSections.REPO_STRUCTURE)) - .addSection(ReadmeBuilder.normalizeSection(ReadmeSections.GETTING_STARTED)) - .addSection(ReadmeBuilder.normalizeSection(ReadmeSections.FEATURES)) - .addSection(ReadmeBuilder.normalizeSection(ReadmeSections.LICENSE)) - .build() - } - - static createReadmeWithDataFlow(): string { - return new ReadmeBuilder() - .addSection(ReadmeBuilder.normalizeSection(ReadmeSections.HEADER)) - .addSection(ReadmeBuilder.normalizeSection(ReadmeSections.GETTING_STARTED)) - .addSection(ReadmeBuilder.normalizeSection(ReadmeSections.FEATURES)) - .addSection(ReadmeBuilder.normalizeSection(ReadmeSections.DATA_FLOW)) - .addSection(ReadmeBuilder.normalizeSection(ReadmeSections.LICENSE)) - .build() - } - - private static normalizeSection(section: string): string { - return section.replace(/\r\n/g, '\n') - } -} diff --git a/packages/core/src/test/amazonqDoc/session/sessionState.test.ts b/packages/core/src/test/amazonqDoc/session/sessionState.test.ts deleted file mode 100644 index 8f96894cc22..00000000000 --- a/packages/core/src/test/amazonqDoc/session/sessionState.test.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*! - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -import * as vscode from 'vscode' -import assert from 'assert' -import sinon from 'sinon' -import { DocPrepareCodeGenState } from '../../../amazonqDoc' -import { createMockSessionStateAction } from '../../amazonq/utils' - -import { createTestContext, setupTestHooks } from '../../amazonq/session/testSetup' - -describe('sessionStateDoc', () => { - const context = createTestContext() - setupTestHooks(context) - - describe('DocPrepareCodeGenState', () => { - it('error when failing to prepare repo information', async () => { - sinon.stub(vscode.workspace, 'findFiles').throws() - context.testMocks.createUploadUrl!.resolves({ uploadId: '', uploadUrl: '' }) - const testAction = createMockSessionStateAction() - - await assert.rejects(() => { - return new DocPrepareCodeGenState(context.testConfig, [], [], [], context.tabId, 0).interact(testAction) - }) - }) - }) -}) diff --git a/packages/core/src/test/amazonqDoc/utils.ts b/packages/core/src/test/amazonqDoc/utils.ts deleted file mode 100644 index 51c7305902c..00000000000 --- a/packages/core/src/test/amazonqDoc/utils.ts +++ /dev/null @@ -1,269 +0,0 @@ -/*! - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -import * as vscode from 'vscode' -import * as sinon from 'sinon' -import { MessagePublisher } from '../../amazonq/messages/messagePublisher' -import { ChatControllerEventEmitters, DocController } from '../../amazonqDoc/controllers/chat/controller' -import { DocChatSessionStorage } from '../../amazonqDoc/storages/chatSession' -import { createTestWorkspaceFolder } from '../testUtil' -import { Session } from '../../amazonqDoc/session/session' -import { NewFileInfo, SessionState } from '../../amazonqDoc/types' -import { FeatureDevClient } from '../../amazonqFeatureDev/client/featureDev' -import { VirtualMemoryFile } from '../../shared/virtualMemoryFile' -import path from 'path' -import { docChat } from '../../amazonqDoc/constants' -import { DocMessenger } from '../../amazonqDoc/messenger' -import { AppToWebViewMessageDispatcher } from '../../amazonq/commons/connector/connectorMessages' -import { createSessionConfig } from '../../amazonq/commons/session/sessionConfigFactory' -import { - DocV2GenerationEvent, - DocV2AcceptanceEvent, - MetricData, -} from '../../amazonqFeatureDev/client/featuredevproxyclient' -import { FollowUpTypes } from '../../amazonq/commons/types' - -export function createMessenger(sandbox: sinon.SinonSandbox): DocMessenger { - return new DocMessenger( - new AppToWebViewMessageDispatcher(new MessagePublisher(sandbox.createStubInstance(vscode.EventEmitter))), - docChat - ) -} - -export function createMockChatEmitters(): ChatControllerEventEmitters { - return { - processHumanChatMessage: new vscode.EventEmitter(), - followUpClicked: new vscode.EventEmitter(), - openDiff: new vscode.EventEmitter(), - processChatItemVotedMessage: new vscode.EventEmitter(), - processChatItemFeedbackMessage: new vscode.EventEmitter(), - stopResponse: new vscode.EventEmitter(), - tabOpened: new vscode.EventEmitter(), - tabClosed: new vscode.EventEmitter(), - authClicked: new vscode.EventEmitter(), - processResponseBodyLinkClick: new vscode.EventEmitter(), - insertCodeAtPositionClicked: new vscode.EventEmitter(), - fileClicked: new vscode.EventEmitter(), - formActionClicked: new vscode.EventEmitter(), - } -} - -export interface ControllerSetup { - emitters: ChatControllerEventEmitters - workspaceFolder: vscode.WorkspaceFolder - messenger: DocMessenger - sessionStorage: DocChatSessionStorage -} - -export async function createSession({ - messenger, - sessionState, - scheme, - conversationID = '0', - tabID = '0', - uploadID = '0', - sandbox, -}: { - messenger: DocMessenger - scheme: string - sessionState?: Omit - conversationID?: string - tabID?: string - uploadID?: string - sandbox: sinon.SinonSandbox -}) { - const sessionConfig = await createSessionConfig(scheme) - - const client = sandbox.createStubInstance(FeatureDevClient) - client.createConversation.resolves(conversationID) - const session = new Session(sessionConfig, messenger, tabID, sessionState, client) - - sandbox.stub(session, 'conversationId').get(() => conversationID) - sandbox.stub(session, 'uploadId').get(() => uploadID) - - return session -} -export async function sessionRegisterProvider(session: Session, uri: vscode.Uri, fileContents: Uint8Array) { - session.config.fs.registerProvider(uri, new VirtualMemoryFile(fileContents)) -} - -export function generateVirtualMemoryUri(uploadID: string, filePath: string, scheme: string) { - const generationFilePath = path.join(uploadID, filePath) - const uri = vscode.Uri.from({ scheme, path: generationFilePath }) - return uri -} - -export async function sessionWriteFile(session: Session, uri: vscode.Uri, encodedContent: Uint8Array) { - await session.config.fs.writeFile(uri, encodedContent, { - create: true, - overwrite: true, - }) -} - -export async function createController(sandbox: sinon.SinonSandbox): Promise { - const messenger = createMessenger(sandbox) - - // Create a new workspace root - const testWorkspaceFolder = await createTestWorkspaceFolder() - sandbox.stub(vscode.workspace, 'workspaceFolders').value([testWorkspaceFolder]) - - const sessionStorage = new DocChatSessionStorage(messenger) - - const mockChatControllerEventEmitters = createMockChatEmitters() - - new DocController( - mockChatControllerEventEmitters, - messenger, - sessionStorage, - sandbox.createStubInstance(vscode.EventEmitter).event - ) - - return { - emitters: mockChatControllerEventEmitters, - workspaceFolder: testWorkspaceFolder, - messenger, - sessionStorage, - } -} - -export type EventParams = { - type: 'generation' | 'acceptance' - chars: number - lines: number - files: number - interactionType: 'GENERATE_README' | 'UPDATE_README' | 'EDIT_README' - callIndex?: number - conversationId: string -} -/** - * Metrics for measuring README content changes in documentation generation tests. - */ -export const EventMetrics = { - /** - * Initial README content measurements - * Generated using ReadmeBuilder.createBaseReadme() - */ - INITIAL_README: { - chars: 265, - lines: 16, - files: 1, - }, - /** - * Repository Structure section measurements - * Differential metrics when adding repository structure documentation compare to the initial readme - */ - REPO_STRUCTURE: { - chars: 60, - lines: 8, - files: 1, - }, - /** - * Data Flow section measurements - * Differential metrics when adding data flow documentation compare to the initial readme - */ - DATA_FLOW: { - chars: 180, - lines: 11, - files: 1, - }, -} as const - -export function createExpectedEvent(params: EventParams) { - const baseEvent = { - conversationId: params.conversationId, - numberOfNavigations: 1, - folderLevel: 'ENTIRE_WORKSPACE', - interactionType: params.interactionType, - } - - if (params.type === 'generation') { - return { - ...baseEvent, - numberOfGeneratedChars: params.chars, - numberOfGeneratedLines: params.lines, - numberOfGeneratedFiles: params.files, - } as DocV2GenerationEvent - } else { - return { - ...baseEvent, - numberOfAddedChars: params.chars, - numberOfAddedLines: params.lines, - numberOfAddedFiles: params.files, - userDecision: 'ACCEPT', - } as DocV2AcceptanceEvent - } -} - -export function createExpectedMetricData(operationName: string, result: string) { - return { - metricName: 'Operation', - metricValue: 1, - timestamp: new Date(), - product: 'DocGeneration', - dimensions: [ - { - name: 'operationName', - value: operationName, - }, - { - name: 'result', - value: result, - }, - ], - } -} - -export async function assertTelemetry(params: { - spy: sinon.SinonStub - expectedEvent: DocV2GenerationEvent | DocV2AcceptanceEvent | MetricData - type: 'generation' | 'acceptance' | 'metric' - sandbox: sinon.SinonSandbox -}) { - await new Promise((resolve) => setTimeout(resolve, 100)) - params.sandbox.assert.calledWith(params.spy, params.sandbox.match(params.expectedEvent), params.type) -} - -export async function updateFilePaths( - session: Session, - content: string, - uploadId: string, - docScheme: string, - workspaceFolder: any -) { - const updatedFilePaths: NewFileInfo[] = [ - { - zipFilePath: path.normalize('README.md'), - relativePath: path.normalize('README.md'), - fileContent: content, - rejected: false, - virtualMemoryUri: generateVirtualMemoryUri(uploadId, path.normalize('README.md'), docScheme), - workspaceFolder: workspaceFolder, - changeApplied: false, - }, - ] - - Object.defineProperty(session.state, 'filePaths', { - get: () => updatedFilePaths, - configurable: true, - }) -} - -export const FollowUpSequences = { - generateReadme: [FollowUpTypes.NewTask, FollowUpTypes.CreateDocumentation, FollowUpTypes.ProceedFolderSelection], - updateReadme: [ - FollowUpTypes.NewTask, - FollowUpTypes.UpdateDocumentation, - FollowUpTypes.SynchronizeDocumentation, - FollowUpTypes.ProceedFolderSelection, - ], - editReadme: [ - FollowUpTypes.NewTask, - FollowUpTypes.UpdateDocumentation, - FollowUpTypes.EditDocumentation, - FollowUpTypes.ProceedFolderSelection, - ], - makeChanges: [FollowUpTypes.MakeChanges], - acceptContent: [FollowUpTypes.AcceptChanges], -} diff --git a/packages/core/src/test/amazonqFeatureDev/controllers/chat/controller.test.ts b/packages/core/src/test/amazonqFeatureDev/controllers/chat/controller.test.ts deleted file mode 100644 index 7848d0561b0..00000000000 --- a/packages/core/src/test/amazonqFeatureDev/controllers/chat/controller.test.ts +++ /dev/null @@ -1,717 +0,0 @@ -/*! - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -import * as vscode from 'vscode' -import * as assert from 'assert' -import * as path from 'path' -import sinon from 'sinon' -import { waitUntil } from '../../../../shared/utilities/timeoutUtils' -import { ControllerSetup, createController, createSession, generateVirtualMemoryUri } from '../../../amazonq/utils' -import { - CurrentWsFolders, - DeletedFileInfo, - MetricDataOperationName, - MetricDataResult, - NewFileInfo, -} from '../../../../amazonq/commons/types' -import { Session } from '../../../../amazonqFeatureDev/session/session' -import { Prompter } from '../../../../shared/ui/prompter' -import { assertTelemetry, toFile } from '../../../testUtil' -import { - CodeIterationLimitError, - ContentLengthError, - createUserFacingErrorMessage, - FeatureDevServiceError, - getMetricResult, - MonthlyConversationLimitError, - NoChangeRequiredException, - PrepareRepoFailedError, - PromptRefusalException, - SelectedFolderNotInWorkspaceFolderError, - TabIdNotFoundError, - UploadCodeError, - UploadURLExpired, - UserMessageNotFoundError, - ZipFileError, -} from '../../../../amazonqFeatureDev/errors' -import { - FeatureDevCodeGenState, - FeatureDevPrepareCodeGenState, -} from '../../../../amazonqFeatureDev/session/sessionState' -import { FeatureDevClient } from '../../../../amazonqFeatureDev/client/featureDev' -import { createAmazonQUri } from '../../../../amazonq/commons/diff' -import { AuthUtil } from '../../../../codewhisperer' -import { featureDevScheme, featureName, messageWithConversationId } from '../../../../amazonqFeatureDev' -import { i18n } from '../../../../shared/i18n-helper' -import { FollowUpTypes } from '../../../../amazonq/commons/types' -import { ToolkitError } from '../../../../shared' -import { MessengerTypes } from '../../../../amazonqFeatureDev/controllers/chat/messenger/constants' - -let mockGetCodeGeneration: sinon.SinonStub -describe('Controller', () => { - const tabID = '123' - const conversationID = '456' - const uploadID = '789' - - let session: Session - let controllerSetup: ControllerSetup - - const getFilePaths = (controllerSetup: ControllerSetup): NewFileInfo[] => [ - { - zipFilePath: 'myfile1.js', - relativePath: 'myfile1.js', - fileContent: '', - rejected: false, - virtualMemoryUri: generateVirtualMemoryUri(uploadID, 'myfile1.js', featureDevScheme), - workspaceFolder: controllerSetup.workspaceFolder, - changeApplied: false, - }, - { - zipFilePath: 'myfile2.js', - relativePath: 'myfile2.js', - fileContent: '', - rejected: true, - virtualMemoryUri: generateVirtualMemoryUri(uploadID, 'myfile2.js', featureDevScheme), - workspaceFolder: controllerSetup.workspaceFolder, - changeApplied: false, - }, - ] - - const getDeletedFiles = (): DeletedFileInfo[] => [ - { - zipFilePath: 'myfile3.js', - relativePath: 'myfile3.js', - rejected: false, - workspaceFolder: controllerSetup.workspaceFolder, - changeApplied: false, - }, - { - zipFilePath: 'myfile4.js', - relativePath: 'myfile4.js', - rejected: true, - workspaceFolder: controllerSetup.workspaceFolder, - changeApplied: false, - }, - ] - - async function createCodeGenState() { - mockGetCodeGeneration = sinon.stub().resolves({ codeGenerationStatus: { status: 'Complete' } }) - - const workspaceFolders = [controllerSetup.workspaceFolder] as CurrentWsFolders - const testConfig = { - conversationId: conversationID, - proxyClient: { - createConversation: () => sinon.stub(), - createUploadUrl: () => sinon.stub(), - generatePlan: () => sinon.stub(), - startCodeGeneration: () => sinon.stub(), - getCodeGeneration: () => mockGetCodeGeneration(), - exportResultArchive: () => sinon.stub(), - } as unknown as FeatureDevClient, - workspaceRoots: [''], - uploadId: uploadID, - workspaceFolders, - } - - const codeGenState = new FeatureDevCodeGenState(testConfig, getFilePaths(controllerSetup), [], [], tabID, 0, {}) - const newSession = await createSession({ - messenger: controllerSetup.messenger, - sessionState: codeGenState, - conversationID, - tabID, - uploadID, - scheme: featureDevScheme, - }) - return newSession - } - - before(() => { - sinon.stub(performance, 'now').returns(0) - }) - - beforeEach(async () => { - controllerSetup = await createController() - session = await createSession({ - messenger: controllerSetup.messenger, - conversationID, - tabID, - uploadID, - scheme: featureDevScheme, - }) - - sinon.stub(AuthUtil.instance, 'getChatAuthState').resolves({ - codewhispererCore: 'connected', - codewhispererChat: 'connected', - amazonQ: 'connected', - }) - }) - - afterEach(() => { - sinon.restore() - }) - - describe('openDiff', async () => { - async function openDiff(filePath: string, deleted = false) { - const executeDiff = sinon.stub(vscode.commands, 'executeCommand').returns(Promise.resolve(undefined)) - controllerSetup.emitters.openDiff.fire({ tabID, conversationID, filePath, deleted }) - - // Wait until the controller has time to process the event - await waitUntil(() => { - return Promise.resolve(executeDiff.callCount > 0) - }, {}) - - return executeDiff - } - - it('uses empty file when file is not found locally', async () => { - sinon.stub(controllerSetup.sessionStorage, 'getSession').resolves(session) - const executedDiff = await openDiff(path.join('src', 'mynewfile.js')) - assert.strictEqual( - executedDiff.calledWith( - 'vscode.diff', - createAmazonQUri('empty', tabID, featureDevScheme), - createAmazonQUri(path.join(uploadID, 'src', 'mynewfile.js'), tabID, featureDevScheme) - ), - true - ) - - assertTelemetry('amazonq_isReviewedChanges', { amazonqConversationId: conversationID, enabled: true }) - }) - - it('uses file location when file is found locally and /src is not available', async () => { - sinon.stub(controllerSetup.sessionStorage, 'getSession').resolves(session) - const newFileLocation = path.join(controllerSetup.workspaceFolder.uri.fsPath, 'mynewfile.js') - await toFile('', newFileLocation) - const executedDiff = await openDiff('mynewfile.js') - assert.strictEqual( - executedDiff.calledWith( - 'vscode.diff', - vscode.Uri.file(newFileLocation), - createAmazonQUri(path.join(uploadID, 'mynewfile.js'), tabID, featureDevScheme) - ), - true - ) - - assertTelemetry('amazonq_isReviewedChanges', { amazonqConversationId: conversationID, enabled: true }) - }) - - it('uses file location when file is found locally and /src is available', async () => { - sinon.stub(controllerSetup.sessionStorage, 'getSession').resolves(session) - const newFileLocation = path.join(controllerSetup.workspaceFolder.uri.fsPath, 'src', 'mynewfile.js') - await toFile('', newFileLocation) - const executedDiff = await openDiff(path.join('src', 'mynewfile.js')) - assert.strictEqual( - executedDiff.calledWith( - 'vscode.diff', - vscode.Uri.file(newFileLocation), - createAmazonQUri(path.join(uploadID, 'src', 'mynewfile.js'), tabID, featureDevScheme) - ), - true - ) - - assertTelemetry('amazonq_isReviewedChanges', { amazonqConversationId: conversationID, enabled: true }) - }) - - it('uses file location when file is found locally and source folder was picked', async () => { - sinon.stub(controllerSetup.sessionStorage, 'getSession').resolves(session) - const newFileLocation = path.join(controllerSetup.workspaceFolder.uri.fsPath, 'foo', 'fi', 'mynewfile.js') - await toFile('', newFileLocation) - sinon.stub(vscode.workspace, 'getWorkspaceFolder').returns(controllerSetup.workspaceFolder) - session.config.workspaceRoots = [path.join(controllerSetup.workspaceFolder.uri.fsPath, 'foo', 'fi')] - const executedDiff = await openDiff(path.join('foo', 'fi', 'mynewfile.js')) - assert.strictEqual( - executedDiff.calledWith( - 'vscode.diff', - vscode.Uri.file(newFileLocation), - createAmazonQUri(path.join(uploadID, 'foo', 'fi', 'mynewfile.js'), tabID, featureDevScheme) - ), - true - ) - - assertTelemetry('amazonq_isReviewedChanges', { amazonqConversationId: conversationID, enabled: true }) - }) - }) - - describe('modifyDefaultSourceFolder', () => { - async function modifyDefaultSourceFolder(sourceRoot: string) { - const promptStub = sinon.stub(Prompter.prototype, 'prompt').resolves(vscode.Uri.file(sourceRoot)) - controllerSetup.emitters.followUpClicked.fire({ - tabID, - followUp: { - type: FollowUpTypes.ModifyDefaultSourceFolder, - }, - }) - - // Wait until the controller has time to process the event - await waitUntil(() => { - return Promise.resolve(promptStub.callCount > 0) - }, {}) - - return controllerSetup.sessionStorage.getSession(tabID) - } - - it('fails if selected folder is not under a workspace folder', async () => { - sinon.stub(controllerSetup.sessionStorage, 'getSession').resolves(session) - sinon.stub(vscode.workspace, 'getWorkspaceFolder').returns(undefined) - const messengerSpy = sinon.spy(controllerSetup.messenger, 'sendAnswer') - await modifyDefaultSourceFolder('../../') - assert.deepStrictEqual( - messengerSpy.calledWith({ - tabID, - type: 'answer', - message: new SelectedFolderNotInWorkspaceFolderError().message, - canBeVoted: true, - }), - true - ) - assert.deepStrictEqual( - messengerSpy.calledWith({ - tabID, - type: 'system-prompt', - followUps: sinon.match.any, - }), - true - ) - }) - - it('accepts valid source folders under a workspace root', async () => { - sinon.stub(controllerSetup.sessionStorage, 'getSession').resolves(session) - sinon.stub(vscode.workspace, 'getWorkspaceFolder').returns(controllerSetup.workspaceFolder) - const expectedSourceRoot = path.join(controllerSetup.workspaceFolder.uri.fsPath, 'src') - const modifiedSession = await modifyDefaultSourceFolder(expectedSourceRoot) - assert.strictEqual(modifiedSession.config.workspaceRoots.length, 1) - assert.strictEqual(modifiedSession.config.workspaceRoots[0], expectedSourceRoot) - }) - }) - - describe('newTask', () => { - async function newTaskClicked() { - const getSessionStub = sinon.stub(controllerSetup.sessionStorage, 'getSession').resolves(session) - - controllerSetup.emitters.followUpClicked.fire({ - tabID, - followUp: { - type: FollowUpTypes.NewTask, - }, - }) - - // Wait until the controller has time to process the event - await waitUntil(() => { - return Promise.resolve(getSessionStub.callCount > 0) - }, {}) - } - - it('end chat telemetry is sent', async () => { - await newTaskClicked() - - assertTelemetry('amazonq_endChat', { amazonqConversationId: conversationID, result: 'Succeeded' }) - }) - }) - - describe('fileClicked', () => { - async function fileClicked( - getSessionStub: sinon.SinonStub<[tabID: string], Promise>, - action: string, - filePath: string - ) { - controllerSetup.emitters.fileClicked.fire({ - tabID, - conversationID, - filePath, - action, - }) - - // Wait until the controller has time to process the event - await waitUntil(() => { - return Promise.resolve(getSessionStub.callCount > 0) - }, {}) - return getSessionStub.getCall(0).returnValue - } - - it('clicking the "Reject File" button updates the file state to "rejected: true"', async () => { - const filePath = getFilePaths(controllerSetup)[0].zipFilePath - const session = await createCodeGenState() - const getSessionStub = sinon.stub(controllerSetup.sessionStorage, 'getSession').resolves(session) - - const rejectFile = await fileClicked(getSessionStub, 'reject-change', filePath) - assert.strictEqual(rejectFile.state.filePaths?.find((i) => i.relativePath === filePath)?.rejected, true) - }) - - it('clicking the "Reject File" button and then "Revert Reject File", updates the file state to "rejected: false"', async () => { - const filePath = getFilePaths(controllerSetup)[0].zipFilePath - const session = await createCodeGenState() - const getSessionStub = sinon.stub(controllerSetup.sessionStorage, 'getSession').resolves(session) - - await fileClicked(getSessionStub, 'reject-change', filePath) - const revertRejection = await fileClicked(getSessionStub, 'revert-rejection', filePath) - assert.strictEqual( - revertRejection.state.filePaths?.find((i) => i.relativePath === filePath)?.rejected, - false - ) - }) - }) - - describe('insertCode', () => { - it('sets the number of files accepted counting also deleted files', async () => { - async function insertCode() { - const initialState = new FeatureDevPrepareCodeGenState( - { - conversationId: conversationID, - proxyClient: new FeatureDevClient(), - workspaceRoots: [''], - workspaceFolders: [controllerSetup.workspaceFolder], - uploadId: uploadID, - }, - getFilePaths(controllerSetup), - getDeletedFiles(), - [], - tabID, - 0 - ) - - const newSession = await createSession({ - messenger: controllerSetup.messenger, - sessionState: initialState, - conversationID, - tabID, - uploadID, - scheme: featureDevScheme, - }) - const getSessionStub = sinon.stub(controllerSetup.sessionStorage, 'getSession').resolves(newSession) - - controllerSetup.emitters.followUpClicked.fire({ - tabID, - conversationID, - followUp: { - type: FollowUpTypes.InsertCode, - }, - }) - - // Wait until the controller has time to process the event - await waitUntil(() => { - return Promise.resolve(getSessionStub.callCount > 0) - }, {}) - } - - await insertCode() - - assertTelemetry('amazonq_isAcceptedCodeChanges', { - amazonqConversationId: conversationID, - amazonqNumberOfFilesAccepted: 2, - enabled: true, - result: 'Succeeded', - }) - }) - }) - - describe('processUserChatMessage', function () { - // TODO: fix disablePreviousFileList error - const runs = [ - { name: 'ContentLengthError', error: new ContentLengthError() }, - { - name: 'MonthlyConversationLimitError', - error: new MonthlyConversationLimitError('Service Quota Exceeded'), - }, - { - name: 'FeatureDevServiceErrorGuardrailsException', - error: new FeatureDevServiceError( - i18n('AWS.amazonq.featureDev.error.codeGen.default'), - 'GuardrailsException' - ), - }, - { - name: 'FeatureDevServiceErrorEmptyPatchException', - error: new FeatureDevServiceError( - i18n('AWS.amazonq.featureDev.error.throttling'), - 'EmptyPatchException' - ), - }, - { - name: 'FeatureDevServiceErrorThrottlingException', - error: new FeatureDevServiceError( - i18n('AWS.amazonq.featureDev.error.codeGen.default'), - 'ThrottlingException' - ), - }, - { name: 'UploadCodeError', error: new UploadCodeError('403: Forbiden') }, - { name: 'UserMessageNotFoundError', error: new UserMessageNotFoundError() }, - { name: 'TabIdNotFoundError', error: new TabIdNotFoundError() }, - { name: 'PrepareRepoFailedError', error: new PrepareRepoFailedError() }, - { name: 'PromptRefusalException', error: new PromptRefusalException() }, - { name: 'ZipFileError', error: new ZipFileError() }, - { name: 'CodeIterationLimitError', error: new CodeIterationLimitError() }, - { name: 'UploadURLExpired', error: new UploadURLExpired() }, - { name: 'NoChangeRequiredException', error: new NoChangeRequiredException() }, - { name: 'default', error: new ToolkitError('Default', { code: 'Default' }) }, - ] - - async function fireChatMessage(session: Session) { - const getSessionStub = sinon.stub(controllerSetup.sessionStorage, 'getSession').resolves(session) - - controllerSetup.emitters.processHumanChatMessage.fire({ - tabID, - conversationID, - message: 'test message', - }) - - /** - * Wait until the controller has time to process the event - * Sessions should be called twice: - * 1. When the session getWorkspaceRoot is called - * 2. When the controller processes preloader - */ - await waitUntil(() => { - return Promise.resolve(getSessionStub.callCount > 1) - }, {}) - } - - describe('onCodeGeneration', function () { - let session: any - let sendMetricDataTelemetrySpy: sinon.SinonStub - - async function verifyException(error: ToolkitError) { - sinon.stub(session, 'send').throws(error) - - await fireChatMessage(session) - await verifyMetricsCalled() - assert.ok( - sendMetricDataTelemetrySpy.calledWith( - MetricDataOperationName.StartCodeGeneration, - MetricDataResult.Success - ) - ) - const metricResult = getMetricResult(error) - assert.ok( - sendMetricDataTelemetrySpy.calledWith(MetricDataOperationName.EndCodeGeneration, metricResult) - ) - } - - async function verifyMetricsCalled() { - await waitUntil(() => Promise.resolve(sendMetricDataTelemetrySpy.callCount >= 2), {}) - } - - async function verifyMessage( - expectedMessage: string, - type: MessengerTypes, - remainingIterations?: number, - totalIterations?: number - ) { - sinon.stub(session, 'send').resolves() - sinon.stub(session, 'sendLinesOfCodeGeneratedTelemetry').resolves() // Avoid sending extra telemetry - const sendAnswerSpy = sinon.stub(controllerSetup.messenger, 'sendAnswer') - sinon.stub(session.state, 'codeGenerationRemainingIterationCount').value(remainingIterations) - sinon.stub(session.state, 'codeGenerationTotalIterationCount').value(totalIterations) - - await fireChatMessage(session) - await verifyMetricsCalled() - - assert.ok( - sendAnswerSpy.calledWith({ - type, - tabID, - message: expectedMessage, - }) - ) - } - - beforeEach(async () => { - session = await createCodeGenState() - sinon.stub(session, 'preloader').resolves() - sendMetricDataTelemetrySpy = sinon.stub(session, 'sendMetricDataTelemetry') - }) - - it('sends success operation telemetry', async () => { - sinon.stub(session, 'send').resolves() - sinon.stub(session, 'sendLinesOfCodeGeneratedTelemetry').resolves() // Avoid sending extra telemetry - - await fireChatMessage(session) - await verifyMetricsCalled() - - assert.ok( - sendMetricDataTelemetrySpy.calledWith( - MetricDataOperationName.StartCodeGeneration, - MetricDataResult.Success - ) - ) - assert.ok( - sendMetricDataTelemetrySpy.calledWith( - MetricDataOperationName.EndCodeGeneration, - MetricDataResult.Success - ) - ) - }) - - for (const { name, error } of runs) { - it(`sends failure operation telemetry on ${name}`, async () => { - await verifyException(error) - }) - } - - // Using 3 to avoid spamming the tests - for (let remainingIterations = 0; remainingIterations <= 3; remainingIterations++) { - it(`verifies add code messages for remaining iterations at ${remainingIterations}`, async () => { - const totalIterations = 10 - const expectedMessage = (() => { - if (remainingIterations > 2) { - return 'Would you like me to add this code to your project, or provide feedback for new code?' - } else if (remainingIterations > 0) { - return `Would you like me to add this code to your project, or provide feedback for new code? You have ${remainingIterations} out of ${totalIterations} code generations left.` - } else { - return 'Would you like me to add this code to your project?' - } - })() - await verifyMessage(expectedMessage, 'answer', remainingIterations, totalIterations) - }) - } - - for (let remainingIterations = -1; remainingIterations <= 3; remainingIterations++) { - let remaining: number | undefined = remainingIterations - if (remainingIterations < 0) { - remaining = undefined - } - it(`verifies messages after cancellation for remaining iterations at ${remaining !== undefined ? remaining : 'undefined'}`, async () => { - const totalIterations = 10 - const expectedMessage = (() => { - if (remaining === undefined || remaining > 2) { - return 'I stopped generating your code. If you want to continue working on this task, provide another description.' - } else if (remaining > 0) { - return `I stopped generating your code. If you want to continue working on this task, provide another description. You have ${remaining} out of ${totalIterations} code generations left.` - } else { - return "I stopped generating your code. You don't have more iterations left, however, you can start a new session." - } - })() - session.state.tokenSource.cancel() - await verifyMessage( - expectedMessage, - 'answer-part', - remaining, - remaining === undefined ? undefined : totalIterations - ) - }) - } - }) - - describe('processErrorChatMessage', function () { - function createTestErrorMessage(message: string) { - return createUserFacingErrorMessage(`${featureName} request failed: ${message}`) - } - - async function verifyException(error: ToolkitError) { - sinon.stub(session, 'preloader').throws(error) - const sendAnswerSpy = sinon.stub(controllerSetup.messenger, 'sendAnswer') - const sendErrorMessageSpy = sinon.stub(controllerSetup.messenger, 'sendErrorMessage') - const sendMonthlyLimitErrorSpy = sinon.stub(controllerSetup.messenger, 'sendMonthlyLimitError') - - await fireChatMessage(session) - - switch (error.constructor.name) { - case ContentLengthError.name: - assert.ok( - sendAnswerSpy.calledWith({ - type: 'answer', - tabID, - message: error.message + messageWithConversationId(session?.conversationIdUnsafe), - canBeVoted: true, - }) - ) - break - case MonthlyConversationLimitError.name: - assert.ok(sendMonthlyLimitErrorSpy.calledWith(tabID)) - break - case FeatureDevServiceError.name: - case UploadCodeError.name: - case UserMessageNotFoundError.name: - case TabIdNotFoundError.name: - case PrepareRepoFailedError.name: - assert.ok( - sendErrorMessageSpy.calledWith( - createTestErrorMessage(error.message), - tabID, - session?.retries, - session?.conversationIdUnsafe - ) - ) - break - case PromptRefusalException.name: - case ZipFileError.name: - assert.ok( - sendErrorMessageSpy.calledWith( - createTestErrorMessage(error.message), - tabID, - 0, - session?.conversationIdUnsafe, - true - ) - ) - break - case NoChangeRequiredException.name: - case CodeIterationLimitError.name: - case UploadURLExpired.name: - assert.ok( - sendAnswerSpy.calledWith({ - type: 'answer', - tabID, - message: error.message, - canBeVoted: true, - }) - ) - break - default: - assert.ok( - sendErrorMessageSpy.calledWith( - i18n('AWS.amazonq.featureDev.error.codeGen.default'), - tabID, - session?.retries, - session?.conversationIdUnsafe, - true - ) - ) - break - } - } - - for (const run of runs) { - it(`should handle ${run.name}`, async function () { - await verifyException(run.error) - }) - } - }) - }) - - describe('stopResponse', () => { - it('should emit ui_click telemetry with elementId amazonq_stopCodeGeneration', async () => { - const getSessionStub = sinon.stub(controllerSetup.sessionStorage, 'getSession').resolves(session) - controllerSetup.emitters.stopResponse.fire({ tabID, conversationID }) - await waitUntil(() => { - return Promise.resolve(getSessionStub.callCount > 0) - }, {}) - assertTelemetry('ui_click', { elementId: 'amazonq_stopCodeGeneration' }) - }) - }) - - describe('closeSession', async () => { - async function closeSessionClicked() { - const getSessionStub = sinon.stub(controllerSetup.sessionStorage, 'getSession').resolves(session) - - controllerSetup.emitters.followUpClicked.fire({ - tabID, - followUp: { - type: FollowUpTypes.CloseSession, - }, - }) - - // Wait until the controller has time to process the event - await waitUntil(() => { - return Promise.resolve(getSessionStub.callCount > 0) - }, {}) - } - - it('end chat telemetry is sent', async () => { - await closeSessionClicked() - - assertTelemetry('amazonq_endChat', { amazonqConversationId: conversationID, result: 'Succeeded' }) - }) - }) -}) diff --git a/packages/core/src/test/amazonqFeatureDev/session/sessionState.test.ts b/packages/core/src/test/amazonqFeatureDev/session/sessionState.test.ts deleted file mode 100644 index 2d68654ee00..00000000000 --- a/packages/core/src/test/amazonqFeatureDev/session/sessionState.test.ts +++ /dev/null @@ -1,95 +0,0 @@ -/*! - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -import * as vscode from 'vscode' -import assert from 'assert' -import sinon from 'sinon' -import { - MockCodeGenState, - FeatureDevPrepareCodeGenState, - FeatureDevCodeGenState, -} from '../../../amazonqFeatureDev/session/sessionState' -import { ToolkitError } from '../../../shared/errors' -import * as crypto from '../../../shared/crypto' -import { createMockSessionStateAction } from '../../amazonq/utils' - -import { createTestContext, setupTestHooks } from '../../amazonq/session/testSetup' - -describe('sessionStateFeatureDev', () => { - const context = createTestContext() - setupTestHooks(context) - - describe('MockCodeGenState', () => { - it('loops forever in the same state', async () => { - sinon.stub(crypto, 'randomUUID').returns('upload-id' as ReturnType<(typeof crypto)['randomUUID']>) - const testAction = createMockSessionStateAction() - const state = new MockCodeGenState(context.testConfig, context.tabId) - const result = await state.interact(testAction) - - assert.deepStrictEqual(result, { - nextState: state, - interaction: {}, - }) - }) - }) - - describe('FeatureDevPrepareCodeGenState', () => { - it('error when failing to prepare repo information', async () => { - sinon.stub(vscode.workspace, 'findFiles').throws() - context.testMocks.createUploadUrl!.resolves({ uploadId: '', uploadUrl: '' }) - const testAction = createMockSessionStateAction() - - await assert.rejects(() => { - return new FeatureDevPrepareCodeGenState(context.testConfig, [], [], [], context.tabId, 0).interact( - testAction - ) - }) - }) - }) - - describe('FeatureDevCodeGenState', () => { - it('transitions to FeatureDevPrepareCodeGenState when codeGenerationStatus ready ', async () => { - context.testMocks.getCodeGeneration!.resolves({ - codeGenerationStatus: { status: 'Complete' }, - codeGenerationRemainingIterationCount: 2, - codeGenerationTotalIterationCount: 3, - }) - - context.testMocks.exportResultArchive!.resolves({ newFileContents: [], deletedFiles: [], references: [] }) - - const testAction = createMockSessionStateAction() - const state = new FeatureDevCodeGenState(context.testConfig, [], [], [], context.tabId, 0, {}, 2, 3) - const result = await state.interact(testAction) - - const nextState = new FeatureDevPrepareCodeGenState( - context.testConfig, - [], - [], - [], - context.tabId, - 1, - 2, - 3, - undefined - ) - - assert.deepStrictEqual(result.nextState?.deletedFiles, nextState.deletedFiles) - assert.deepStrictEqual(result.nextState?.filePaths, result.nextState?.filePaths) - assert.deepStrictEqual(result.nextState?.references, result.nextState?.references) - }) - - it('fails when codeGenerationStatus failed ', async () => { - context.testMocks.getCodeGeneration!.rejects(new ToolkitError('Code generation failed')) - const testAction = createMockSessionStateAction() - const state = new FeatureDevCodeGenState(context.testConfig, [], [], [], context.tabId, 0, {}) - try { - await state.interact(testAction) - assert.fail('failed code generations should throw an error') - } catch (e: any) { - assert.deepStrictEqual(e.message, 'Code generation failed') - } - }) - }) -}) diff --git a/packages/core/src/test/amazonqGumby/transformationJobHistory.test.ts b/packages/core/src/test/amazonqGumby/transformationJobHistory.test.ts new file mode 100644 index 00000000000..b286ad6537f --- /dev/null +++ b/packages/core/src/test/amazonqGumby/transformationJobHistory.test.ts @@ -0,0 +1,333 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import assert from 'assert' +import * as sinon from 'sinon' +import * as vscode from 'vscode' +import * as os from 'os' +import * as path from 'path' +import fs from '../../shared/fs/fs' +import * as datetime from '../../shared/datetime' +import { codeWhispererClient } from '../../codewhisperer/client/codewhisperer' +import { + readHistoryFile, + writeToHistoryFile, + createMetadataFile, + cleanupTempJobFiles, + refreshJob, + JobMetadata, +} from '../../codewhisperer/service/transformByQ/transformationHistoryHandler' +import { copyArtifacts } from '../../codewhisperer/service/transformByQ/transformFileHandler' +import * as transformApiHandler from '../../codewhisperer/service/transformByQ/transformApiHandler' +import { ExportResultArchiveStructure } from '../../shared/utilities/download' +import { JDKVersion, TransformationType } from '../../codewhisperer' + +describe('Transformation History Handler', function () { + function setupFileSystemMocks() { + const createdFiles = new Map() + const createdDirs = new Set() + + // Mock file operations to track what gets created + sinon.stub(fs, 'mkdir').callsFake(async (dirPath: any) => { + createdDirs.add(dirPath.toString()) + }) + sinon.stub(fs, 'copy').callsFake(async (src: any, dest: any) => { + createdFiles.set(dest.toString(), `copied from ${src.toString()}`) + }) + sinon.stub(fs, 'writeFile').callsFake(async (filePath: any, content: any) => { + createdFiles.set(filePath.toString(), content.toString()) + }) + sinon.stub(fs, 'delete').callsFake(async (filePath: any) => { + createdFiles.delete(filePath.toString()) + }) + + return { createdFiles, createdDirs } + } + + afterEach(function () { + sinon.restore() + }) + + describe('Reading history file', function () { + it('Returns empty array when history file does not exist', async function () { + sinon.stub(fs, 'existsFile').resolves(false) + + const result = await readHistoryFile() + + assert.strictEqual(result.length, 0) + }) + + it('Limits results to 10 most recent jobs', async function () { + sinon.stub(fs, 'existsFile').resolves(true) + sinon.stub(datetime, 'isWithin30Days').returns(true) + + let historyContent = 'date\tproject_name\tstatus\tduration\tdiff_patch\tsummary\tjob_id\n' + for (let i = 1; i <= 15; i++) { + historyContent += `01/${i}/25, 10:00 AM\tproject-${i}\tCOMPLETED\t5 min\t\t\tjob-${i}\n` + } + + sinon.stub(fs, 'readFileText').resolves(historyContent) + + const result = await readHistoryFile() + + assert.strictEqual(result.length, 10) + assert.strictEqual(result[0].jobId, 'job-15') // most recent first + assert.strictEqual(result[9].jobId, 'job-6') + }) + }) + + describe('Writing to history file', function () { + let writtenFiles: Map + + beforeEach(function () { + writtenFiles = new Map() + + // Mock file operations to capture what gets written + sinon.stub(fs, 'mkdir').resolves() + sinon.stub(fs, 'writeFile').callsFake(async (filePath: any, content: any) => { + writtenFiles.set(filePath.toString(), content.toString()) + }) + sinon.stub(fs, 'appendFile').callsFake(async (filePath: any, content: any) => { + const existing = writtenFiles.get(filePath.toString()) || '' + writtenFiles.set(filePath.toString(), existing + content.toString()) + }) + sinon.stub(vscode.commands, 'executeCommand').resolves() + }) + + it('Creates history file with headers when it does not exist', async function () { + sinon.stub(fs, 'existsFile').resolves(false) + await writeToHistoryFile('01/01/25, 10:00 AM', 'test-project', 'COMPLETED', '5 min', 'job-123', '/job/path') + + const expectedPath = path.join(os.homedir(), '.aws', 'transform', 'transformation_history.tsv') + const fileContent = writtenFiles.get(expectedPath) + + assert(fileContent) + assert(fileContent.includes('date\tproject_name\tstatus\tduration\tdiff_patch\tsummary\tjob_id\n')) + assert( + fileContent.includes( + `01/01/25, 10:00 AM\ttest-project\tCOMPLETED\t5 min\t${path.join('/job/path', 'diff.patch')}\t${path.join('/job/path', 'summary', 'summary.md')}\tjob-123\n` + ) + ) + }) + + it('Excludes artifact paths for failed jobs', async function () { + sinon.stub(fs, 'existsFile').resolves(false) + await writeToHistoryFile('01/01/25, 10:00 AM', 'test-project', 'FAILED', '5 min', 'job-123', '/job/path') + + const expectedPath = path.join(os.homedir(), '.aws', 'transform', 'transformation_history.tsv') + const fileContent = writtenFiles.get(expectedPath) + + const lines = fileContent?.split('\n') || [] + const jobLine = lines.find((line) => line.includes('job-123')) + const fields = jobLine?.split('\t') || [] + + assert.strictEqual(fields[4], '') // diff path should be empty + assert.strictEqual(fields[5], '') // summary path should be empty + }) + + it('Appends new job to existing history file', async function () { + const existingContent = + 'date\tproject_name\tstatus\tduration\tdiff_patch\tsummary\tjob_id\n' + + '12/31/24, 09:00 AM\told-project\tCOMPLETED\t3 min\t/old/diff.patch\t/old/summary.md\told-job-456\n' + + writtenFiles.set( + path.join(os.homedir(), '.aws', 'transform', 'transformation_history.tsv'), + existingContent + ) + + sinon.stub(fs, 'existsFile').resolves(true) + + await writeToHistoryFile('01/01/25, 10:00 AM', 'new-project', 'FAILED', '2 min', 'new-job-789', '/new/path') + + const expectedPath = path.join(os.homedir(), '.aws', 'transform', 'transformation_history.tsv') + const fileContent = writtenFiles.get(expectedPath) + + // Verify old data is preserved + assert( + fileContent?.includes('old-project\tCOMPLETED\t3 min\t/old/diff.patch\t/old/summary.md\told-job-456') + ) + + // Verify new data is added + assert(fileContent?.includes('new-project\tFAILED\t2 min\t\t\tnew-job-789')) + + // Verify both jobs are present and that new job is at bottom of file + const lines = fileContent?.split('\n').filter((line) => line.trim()) || [] + assert.strictEqual(lines.length, 3) // header + 2 job lines + assert(lines[1].includes('old-job-456')) + assert(lines[2].includes('new-job-789')) + }) + }) + + describe('Metadata file operations', function () { + let createdFiles: Map + let createdDirs: Set + + const mockMetadata: JobMetadata = { + jobId: 'test-job-123', + projectName: 'test-project', + transformationType: TransformationType.LANGUAGE_UPGRADE, + sourceJDKVersion: JDKVersion.JDK8, + targetJDKVersion: JDKVersion.JDK17, + customDependencyVersionFilePath: '', + customBuildCommand: '', + targetJavaHome: '', + projectPath: '/path/to/project', + startTime: '01/01/24, 10:00 AM', + } + + beforeEach(function () { + const mocks = setupFileSystemMocks() + createdFiles = mocks.createdFiles + createdDirs = mocks.createdDirs + }) + + it('Creates job history directory and metadata files', async function () { + const result = await createMetadataFile('/path/to/payload.zip', mockMetadata) + + const expectedPath = path.join(os.homedir(), '.aws', 'transform', 'test-project', 'test-job-123') + assert.strictEqual(result, expectedPath) + + // Verify directory was created + assert(createdDirs.has(expectedPath)) + + // Verify zipped-code.zip was copied + const zipPath = path.join(expectedPath, 'zipped-code.zip') + assert(createdFiles.has(zipPath)) + assert.strictEqual(createdFiles.get(zipPath), 'copied from /path/to/payload.zip') + + // Verify metadata.json was created with correct content + const metadataPath = path.join(expectedPath, 'metadata.json') + assert(createdFiles.has(metadataPath)) + assert.strictEqual(createdFiles.get(metadataPath), JSON.stringify(mockMetadata)) + }) + + it('Deletes payload, build logs, and metadata files', async function () { + // Pre-populate files that would exist + createdFiles.set('/payload.zip', 'payload content') + createdFiles.set(path.join(os.tmpdir(), 'build-logs.txt'), 'build logs') + createdFiles.set(path.join('/job/path', 'metadata.json'), 'metadata') + createdFiles.set(path.join('/job/path', 'zipped-code.zip'), 'zip content') + + await cleanupTempJobFiles('/job/path', 'COMPLETED', '/payload.zip') + + // Verify files were deleted (no longer exist in createdFiles) + assert(!createdFiles.has('/payload.zip')) + assert(!createdFiles.has(path.join(os.tmpdir(), 'build-logs.txt'))) + assert(!createdFiles.has(path.join('/job/path', 'metadata.json'))) + assert(!createdFiles.has(path.join('/job/path', 'zipped-code.zip'))) + }) + + it('Preserves metadata for failed jobs', async function () { + // Pre-populate files that would exist + createdFiles.set(path.join('/job/path', 'metadata.json'), 'metadata') + createdFiles.set(path.join('/job/path', 'zipped-code.zip'), 'zip content') + + await cleanupTempJobFiles('/job/path', 'FAILED') + + // Verify metadata files still exist (were NOT deleted) + assert(createdFiles.has(path.join('/job/path', 'metadata.json'))) + assert(createdFiles.has(path.join('/job/path', 'zipped-code.zip'))) + }) + }) + + describe('Copying artifacts', function () { + let createdFiles: Map + let createdDirs: Set + + beforeEach(function () { + const mocks = setupFileSystemMocks() + createdFiles = mocks.createdFiles + createdDirs = mocks.createdDirs + }) + + it('Copies diff patch and summary files to destination', async function () { + await copyArtifacts(path.join('archive', 'path'), path.join('destination', 'path')) + + // Verify directories were created + assert(createdDirs.has(path.join('destination', 'path'))) + assert(createdDirs.has(path.join('destination', 'path', 'summary'))) + + // Verify files were copied to correct locations + assert(createdFiles.has(path.join('destination', 'path', 'diff.patch'))) + assert(createdFiles.has(path.join('destination', 'path', 'summary', 'summary.md'))) + + // Verify source paths are correct + const diffSource = createdFiles.get(path.join('destination', 'path', 'diff.patch')) + const summarySource = createdFiles.get(path.join('destination', 'path', 'summary', 'summary.md')) + assert(diffSource?.includes(path.normalize(ExportResultArchiveStructure.PathToDiffPatch))) + assert(summarySource?.includes(path.normalize(ExportResultArchiveStructure.PathToSummary))) + }) + }) + + describe('Refreshing jobs', function () { + let createdFiles: Map + let createdDirs: Set + let writtenFiles: Map + + beforeEach(function () { + createdFiles = new Map() + createdDirs = new Set() + writtenFiles = new Map() + + // Mock file operations to track what gets created/written + sinon.stub(vscode.commands, 'executeCommand').resolves() + sinon.stub(fs, 'mkdir').callsFake(async (dirPath: any) => { + createdDirs.add(dirPath.toString()) + }) + sinon.stub(fs, 'copy').callsFake(async (src: any, dest: any) => { + createdFiles.set(dest.toString(), `copied from ${src.toString()}`) + }) + sinon.stub(fs, 'delete').resolves() + sinon.stub(fs, 'writeFile').callsFake(async (filePath: any, content: any) => { + writtenFiles.set(filePath.toString(), content.toString()) + }) + sinon.stub(fs, 'appendFile').callsFake(async (filePath: any, content: any) => { + const existing = writtenFiles.get(filePath.toString()) || '' + writtenFiles.set(filePath.toString(), existing + content.toString()) + }) + sinon.stub(transformApiHandler, 'downloadAndExtractResultArchive').resolves() + }) + + it('Updates job status and downloads artifacts', async function () { + const mockResponse = { + transformationJob: { + status: 'COMPLETED', + endExecutionTime: new Date(), + creationTime: new Date(Date.now() - 300000), + }, + } as any + sinon.stub(codeWhispererClient, 'codeModernizerGetCodeTransformation').resolves(mockResponse) + + // Mock existsFile to return false for diff.patch but true for history file + sinon.stub(fs, 'existsFile').callsFake(async (filePath: any) => { + const pathStr = filePath.toString() + if (pathStr.includes('diff.patch')) { + return false // Artifacts don't exist yet, need to download + } + return true // History file exists + }) + + // Mock history file content for update + const historyContent = + 'date\tproject_name\tstatus\tduration\tdiff_patch\tsummary\tjob_id\n' + + '01/01/24, 10:00 AM\ttest-project\tFAILED\t\t\t\tjob-123\n' + sinon.stub(fs, 'readFileText').resolves(historyContent) + + await refreshJob('job-123', 'FAILED', 'test-project') + + // Verify artifacts were copied to job history path + const jobHistoryPath = path.join(os.homedir(), '.aws', 'transform', 'test-project', 'job-123') + assert(createdFiles.has(path.join(jobHistoryPath, 'diff.patch'))) + assert(createdFiles.has(path.join(jobHistoryPath, 'summary', 'summary.md'))) + + // Verify history file was updated with new status and artifact paths + const historyFilePath = path.join(os.homedir(), '.aws', 'transform', 'transformation_history.tsv') + const updatedContent = writtenFiles.get(historyFilePath) + assert(updatedContent?.includes('COMPLETED')) + assert(updatedContent?.includes('diff.patch')) + assert(updatedContent?.includes('summary.md')) + }) + }) +}) diff --git a/packages/core/src/test/auth/activation.test.ts b/packages/core/src/test/auth/activation.test.ts new file mode 100644 index 00000000000..f203033acba --- /dev/null +++ b/packages/core/src/test/auth/activation.test.ts @@ -0,0 +1,146 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' +import * as sinon from 'sinon' +import assert from 'assert' +import { initialize, SagemakerCookie } from '../../auth/activation' +import { LoginManager } from '../../auth/deprecated/loginManager' +import * as extensionUtilities from '../../shared/extensionUtilities' +import * as authUtils from '../../auth/utils' +import * as errors from '../../shared/errors' + +describe('auth/activation', function () { + let sandbox: sinon.SinonSandbox + let mockLoginManager: LoginManager + let executeCommandStub: sinon.SinonStub + let isAmazonQStub: sinon.SinonStub + let isSageMakerStub: sinon.SinonStub + let initializeCredentialsProviderManagerStub: sinon.SinonStub + let getErrorMsgStub: sinon.SinonStub + let mockLogger: any + + beforeEach(function () { + sandbox = sinon.createSandbox() + + // Create mocks + mockLoginManager = { + login: sandbox.stub(), + logout: sandbox.stub(), + } as any + + mockLogger = { + warn: sandbox.stub(), + info: sandbox.stub(), + error: sandbox.stub(), + debug: sandbox.stub(), + } + + // Stub external dependencies + executeCommandStub = sandbox.stub(vscode.commands, 'executeCommand') + isAmazonQStub = sandbox.stub(extensionUtilities, 'isAmazonQ') + isSageMakerStub = sandbox.stub(extensionUtilities, 'isSageMaker') + initializeCredentialsProviderManagerStub = sandbox.stub(authUtils, 'initializeCredentialsProviderManager') + getErrorMsgStub = sandbox.stub(errors, 'getErrorMsg') + }) + + afterEach(function () { + sandbox.restore() + }) + + describe('initialize', function () { + it('should not execute sagemaker.parseCookies when not in AmazonQ and SageMaker environment', async function () { + isAmazonQStub.returns(false) + isSageMakerStub.returns(false) + + await initialize(mockLoginManager) + + assert.ok(!executeCommandStub.called) + assert.ok(!initializeCredentialsProviderManagerStub.called) + }) + + it('should not execute sagemaker.parseCookies when only in AmazonQ environment', async function () { + isAmazonQStub.returns(true) + isSageMakerStub.returns(false) + + await initialize(mockLoginManager) + + assert.ok(!executeCommandStub.called) + assert.ok(!initializeCredentialsProviderManagerStub.called) + }) + + it('should not execute sagemaker.parseCookies when only in SageMaker environment', async function () { + isAmazonQStub.returns(false) + isSageMakerStub.returns(true) + + await initialize(mockLoginManager) + + assert.ok(!executeCommandStub.called) + assert.ok(!initializeCredentialsProviderManagerStub.called) + }) + + it('should execute sagemaker.parseCookies when in both AmazonQ and SageMaker environment', async function () { + isAmazonQStub.returns(true) + isSageMakerStub.returns(true) + executeCommandStub.withArgs('sagemaker.parseCookies').resolves({ authMode: 'Sso' } as SagemakerCookie) + + await initialize(mockLoginManager) + + assert.ok(executeCommandStub.calledOnceWith('sagemaker.parseCookies')) + assert.ok(!initializeCredentialsProviderManagerStub.called) + }) + + it('should initialize credentials provider manager when authMode is not Sso', async function () { + isAmazonQStub.returns(true) + isSageMakerStub.returns(true) + executeCommandStub.withArgs('sagemaker.parseCookies').resolves({ authMode: 'Iam' } as SagemakerCookie) + + await initialize(mockLoginManager) + + assert.ok(executeCommandStub.calledOnceWith('sagemaker.parseCookies')) + assert.ok(initializeCredentialsProviderManagerStub.calledOnce) + }) + + it('should initialize credentials provider manager when authMode is undefined', async function () { + isAmazonQStub.returns(true) + isSageMakerStub.returns(true) + executeCommandStub.withArgs('sagemaker.parseCookies').resolves({} as SagemakerCookie) + + await initialize(mockLoginManager) + + assert.ok(executeCommandStub.calledOnceWith('sagemaker.parseCookies')) + assert.ok(initializeCredentialsProviderManagerStub.calledOnce) + }) + + it('should warn and not throw when sagemaker.parseCookies command is not found', async function () { + isAmazonQStub.returns(true) + isSageMakerStub.returns(true) + const error = new Error("command 'sagemaker.parseCookies' not found") + executeCommandStub.withArgs('sagemaker.parseCookies').rejects(error) + getErrorMsgStub.returns("command 'sagemaker.parseCookies' not found") + + await initialize(mockLoginManager) + + assert.ok(executeCommandStub.calledOnceWith('sagemaker.parseCookies')) + assert.ok(getErrorMsgStub.calledOnceWith(error)) + assert.ok(!initializeCredentialsProviderManagerStub.called) + }) + + it('should throw when sagemaker.parseCookies fails with non-command-not-found error', async function () { + isAmazonQStub.returns(true) + isSageMakerStub.returns(true) + const error = new Error('Some other error') + executeCommandStub.withArgs('sagemaker.parseCookies').rejects(error) + getErrorMsgStub.returns('Some other error') + + await assert.rejects(initialize(mockLoginManager), /Some other error/) + + assert.ok(executeCommandStub.calledOnceWith('sagemaker.parseCookies')) + assert.ok(getErrorMsgStub.calledOnceWith(error)) + assert.ok(!mockLogger.warn.called) + assert.ok(!initializeCredentialsProviderManagerStub.called) + }) + }) +}) diff --git a/packages/core/src/test/auth/providers/sharedCredentialsProvider.test.ts b/packages/core/src/test/auth/providers/sharedCredentialsProvider.test.ts new file mode 100644 index 00000000000..1884e16e984 --- /dev/null +++ b/packages/core/src/test/auth/providers/sharedCredentialsProvider.test.ts @@ -0,0 +1,79 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import assert from 'assert' +import { SharedCredentialsProvider } from '../../../auth/providers/sharedCredentialsProvider' +import { createTestSections } from '../../credentials/testUtil' +import { DefaultStsClient } from '../../../shared/clients/stsClient' +import { oneDay } from '../../../shared/datetime' +import sinon from 'sinon' +import { SsoAccessTokenProvider } from '../../../auth/sso/ssoAccessTokenProvider' +import { SsoClient } from '../../../auth/sso/clients' + +describe('SharedCredentialsProvider - Role Chaining with SSO', function () { + let sandbox: sinon.SinonSandbox + + beforeEach(function () { + sandbox = sinon.createSandbox() + }) + + afterEach(function () { + sandbox.restore() + }) + + it('should handle role chaining from SSO profile', async function () { + // Mock the SSO authentication + sandbox.stub(SsoAccessTokenProvider.prototype, 'getToken').resolves({ + accessToken: 'test-token', + expiresAt: new Date(Date.now() + oneDay), + }) + + // Mock SSO getRoleCredentials + sandbox.stub(SsoClient.prototype, 'getRoleCredentials').resolves({ + accessKeyId: 'sso-access-key', + secretAccessKey: 'sso-secret-key', + sessionToken: 'sso-session-token', + expiration: new Date(Date.now() + oneDay), + }) + + // Mock STS assumeRole + sandbox.stub(DefaultStsClient.prototype, 'assumeRole').callsFake(async (request) => { + assert.strictEqual(request.RoleArn, 'arn:aws:iam::123456789012:role/dev') + return { + Credentials: { + AccessKeyId: 'assumed-access-key', + SecretAccessKey: 'assumed-secret-key', + SessionToken: 'assumed-session-token', + Expiration: new Date(Date.now() + oneDay), + }, + } + }) + + const sections = await createTestSections(` + [sso-session aws1_session] + sso_start_url = https://example.awsapps.com/start + sso_region = us-east-1 + sso_registration_scopes = sso:account:access + + [profile Landing] + sso_session = aws1_session + sso_account_id = 111111111111 + sso_role_name = Landing + region = us-east-1 + + [profile dev] + region = us-east-1 + role_arn = arn:aws:iam::123456789012:role/dev + source_profile = Landing + `) + + const provider = new SharedCredentialsProvider('dev', sections) + const credentials = await provider.getCredentials() + + assert.strictEqual(credentials.accessKeyId, 'assumed-access-key') + assert.strictEqual(credentials.secretAccessKey, 'assumed-secret-key') + assert.strictEqual(credentials.sessionToken, 'assumed-session-token') + }) +}) diff --git a/packages/core/src/test/awsService/appBuilder/lambda2sam/lambda2sam.test.ts b/packages/core/src/test/awsService/appBuilder/lambda2sam/lambda2sam.test.ts new file mode 100644 index 00000000000..d26d0131d1e --- /dev/null +++ b/packages/core/src/test/awsService/appBuilder/lambda2sam/lambda2sam.test.ts @@ -0,0 +1,272 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as sinon from 'sinon' +import assert from 'assert' +import { LambdaFunctionNode } from '../../../../lambda/explorer/lambdaFunctionNode' +import { DefaultLambdaClient } from '../../../../shared/clients/lambdaClient' +import { Template } from '../../../../shared/cloudformation/cloudformation' +import * as lambda2sam from '../../../../awsService/appBuilder/lambda2sam/lambda2sam' +import * as authUtils from '../../../../auth/utils' +import * as utils from '../../../../awsService/appBuilder/utils' + +describe('lambda2sam', function () { + let sandbox: sinon.SinonSandbox + + beforeEach(function () { + sandbox = sinon.createSandbox() + }) + + afterEach(function () { + sandbox.restore() + }) + + describe('ifSamTemplate', function () { + it('returns true when transform is a string and starts with AWS::Serverless', function () { + const template: Template = { + Transform: 'AWS::Serverless-2016-10-31', + } + assert.strictEqual(lambda2sam.ifSamTemplate(template), true) + }) + + it('returns false when transform is a string and does not start with AWS::Serverless', function () { + const template: Template = { + Transform: 'AWS::Other-Transform', + } + assert.strictEqual(lambda2sam.ifSamTemplate(template), false) + }) + + it('returns true when transform is an array and at least one starts with AWS::Serverless', function () { + const template: Template = { + Transform: ['AWS::Serverless-2016-10-31', 'AWS::Other-Transform'] as any, + } + assert.strictEqual(lambda2sam.ifSamTemplate(template), true) + }) + + it('returns false when transform is an array and none start with AWS::Serverless', function () { + const template: Template = { + Transform: ['AWS::Other-Transform-1', 'AWS::Other-Transform-2'] as any, + } + assert.strictEqual(lambda2sam.ifSamTemplate(template), false) + }) + + it('returns false when transform is not present', function () { + const template: Template = {} + assert.strictEqual(lambda2sam.ifSamTemplate(template), false) + }) + + it('returns false when transform is an unsupported type', function () { + const template: Template = { + Transform: { some: 'object' } as any, + } + assert.strictEqual(lambda2sam.ifSamTemplate(template), false) + }) + }) + + describe('extractLogicalIdFromIntrinsic', function () { + it('extracts logical ID from Ref intrinsic', function () { + const value = { Ref: 'MyResource' } + assert.strictEqual(lambda2sam.extractLogicalIdFromIntrinsic(value), 'MyResource') + }) + + it('extracts logical ID from GetAtt intrinsic with Arn attribute', function () { + const value = { 'Fn::GetAtt': ['MyResource', 'Arn'] } + assert.strictEqual(lambda2sam.extractLogicalIdFromIntrinsic(value), 'MyResource') + }) + + it('returns undefined for GetAtt intrinsic with non-Arn attribute', function () { + const value = { 'Fn::GetAtt': ['MyResource', 'Name'] } + assert.strictEqual(lambda2sam.extractLogicalIdFromIntrinsic(value), undefined) + }) + + it('returns undefined for non-intrinsic values', function () { + assert.strictEqual(lambda2sam.extractLogicalIdFromIntrinsic('not-an-intrinsic'), undefined) + assert.strictEqual(lambda2sam.extractLogicalIdFromIntrinsic({ NotIntrinsic: 'value' }), undefined) + assert.strictEqual(lambda2sam.extractLogicalIdFromIntrinsic(undefined), undefined) + }) + }) + + describe('callExternalApiForCfnTemplate', function () { + let lambdaClientStub: sinon.SinonStubbedInstance + let cfnClientStub: any + + beforeEach(function () { + lambdaClientStub = sandbox.createStubInstance(DefaultLambdaClient) + // Stub at prototype level to avoid TypeScript errors + sandbox + .stub(DefaultLambdaClient.prototype, 'getFunction') + .callsFake((name) => lambdaClientStub.getFunction(name)) + + // Mock CloudFormation client for the new external API calls - now returns Promises directly + cfnClientStub = { + getGeneratedTemplate: sandbox.stub().resolves({ + Status: 'COMPLETE', + TemplateBody: JSON.stringify({ + AWSTemplateFormatVersion: '2010-09-09', + Resources: { + testFunc: { + DeletionPolicy: 'Retain', + Properties: { + Code: { + S3Bucket: 'aws-sam-cli-managed-default-samclisourcebucket-1n8tvb0jdhsd', + S3Key: '1d1c93ec17af7e2666ee20ea1a215c77', + }, + Environment: { + Variables: { + KEY: 'value', + }, + }, + FunctionName: 'myFunction', + Handler: 'index.handler', + MemorySize: 128, + PackageType: 'Zip', + Role: 'arn:aws:iam::123456789012:role/lambda-role', + Runtime: 'nodejs18.x', + Timeout: 3, + }, + Type: 'AWS::Lambda::Function', + }, + }, + }), + }), + describeGeneratedTemplate: sandbox.stub().resolves({ + Status: 'COMPLETE', + Resources: [ + { + LogicalResourceId: 'testFunc', + ResourceType: 'AWS::Lambda::Function', + ResourceIdentifier: { + FunctionName: 'myFunction', + }, + }, + ], + }), + } + sandbox.stub(utils, 'getCFNClient').resolves(cfnClientStub) + + // Mock IAM connection + const mockConnection = { + type: 'iam' as const, + id: 'test-connection', + label: 'Test Connection', + state: 'valid' as const, + getCredentials: sandbox.stub().resolves({ + accessKeyId: 'test-key', + secretAccessKey: 'test-secret', + }), + } + sandbox.stub(authUtils, 'getIAMConnection').resolves(mockConnection) + + // Mock fetch response + sandbox.stub(global, 'fetch').resolves({ + ok: true, + json: sandbox.stub().resolves({ + cloudFormationTemplateId: 'test-template-id', + }), + } as any) + }) + + it('creates a basic CloudFormation template for the Lambda function', async function () { + const lambdaNode = { + name: 'myFunction', + regionCode: 'us-east-2', + arn: 'arn:aws:lambda:us-east-2:123456789012:function:myFunction', + } as LambdaFunctionNode + + lambdaClientStub.getFunction.resolves({ + Configuration: { + FunctionName: 'myFunction', + Handler: 'index.handler', + Role: 'arn:aws:iam::123456789012:role/lambda-role', + Runtime: 'nodejs18.x', + Timeout: 3, + MemorySize: 128, + Environment: { Variables: { KEY: 'value' } }, + }, + }) + + // Create a simple mock template that matches the Template type + const mockTemplate = { + AWSTemplateFormatVersion: '2010-09-09', + Resources: { + testFunc: { + DeletionPolicy: 'Retain', + Properties: { + Code: { + S3Bucket: 'aws-sam-cli-managed-default-samclisourcebucket-1n8tvb0jdhsd', + S3Key: '1d1c93ec17af7e2666ee20ea1a215c77', + }, + Environment: { + Variables: { + KEY: 'value', + }, + }, + FunctionName: 'myFunction', + Handler: 'index.handler', + MemorySize: 128, + PackageType: 'Zip', + Role: 'arn:aws:iam::123456789012:role/lambda-role', + Runtime: 'nodejs18.x', + Timeout: 3, + }, + Type: 'AWS::Lambda::Function', + }, + }, + } + const mockList = [ + { + LogicalResourceId: 'testFunc', + ResourceIdentifier: { + FunctionName: 'myFunction', + }, + ResourceType: 'AWS::Lambda::Function', + }, + ] + + const result = await lambda2sam.callExternalApiForCfnTemplate(lambdaNode) + // Verify the result structure matches expected format + assert.strictEqual(Array.isArray(result), true) + assert.strictEqual(result.length, 2) + const [template, resourcesToImport] = result + assert.strictEqual(typeof template, 'object') + assert.strictEqual(Array.isArray(resourcesToImport), true) + assert.strictEqual(resourcesToImport.length, 1) + assert.strictEqual(resourcesToImport[0].ResourceType, 'AWS::Lambda::Function') + assert.strictEqual(resourcesToImport[0].LogicalResourceId, 'testFunc') + assert.deepStrictEqual(result, [mockTemplate, mockList]) + }) + }) + + describe('determineStackAssociation', function () { + let lambdaClientStub: sinon.SinonStubbedInstance + + beforeEach(function () { + lambdaClientStub = sandbox.createStubInstance(DefaultLambdaClient) + sandbox + .stub(DefaultLambdaClient.prototype, 'getFunction') + .callsFake((name) => lambdaClientStub.getFunction(name)) + }) + + it('returns undefined when Lambda has no tags', async function () { + const lambdaNode = { + name: 'myFunction', + regionCode: 'us-west-2', + } as LambdaFunctionNode + + lambdaClientStub.getFunction.resolves({}) + + // Skip CloudFormation mocking for now + // This is difficult to mock correctly without errors and would be better tested with integration tests + + const result = await lambda2sam.determineStackAssociation(lambdaNode) + + assert.strictEqual(result, undefined) + assert.strictEqual(lambdaClientStub.getFunction.calledOnceWith(lambdaNode.name), true) + }) + + // For this function, additional testing would require complex mocking of the AWS SDK + // Consider adding more specific test cases in an integration test + }) +}) diff --git a/packages/core/src/test/awsService/appBuilder/lambda2sam/lambda2samCoreLogic.test.ts b/packages/core/src/test/awsService/appBuilder/lambda2sam/lambda2samCoreLogic.test.ts new file mode 100644 index 00000000000..552d0104b7e --- /dev/null +++ b/packages/core/src/test/awsService/appBuilder/lambda2sam/lambda2samCoreLogic.test.ts @@ -0,0 +1,784 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as sinon from 'sinon' +import assert from 'assert' +import * as vscode from 'vscode' +import * as lambda2sam from '../../../../awsService/appBuilder/lambda2sam/lambda2sam' +import * as cloudFormation from '../../../../shared/cloudformation/cloudformation' +import * as utils from '../../../../awsService/appBuilder/utils' +import * as walkthrough from '../../../../awsService/appBuilder/walkthrough' +import * as authUtils from '../../../../auth/utils' +import { getTestWindow } from '../../../shared/vscode/window' +import { fs } from '../../../../shared' +import { DefaultLambdaClient } from '../../../../shared/clients/lambdaClient' +import { LambdaFunctionNode } from '../../../../lambda/explorer/lambdaFunctionNode' +import { ToolkitError } from '../../../../shared/errors' +import os from 'os' +import path from 'path' +import { LAMBDA_FUNCTION_TYPE } from '../../../../shared/cloudformation/cloudformation' +import { ResourcesToImport } from 'aws-sdk/clients/cloudformation' + +describe('lambda2samCoreLogic', function () { + let sandbox: sinon.SinonSandbox + let tempDir: string + let lambdaClientStub: sinon.SinonStubbedInstance + let cfnClientStub: any + let downloadUnzipStub: sinon.SinonStub + + beforeEach(async function () { + sandbox = sinon.createSandbox() + tempDir = path.join(os.tmpdir(), `aws-toolkit-test-${Date.now()}`) + + // Create temp directory for tests - actually create it, don't stub + if (!(await fs.exists(vscode.Uri.file(tempDir)))) { + await fs.mkdir(vscode.Uri.file(tempDir)) + } + + // Create Lambda client stub with necessary properties + lambdaClientStub = sandbox.createStubInstance(DefaultLambdaClient) + Object.defineProperty(lambdaClientStub, 'defaultTimeoutInMs', { + value: 5 * 60 * 1000, // 5 minutes + configurable: true, + }) + Object.defineProperty(lambdaClientStub, 'createSdkClient', { + value: () => Promise.resolve({}), + configurable: true, + }) + + sandbox.stub(utils, 'getLambdaClient').returns(lambdaClientStub as any) + + // Mock CloudFormation client - now returns Promises directly (no .promise() method) + cfnClientStub = { + describeStackResource: sandbox.stub().resolves({ + StackResourceDetail: { + PhysicalResourceId: 'test-physical-id', + }, + }), + describeStackResources: sandbox.stub().resolves({ + StackResources: [ + { LogicalResourceId: 'testResource', PhysicalResourceId: 'test-physical-id' }, + { LogicalResourceId: 'prefixTestResource', PhysicalResourceId: 'prefix-test-physical-id' }, + ], + }), + describeStacks: sandbox.stub().resolves({ + Stacks: [ + { + StackId: 'stack-id', + StackName: 'test-stack', + StackStatus: 'CREATE_COMPLETE', + }, + ], + }), + getTemplate: sandbox.stub().resolves({ + TemplateBody: '{"Resources": {"TestFunc": {"Type": "AWS::Lambda::Function"}}}', + }), + getGeneratedTemplate: sandbox.stub().resolves({ + Status: 'COMPLETE', + TemplateBody: + '{"Resources": {"TestFunc": {"Type": "AWS::Lambda::Function", "Properties": {"FunctionName": "test-function"}}}}', + }), + describeGeneratedTemplate: sandbox.stub().resolves({ + Status: 'COMPLETE', + Resources: [ + { + LogicalResourceId: 'TestFunc', + ResourceType: 'AWS::Lambda::Function', + ResourceIdentifier: { + FunctionName: 'arn:aws:lambda:us-east-2:123456789012:function:test-function', + }, + }, + ], + }), + createChangeSet: sandbox.stub().resolves({ Id: 'change-set-id' }), + waitFor: sandbox.stub().resolves(), + executeChangeSet: sandbox.stub().resolves(), + describeChangeSet: sandbox.stub().resolves({ + StatusReason: 'Test reason', + }), + } + sandbox.stub(utils, 'getCFNClient').resolves(cfnClientStub) + + // Setup test window to return appropriate values + getTestWindow().onDidShowMessage((msg) => { + if (msg.message.includes('Enter Stack Name')) { + msg.selectItem('test-stack') + } + }) + + getTestWindow().onDidShowDialog((dialog) => { + dialog.selectItem(vscode.Uri.file(tempDir)) + }) + + // Stub downloadUnzip function + downloadUnzipStub = sandbox.stub(utils, 'downloadUnzip').callsFake(async (url, outputPath) => { + // Create a mock file structure for testing purposes + if (!(await fs.exists(outputPath))) { + await fs.mkdir(outputPath) + } + + await fs.writeFile( + vscode.Uri.joinPath(outputPath, 'index.js'), + 'exports.handler = async (event) => { return "Hello World" };' + ) + await fs.writeFile( + vscode.Uri.joinPath(outputPath, 'package.json'), + JSON.stringify( + { + name: 'test-lambda', + version: '1.0.0', + description: 'Test Lambda function', + }, + undefined, + 2 + ) + ) + }) + + // Stub workspace functions + sandbox.stub(vscode.workspace, 'openTextDocument').resolves({} as any) + sandbox.stub(vscode.window, 'showTextDocument').resolves() + }) + + afterEach(async function () { + sandbox.restore() + + // Clean up the temp directory + if (await fs.exists(vscode.Uri.file(tempDir))) { + await fs.delete(vscode.Uri.file(tempDir), { recursive: true, force: true }) + } + }) + + describe('processLambdaUrlResources', function () { + it('converts Lambda URL resources to FunctionUrlConfig', async function () { + // Setup resources with Lambda URL - using 'as any' to bypass strict typing for tests + const resources: cloudFormation.TemplateResources = { + TestFunc: { + Type: cloudFormation.SERVERLESS_FUNCTION_TYPE, + Properties: { + FunctionName: 'test-function', + PackageType: 'Zip', + }, + }, + TestFuncUrl: { + Type: cloudFormation.LAMBDA_URL_TYPE, + Properties: { + TargetFunctionArn: { Ref: 'TestFunc' }, + AuthType: 'NONE', + }, + }, + } as any + + // Call the function + await lambda2sam.processLambdaUrlResources(resources) + + // Verify URL resource is removed + assert.strictEqual(resources['TestFuncUrl'], undefined) + + // Verify FunctionUrlConfig added to function resource using non-null assertion + assert.deepStrictEqual(resources['TestFunc']!.Properties!.FunctionUrlConfig, { + AuthType: 'NONE', + Cors: undefined, + InvokeMode: undefined, + }) + }) + + it('skips URL resources with Qualifier property', async function () { + // Setup resources with Lambda URL including Qualifier - using 'as any' to bypass strict typing for tests + const resources: cloudFormation.TemplateResources = { + TestFunc: { + Type: cloudFormation.SERVERLESS_FUNCTION_TYPE, + Properties: { + FunctionName: 'test-function', + PackageType: 'Zip', + }, + }, + TestFuncUrl: { + Type: cloudFormation.LAMBDA_URL_TYPE, + Properties: { + TargetFunctionArn: { Ref: 'TestFunc' }, + AuthType: 'NONE', + Qualifier: 'prod', + }, + }, + } as any + + // Call the function + await lambda2sam.processLambdaUrlResources(resources) + + // Verify URL resource is still there (not transformed) + assert.notStrictEqual(resources['TestFuncUrl'], undefined) + + // Verify function resource doesn't have FunctionUrlConfig using non-null assertion + assert.strictEqual(resources['TestFunc']!.Properties!.FunctionUrlConfig, undefined) + }) + }) + + describe('processLambdaResources', function () { + it('transforms AWS::Lambda::Function to AWS::Serverless::Function', async function () { + // Setup resources with Lambda function - using 'as any' to bypass strict typing for tests + const resources: cloudFormation.TemplateResources = { + TestFunc: { + Type: cloudFormation.LAMBDA_FUNCTION_TYPE, + Properties: { + FunctionName: 'test-function', + Handler: 'index.handler', + Runtime: 'nodejs18.x', + Code: { + S3Bucket: 'test-bucket', + S3Key: 'test-key', + }, + Tags: [ + { Key: 'test-key', Value: 'test-value' }, + { Key: 'lambda:createdBy', Value: 'test' }, + ], + TracingConfig: { + Mode: 'Active', + }, + PackageType: 'Zip', + }, + }, + } as any + + const stackInfo = { + stackId: 'stack-id', + stackName: 'test-stack', + isSamTemplate: false, + template: {}, + } + + const projectDir = vscode.Uri.file(tempDir) + + // Add necessary stub for getFunction + lambdaClientStub.getFunction.resolves({ + Code: { Location: 'https://lambda-function-code.zip' }, + }) + + // Call the function + await lambda2sam.processLambdaResources(resources, projectDir, stackInfo, 'us-west-2') + + // Verify function type was transformed using non-null assertions + assert.strictEqual(resources['TestFunc']!.Type, cloudFormation.SERVERLESS_FUNCTION_TYPE) + + // Verify properties were transformed correctly using non-null assertions + assert.strictEqual(resources['TestFunc']!.Properties!.Code, undefined) + assert.strictEqual(resources['TestFunc']!.Properties!.CodeUri, 'TestFunc') + assert.strictEqual(resources['TestFunc']!.Properties!.Tracing, 'Active') + assert.strictEqual(resources['TestFunc']!.Properties!.TracingConfig, undefined) + assert.deepStrictEqual(resources['TestFunc']!.Properties!.Tags, { + 'test-key': 'test-value', + }) + + // Verify downloadLambdaFunctionCode was called + assert.strictEqual(downloadUnzipStub.calledOnce, true) + }) + + it('updates CodeUri for AWS::Serverless::Function', async function () { + // Setup resources with Serverless function - using 'as any' to bypass strict typing for tests + const resources: cloudFormation.TemplateResources = { + TestFunc: { + Type: cloudFormation.SERVERLESS_FUNCTION_TYPE, + Properties: { + FunctionName: 'test-function', + Handler: 'index.handler', + Runtime: 'nodejs18.x', + CodeUri: 's3://test-bucket/test-key', + PackageType: 'Zip', + }, + }, + } as any + + const stackInfo = { + stackId: 'stack-id', + stackName: 'test-stack', + isSamTemplate: false, + template: {}, + } + + const projectDir = vscode.Uri.file(tempDir) + + // Add necessary stub for getFunction + lambdaClientStub.getFunction.resolves({ + Code: { Location: 'https://lambda-function-code.zip' }, + }) + + // Call the function + await lambda2sam.processLambdaResources(resources, projectDir, stackInfo, 'us-west-2') + + // Verify CodeUri was updated using non-null assertions + assert.strictEqual(resources['TestFunc']!.Properties!.CodeUri, 'TestFunc') + + // Verify downloadLambdaFunctionCode was called + assert.strictEqual(downloadUnzipStub.calledOnce, true) + }) + }) + + describe('processLambdaLayerResources', function () { + it('transforms AWS::Lambda::LayerVersion to AWS::Serverless::LayerVersion', async function () { + // Setup resources with Lambda layer - using 'as any' to bypass strict typing for tests + const resources: cloudFormation.TemplateResources = { + TestLayer: { + Type: cloudFormation.LAMBDA_LAYER_TYPE, + Properties: { + LayerName: 'test-layer', + Content: { + S3Bucket: 'test-bucket', + S3Key: 'test-key', + }, + CompatibleRuntimes: ['nodejs18.x'], + }, + }, + } as any + + const stackInfo = { + stackId: 'stack-id', + stackName: 'test-stack', + isSamTemplate: false, + template: {}, + } + + const projectDir = vscode.Uri.file(tempDir) + + // Setup layer version stub + cfnClientStub.describeStackResource.resolves({ + StackResourceDetail: { + PhysicalResourceId: 'arn:aws:lambda:us-west-2:123456789012:layer:my-layer:1', + }, + }) + + lambdaClientStub.getLayerVersion.resolves({ + Content: { Location: 'https://lambda-layer-code.zip' }, + }) + + // Call the function + await lambda2sam.processLambdaLayerResources(resources, projectDir, stackInfo, 'us-west-2') + + // Verify layer type was transformed using non-null assertions + assert.strictEqual(resources['TestLayer']!.Type, cloudFormation.SERVERLESS_LAYER_TYPE) + + // Verify properties were transformed correctly using non-null assertions + assert.strictEqual(resources['TestLayer']!.Properties!.Content, undefined) + assert.strictEqual(resources['TestLayer']!.Properties!.ContentUri, 'TestLayer') + assert.deepStrictEqual(resources['TestLayer']!.Properties!.CompatibleRuntimes, ['nodejs18.x']) + + // Verify downloadLayerVersionResrouceByName was called (through downloadUnzip) + assert.strictEqual(downloadUnzipStub.calledOnce, true) + }) + + it('preserves AWS::Serverless::LayerVersion properties', async function () { + // Setup resources with Serverless layer - using 'as any' to bypass strict typing for tests + const resources: cloudFormation.TemplateResources = { + TestLayer: { + Type: cloudFormation.SERVERLESS_LAYER_TYPE, + Properties: { + LayerName: 'test-layer', + ContentUri: 's3://test-bucket/test-key', + CompatibleRuntimes: ['nodejs18.x'], + }, + }, + } as any + + const stackInfo = { + stackId: 'stack-id', + stackName: 'test-stack', + isSamTemplate: false, + template: {}, + } + + const projectDir = vscode.Uri.file(tempDir) + + // Setup layer version stub + cfnClientStub.describeStackResource.resolves({ + StackResourceDetail: { + PhysicalResourceId: 'arn:aws:lambda:us-west-2:123456789012:layer:my-layer:1', + }, + }) + + lambdaClientStub.getLayerVersion.resolves({ + Content: { Location: 'https://lambda-layer-code.zip' }, + }) + + // Call the function + await lambda2sam.processLambdaLayerResources(resources, projectDir, stackInfo, 'us-west-2') + + // Verify layer type is still serverless using non-null assertions + assert.strictEqual(resources['TestLayer']!.Type, cloudFormation.SERVERLESS_LAYER_TYPE) + + // Verify ContentUri was updated using non-null assertions + assert.strictEqual(resources['TestLayer']!.Properties!.ContentUri, 'TestLayer') + + // Verify downloadLayerVersionResrouceByName was called (through downloadUnzip) + assert.strictEqual(downloadUnzipStub.calledOnce, true) + }) + }) + + describe('deployCfnTemplate', function () { + it('deploys a CloudFormation template and returns stack info', async function () { + // Setup CloudFormation template - using 'as any' to bypass strict typing for tests + const template: cloudFormation.Template = { + AWSTemplateFormatVersion: '2010-09-09', + Resources: { + TestFunc: { + Type: cloudFormation.LAMBDA_FUNCTION_TYPE, + Properties: { + FunctionName: 'test-function', + PackageType: 'Zip', + }, + }, + }, + } as any + + // Setup Lambda node + const lambdaNode = { + name: 'test-function', + regionCode: 'us-west-2', + } as LambdaFunctionNode + + const resourceToImport: ResourcesToImport = [ + { + ResourceType: LAMBDA_FUNCTION_TYPE, + LogicalResourceId: 'TestFunc', + ResourceIdentifier: { + FunctionName: lambdaNode.name, + }, + }, + ] + + // Call the function + const result = await lambda2sam.deployCfnTemplate( + template, + resourceToImport, + 'test-stack', + lambdaNode.regionCode + ) + + // Verify createChangeSet was called with correct parameters + assert.strictEqual(cfnClientStub.createChangeSet.called, true) + const createChangeSetArgs = cfnClientStub.createChangeSet.firstCall.args[0] + assert.strictEqual(createChangeSetArgs.StackName, 'test-stack') + assert.strictEqual(createChangeSetArgs.ChangeSetType, 'IMPORT') + + // Verify waitFor and executeChangeSet were called + assert.strictEqual(cfnClientStub.waitFor.calledWith('changeSetCreateComplete'), true) + assert.strictEqual(cfnClientStub.executeChangeSet.called, true) + + // Verify describeStacks was called to get stack ID + assert.strictEqual(cfnClientStub.describeStacks.called, true) + + // Verify result structure + assert.strictEqual(result.stackId, 'stack-id') + assert.strictEqual(result.stackName, 'test-stack') + assert.strictEqual(result.isSamTemplate, false) + assert.deepStrictEqual(result.template, template) + }) + + it('throws an error when change set creation fails', async function () { + // Setup CloudFormation template - using 'as any' to bypass strict typing for tests + const template: cloudFormation.Template = { + AWSTemplateFormatVersion: '2010-09-09', + Resources: { + TestFunc: { + Type: cloudFormation.LAMBDA_FUNCTION_TYPE, + Properties: { + FunctionName: 'test-function', + PackageType: 'Zip', + }, + }, + }, + } as any + + // Setup Lambda node + const lambdaNode = { + name: 'test-function', + regionCode: 'us-west-2', + } as LambdaFunctionNode + + // Make createChangeSet fail + cfnClientStub.createChangeSet.resolves({}) // No Id + + const resourceToImport: ResourcesToImport = [ + { + ResourceType: LAMBDA_FUNCTION_TYPE, + LogicalResourceId: 'TestFunc', + ResourceIdentifier: { + FunctionName: lambdaNode.name, + }, + }, + ] + + // Call the function and expect error + await assert.rejects( + lambda2sam.deployCfnTemplate(template, resourceToImport, 'test-stack', lambdaNode.regionCode), + (err: ToolkitError) => { + assert.strictEqual(err.message.includes('Failed to create change set'), true) + return true + } + ) + }) + }) + + describe('callExternalApiForCfnTemplate', function () { + it('extracts function name from ARN in ResourceIdentifier', async function () { + // Setup Lambda node + const lambdaNode = { + name: 'test-function', + regionCode: 'us-east-2', + arn: 'arn:aws:lambda:us-east-2:123456789012:function:test-function', + } as LambdaFunctionNode + + // Mock IAM connection + const mockConnection = { + type: 'iam' as const, + id: 'test-connection', + label: 'Test Connection', + state: 'valid' as const, + getCredentials: sandbox.stub().resolves({ + accessKeyId: 'test-key', + secretAccessKey: 'test-secret', + }), + } + sandbox.stub(authUtils, 'getIAMConnection').resolves(mockConnection) + + // Mock fetch response + const mockFetch = sandbox.stub(global, 'fetch').resolves({ + ok: true, + json: sandbox.stub().resolves({ + cloudFormationTemplateId: 'test-template-id', + }), + } as any) + + // Setup CloudFormation client to return ARN in ResourceIdentifier + cfnClientStub.describeGeneratedTemplate.resolves({ + Status: 'COMPLETE', + Resources: [ + { + LogicalResourceId: 'TestFunc', + ResourceType: 'AWS::Lambda::Function', + ResourceIdentifier: { + FunctionName: 'arn:aws:lambda:us-east-2:123456789012:function:test-function', + }, + }, + ], + }) + + // Call the function + const [_, resourcesToImport] = await lambda2sam.callExternalApiForCfnTemplate(lambdaNode) + + // Verify that the ARN was converted to just the function name + assert.strictEqual(resourcesToImport.length, 1) + assert.strictEqual(resourcesToImport[0].ResourceType, 'AWS::Lambda::Function') + assert.strictEqual(resourcesToImport[0].LogicalResourceId, 'TestFunc') + assert.strictEqual(resourcesToImport[0].ResourceIdentifier!.FunctionName, 'test-function') + + // Verify API calls were made + assert.strictEqual(mockFetch.calledOnce, true) + assert.strictEqual(cfnClientStub.getGeneratedTemplate.calledOnce, true) + assert.strictEqual(cfnClientStub.describeGeneratedTemplate.calledOnce, true) + }) + + it('preserves function name when not an ARN', async function () { + // Setup Lambda node + const lambdaNode = { + name: 'test-function', + regionCode: 'us-east-2', + arn: 'arn:aws:lambda:us-east-2:123456789012:function:test-function', + } as LambdaFunctionNode + + // Mock IAM connection + const mockConnection = { + type: 'iam' as const, + id: 'test-connection', + label: 'Test Connection', + state: 'valid' as const, + getCredentials: sandbox.stub().resolves({ + accessKeyId: 'test-key', + secretAccessKey: 'test-secret', + }), + } + sandbox.stub(authUtils, 'getIAMConnection').resolves(mockConnection) + + // Mock fetch response + sandbox.stub(global, 'fetch').resolves({ + ok: true, + json: sandbox.stub().resolves({ + cloudFormationTemplateId: 'test-template-id', + }), + } as any) + + // Setup CloudFormation client to return plain function name + cfnClientStub.describeGeneratedTemplate.resolves({ + Status: 'COMPLETE', + Resources: [ + { + LogicalResourceId: 'TestFunc', + ResourceType: 'AWS::Lambda::Function', + ResourceIdentifier: { + FunctionName: 'test-function', + }, + }, + ], + }) + + // Call the function + const [_, resourcesToImport] = await lambda2sam.callExternalApiForCfnTemplate(lambdaNode) + + // Verify that the function name was preserved + assert.strictEqual(resourcesToImport.length, 1) + assert.strictEqual(resourcesToImport[0].ResourceIdentifier!.FunctionName, 'test-function') + }) + + it('handles non-Lambda resources without modification', async function () { + // Setup Lambda node + const lambdaNode = { + name: 'test-function', + regionCode: 'us-east-2', + arn: 'arn:aws:lambda:us-east-2:123456789012:function:test-function', + } as LambdaFunctionNode + + // Mock IAM connection + const mockConnection = { + type: 'iam' as const, + id: 'test-connection', + label: 'Test Connection', + state: 'valid' as const, + getCredentials: sandbox.stub().resolves({ + accessKeyId: 'test-key', + secretAccessKey: 'test-secret', + }), + } + sandbox.stub(authUtils, 'getIAMConnection').resolves(mockConnection) + + // Mock fetch response + sandbox.stub(global, 'fetch').resolves({ + ok: true, + json: sandbox.stub().resolves({ + cloudFormationTemplateId: 'test-template-id', + }), + } as any) + + // Setup CloudFormation client to return mixed resource types + cfnClientStub.describeGeneratedTemplate.resolves({ + Status: 'COMPLETE', + Resources: [ + { + LogicalResourceId: 'TestFunc', + ResourceType: 'AWS::Lambda::Function', + ResourceIdentifier: { + FunctionName: 'arn:aws:lambda:us-east-2:123456789012:function:test-function', + }, + }, + { + LogicalResourceId: 'TestRole', + ResourceType: 'AWS::IAM::Role', + ResourceIdentifier: { + RoleName: 'test-role', + }, + }, + ], + }) + + // Call the function + const [_, resourcesToImport] = await lambda2sam.callExternalApiForCfnTemplate(lambdaNode) + + // Verify that Lambda function ARN was converted but IAM role was not + assert.strictEqual(resourcesToImport.length, 2) + + const lambdaResource = resourcesToImport.find((r) => r.ResourceType === 'AWS::Lambda::Function') + const iamResource = resourcesToImport.find((r) => r.ResourceType === 'AWS::IAM::Role') + + assert.strictEqual(lambdaResource!.ResourceIdentifier!.FunctionName, 'test-function') + assert.strictEqual(iamResource!.ResourceIdentifier!.RoleName, 'test-role') + }) + }) + + describe('lambdaToSam', function () { + it('converts a Lambda function to a SAM project', async function () { + // Setup Lambda node + const lambdaNode = { + name: 'test-function', + regionCode: 'us-west-2', + } as LambdaFunctionNode + + // Setup AWS Lambda client responses + lambdaClientStub.getFunction.resolves({ + Tags: { + 'aws:cloudformation:stack-id': 'stack-id', + 'aws:cloudformation:stack-name': 'test-stack', + }, + Configuration: { + FunctionName: 'test-function', + Handler: 'index.handler', + Runtime: 'nodejs18.x', + }, + Code: { + Location: 'https://lambda-function-code.zip', + }, + }) + + // Setup CloudFormation client responses + cfnClientStub.describeStacks.resolves({ + Stacks: [ + { + StackId: 'stack-id', + StackName: 'test-stack', + StackStatus: 'CREATE_COMPLETE', + }, + ], + }) + + cfnClientStub.getTemplate.resolves({ + TemplateBody: JSON.stringify({ + AWSTemplateFormatVersion: '2010-09-09', + Transform: 'AWS::Serverless-2016-10-31', + Resources: { + TestFunc: { + Type: 'AWS::Serverless::Function', + Properties: { + FunctionName: 'test-function', + Handler: 'index.handler', + Runtime: 'nodejs18.x', + CodeUri: 's3://test-bucket/test-key', + PackageType: 'Zip', + }, + }, + }, + }), + }) + + // Setup test window to return a project directory + getTestWindow().onDidShowDialog((dialog) => { + dialog.selectItem(vscode.Uri.file(tempDir)) + }) + // Spy on walkthrough.openProjectInWorkspace + const openProjectStub = sandbox.stub(walkthrough, 'openProjectInWorkspace') + + // Call the function + await lambda2sam.lambdaToSam(lambdaNode) + + assert.strictEqual( + await fs.exists(vscode.Uri.joinPath(vscode.Uri.file(tempDir), 'test-stack', 'template.yaml').fsPath), + true, + 'template.yaml was not written' + ) + assert.strictEqual( + await fs.exists(vscode.Uri.joinPath(vscode.Uri.file(tempDir), 'test-stack', 'README.md').fsPath), + true, + 'README.md was not written' + ) + assert.strictEqual( + await fs.exists(vscode.Uri.joinPath(vscode.Uri.file(tempDir), 'test-stack', 'samconfig.toml').fsPath), + true, + 'samconfig.toml was not written' + ) + + // Verify that project was opened in workspace + assert.strictEqual(openProjectStub.calledOnce, true) + assert.strictEqual( + openProjectStub.firstCall.args[0].fsPath, + vscode.Uri.joinPath(vscode.Uri.file(tempDir), 'test-stack').fsPath + ) + }) + }) +}) diff --git a/packages/core/src/test/awsService/appBuilder/lambda2sam/lambda2samDownload.test.ts b/packages/core/src/test/awsService/appBuilder/lambda2sam/lambda2samDownload.test.ts new file mode 100644 index 00000000000..9c4d3122918 --- /dev/null +++ b/packages/core/src/test/awsService/appBuilder/lambda2sam/lambda2samDownload.test.ts @@ -0,0 +1,312 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as sinon from 'sinon' +import assert from 'assert' +import * as vscode from 'vscode' +import * as lambda2sam from '../../../../awsService/appBuilder/lambda2sam/lambda2sam' +import * as utils from '../../../../awsService/appBuilder/utils' +import { fs } from '../../../../shared' +import { DefaultLambdaClient } from '../../../../shared/clients/lambdaClient' +import os from 'os' +import path from 'path' +import { LAMBDA_FUNCTION_TYPE, LAMBDA_LAYER_TYPE } from '../../../../shared/cloudformation/cloudformation' + +describe('lambda2samDownload', function () { + let sandbox: sinon.SinonSandbox + let tempDir: string + let lambdaClientStub: sinon.SinonStubbedInstance + let cfnClientStub: any + let downloadUnzipStub: sinon.SinonStub + + beforeEach(async function () { + sandbox = sinon.createSandbox() + tempDir = path.join(os.tmpdir(), `aws-toolkit-test-${Date.now()}`) + + // Create temp directory for tests - actually create it, don't stub + if (!(await fs.exists(vscode.Uri.file(tempDir)))) { + await fs.mkdir(vscode.Uri.file(tempDir)) + } + + // Create Lambda client stub with necessary properties + lambdaClientStub = sandbox.createStubInstance(DefaultLambdaClient) + // Add required properties that aren't stubbed automatically + Object.defineProperty(lambdaClientStub, 'defaultTimeoutInMs', { + value: 5 * 60 * 1000, // 5 minutes + configurable: true, + }) + Object.defineProperty(lambdaClientStub, 'createSdkClient', { + value: () => Promise.resolve({}), + configurable: true, + }) + + sandbox.stub(utils, 'getLambdaClient').returns(lambdaClientStub as any) + + // Stub CloudFormation client - now returns Promises directly (no .promise() method) + cfnClientStub = { + describeStackResource: sandbox.stub().resolves({ + StackResourceDetail: { + PhysicalResourceId: 'test-physical-id', + }, + }), + describeStackResources: sandbox.stub().resolves({ + StackResources: [ + { LogicalResourceId: 'testResource', PhysicalResourceId: 'test-physical-id' }, + { LogicalResourceId: 'prefixTestResource', PhysicalResourceId: 'prefix-test-physical-id' }, + ], + }), + } + sandbox.stub(utils, 'getCFNClient').resolves(cfnClientStub) + + // Stub downloadUnzip function to create actual files in the temp directory + downloadUnzipStub = sandbox.stub(utils, 'downloadUnzip').callsFake(async (url, outputPath) => { + // Create a mock file structure for testing purposes + + // Create the output directory if it doesn't exist + if (!(await fs.exists(outputPath))) { + await fs.mkdir(outputPath) + } + + // Create a simple file to simulate extracted content + await fs.writeFile( + vscode.Uri.joinPath(outputPath, 'index.js'), + 'exports.handler = async (event) => { return "Hello World" };' + ) + + // Create a package.json file + await fs.writeFile( + vscode.Uri.joinPath(outputPath, 'package.json'), + JSON.stringify( + { + name: 'test-lambda', + version: '1.0.0', + description: 'Test Lambda function', + }, + undefined, + 2 + ) + ) + }) + }) + + afterEach(async function () { + sandbox.restore() + + // Clean up the temp directory after each test + if (await fs.exists(vscode.Uri.file(tempDir))) { + await fs.delete(vscode.Uri.file(tempDir), { recursive: true, force: true }) + } + }) + + describe('getPhysicalIdfromCFNResourceName', function () { + it('returns the physical ID when an exact match is found', async function () { + const result = await lambda2sam.getPhysicalIdfromCFNResourceName( + 'testResource', + 'us-west-2', + 'stack-id', + LAMBDA_FUNCTION_TYPE + ) + + assert.strictEqual(cfnClientStub.describeStackResource.calledOnce, true) + assert.strictEqual(cfnClientStub.describeStackResource.firstCall.args[0].StackName, 'stack-id') + assert.strictEqual(cfnClientStub.describeStackResource.firstCall.args[0].LogicalResourceId, 'testResource') + assert.strictEqual(result, 'test-physical-id') + }) + + it('returns a prefix match when exact match fails', async function () { + // Make exact match fail + cfnClientStub.describeStackResource.rejects(new Error('Resource not found')) + + const result = await lambda2sam.getPhysicalIdfromCFNResourceName( + 'prefix', + 'us-west-2', + 'stack-id', + LAMBDA_LAYER_TYPE + ) + + assert.strictEqual(cfnClientStub.describeStackResources.calledOnce, true) + assert.strictEqual(cfnClientStub.describeStackResources.firstCall.args[0].StackName, 'stack-id') + assert.strictEqual(result, 'prefix-test-physical-id') + }) + + it('returns undefined when no match is found', async function () { + // Make exact match fail + cfnClientStub.describeStackResource.rejects(new Error('Resource not found')) + + // Return empty resources + cfnClientStub.describeStackResources.resolves({ StackResources: [] }) + + const result = await lambda2sam.getPhysicalIdfromCFNResourceName( + 'nonexistent', + 'us-west-2', + 'stack-id', + LAMBDA_LAYER_TYPE + ) + assert.strictEqual(result, undefined) + }) + }) + + describe('downloadLambdaFunctionCode', function () { + it('uses physical ID from CloudFormation when not provided', async function () { + const targetDir = vscode.Uri.file(tempDir) + const resourceName = 'testResource' + const stackInfo = { stackId: 'stack-id', stackName: 'test-stack', isSamTemplate: false, template: {} } + + lambdaClientStub.getFunction.resolves({ + Code: { Location: 'https://lambda-function-code.zip' }, + }) + + await lambda2sam.downloadLambdaFunctionCode(resourceName, stackInfo, targetDir, 'us-west-2') + + // Verify CloudFormation was called to get physical ID + assert.strictEqual(cfnClientStub.describeStackResource.calledOnce, true) + + // Verify Lambda client was called with correct physical ID + assert.strictEqual(lambdaClientStub.getFunction.calledOnce, true) + assert.strictEqual(lambdaClientStub.getFunction.firstCall.args[0], 'test-physical-id') + + // Verify downloadUnzip was called with correct parameters + assert.strictEqual(downloadUnzipStub.calledOnce, true) + assert.strictEqual(downloadUnzipStub.firstCall.args[0], 'https://lambda-function-code.zip') + assert.strictEqual( + downloadUnzipStub.firstCall.args[1].fsPath, + vscode.Uri.joinPath(targetDir, resourceName).fsPath + ) + + // Verify files were actually created in the temp directory + const outputDir = vscode.Uri.joinPath(targetDir, resourceName) + assert.strictEqual(await fs.exists(outputDir), true) + assert.strictEqual(await fs.exists(vscode.Uri.joinPath(outputDir, 'index.js')), true) + assert.strictEqual(await fs.exists(vscode.Uri.joinPath(outputDir, 'package.json')), true) + }) + + it('uses provided physical ID when available', async function () { + const targetDir = vscode.Uri.file(tempDir) + const resourceName = 'testResource' + const physicalResourceId = 'provided-physical-id' + const stackInfo = { stackId: 'stack-id', stackName: 'test-stack', isSamTemplate: false, template: {} } + + lambdaClientStub.getFunction.resolves({ + Code: { Location: 'https://lambda-function-code.zip' }, + }) + + await lambda2sam.downloadLambdaFunctionCode( + resourceName, + stackInfo, + targetDir, + 'us-west-2', + physicalResourceId + ) + + // Verify CloudFormation was NOT called to get physical ID + assert.strictEqual(cfnClientStub.describeStackResource.called, false) + + // Verify Lambda client was called with provided physical ID + assert.strictEqual(lambdaClientStub.getFunction.calledOnce, true) + assert.strictEqual(lambdaClientStub.getFunction.firstCall.args[0], physicalResourceId) + + // Verify files were actually created in the temp directory + const outputDir = vscode.Uri.joinPath(targetDir, resourceName) + assert.strictEqual(await fs.exists(outputDir), true) + assert.strictEqual(await fs.exists(vscode.Uri.joinPath(outputDir, 'index.js')), true) + assert.strictEqual(await fs.exists(vscode.Uri.joinPath(outputDir, 'package.json')), true) + }) + + it('throws an error when code location is missing', async function () { + const targetDir = vscode.Uri.file(tempDir) + const resourceName = 'testResource' + const stackInfo = { stackId: 'stack-id', stackName: 'test-stack', isSamTemplate: false, template: {} } + + lambdaClientStub.getFunction.resolves({ + Code: {}, // No Location + }) + + await assert.rejects( + lambda2sam.downloadLambdaFunctionCode(resourceName, stackInfo, targetDir, 'us-west-2'), + /Could not determine code location/ + ) + }) + }) + + describe('downloadLayerVersionResourceByName', function () { + it('extracts layer name and version from ARN and downloads content', async function () { + const targetDir = vscode.Uri.file(tempDir) + const resourceName = 'testLayer' + const stackInfo = { stackId: 'stack-id', stackName: 'test-stack', isSamTemplate: false, template: {} } + + // Return an ARN for a layer version + cfnClientStub.describeStackResource.resolves({ + StackResourceDetail: { + PhysicalResourceId: 'arn:aws:lambda:us-west-2:123456789012:layer:my-layer:1', + }, + }) + + lambdaClientStub.getLayerVersion.resolves({ + Content: { Location: 'https://lambda-layer-code.zip' }, + }) + + await lambda2sam.downloadLayerVersionResourceByName(resourceName, stackInfo, targetDir, 'us-west-2') + + // Verify Lambda client was called with correct layer name and version + assert.strictEqual(lambdaClientStub.getLayerVersion.calledOnce, true) + assert.strictEqual(lambdaClientStub.getLayerVersion.firstCall.args[0], 'my-layer') + assert.strictEqual(lambdaClientStub.getLayerVersion.firstCall.args[1], 1) + + // Verify downloadUnzip was called with correct parameters + assert.strictEqual(downloadUnzipStub.calledOnce, true) + assert.strictEqual(downloadUnzipStub.firstCall.args[0], 'https://lambda-layer-code.zip') + assert.strictEqual( + downloadUnzipStub.firstCall.args[1].fsPath, + vscode.Uri.joinPath(targetDir, resourceName).fsPath + ) + + // Verify files were actually created in the temp directory + const outputDir = vscode.Uri.joinPath(targetDir, resourceName) + assert.strictEqual(await fs.exists(outputDir), true) + assert.strictEqual(await fs.exists(vscode.Uri.joinPath(outputDir, 'index.js')), true) + assert.strictEqual(await fs.exists(vscode.Uri.joinPath(outputDir, 'package.json')), true) + }) + + it('throws an error when ARN format is invalid', async function () { + const targetDir = vscode.Uri.file(tempDir) + const resourceName = 'testLayer' + const stackInfo = { stackId: 'stack-id', stackName: 'test-stack', isSamTemplate: false, template: {} } + + // Return an invalid ARN + cfnClientStub.describeStackResource.resolves({ + StackResourceDetail: { + PhysicalResourceId: 'arn:aws:lambda:us-west-2:123456789012:layer:my-layer', // Missing version + }, + }) + + await assert.rejects( + lambda2sam.downloadLayerVersionResourceByName(resourceName, stackInfo, targetDir, 'us-west-2'), + /Invalid layer ARN format/ + ) + }) + + it('throws an error when layer content location is missing', async function () { + const targetDir = vscode.Uri.file(tempDir) + const resourceName = 'testLayer' + const stackInfo = { stackId: 'stack-id', stackName: 'test-stack', isSamTemplate: false, template: {} } + + // Return an ARN for a layer version + cfnClientStub.describeStackResource.resolves({ + StackResourceDetail: { + PhysicalResourceId: 'arn:aws:lambda:us-west-2:123456789012:layer:my-layer:1', + }, + }) + + lambdaClientStub.getLayerVersion.resolves({ + Content: {}, // No Location + }) + + await assert.rejects( + lambda2sam.downloadLayerVersionResourceByName(resourceName, stackInfo, targetDir, 'us-west-2'), + /Could not determine code location for layer/ + ) + }) + }) +}) diff --git a/packages/core/src/test/awsService/appBuilder/serverlessLand/main.test.ts b/packages/core/src/test/awsService/appBuilder/serverlessLand/main.test.ts index 05caee605ec..5ed49638dc8 100644 --- a/packages/core/src/test/awsService/appBuilder/serverlessLand/main.test.ts +++ b/packages/core/src/test/awsService/appBuilder/serverlessLand/main.test.ts @@ -23,6 +23,7 @@ import { fs } from '../../../../shared/fs/fs' import * as downloadPatterns from '../../../../shared/utilities/downloadPatterns' import { ExtContext } from '../../../../shared/extensions' import { workspaceUtils } from '../../../../shared' +import * as messages from '../../../../shared/utilities/messages' import * as downloadPattern from '../../../../shared/utilities/downloadPatterns' import * as wizardModule from '../../../../awsService/appBuilder/serverlessLand/wizard' @@ -80,63 +81,75 @@ describe('createNewServerlessLandProject', () => { }) }) +function assertDownloadPatternCall(getPatternStub: sinon.SinonStub, mockConfig: any) { + const mockAssetName = 'test-project-sam-python.zip' + const serverlessLandOwner = 'aws-samples' + const serverlessLandRepo = 'serverless-patterns' + const mockLocation = vscode.Uri.joinPath(mockConfig.location, mockConfig.name) + + assert(getPatternStub.calledOnce) + assert(getPatternStub.firstCall.args[0] === serverlessLandOwner) + assert(getPatternStub.firstCall.args[1] === serverlessLandRepo) + assert(getPatternStub.firstCall.args[2] === mockAssetName) + assert(getPatternStub.firstCall.args[3].toString() === mockLocation.toString()) + assert(getPatternStub.firstCall.args[4] === true) +} + describe('downloadPatternCode', () => { let sandbox: sinon.SinonSandbox let getPatternStub: sinon.SinonStub + let mockConfig: any beforeEach(function () { sandbox = sinon.createSandbox() getPatternStub = sandbox.stub(downloadPatterns, 'getPattern') + mockConfig = { + name: 'test-project', + location: vscode.Uri.file('/test'), + pattern: 'test-project-sam-python', + runtime: 'python', + iac: 'sam', + assetName: 'test-project-sam-python', + } }) afterEach(function () { sandbox.restore() + getPatternStub.restore() }) - const mockConfig = { - name: 'test-project', - location: vscode.Uri.file('/test'), - pattern: 'test-project-sam-python', - runtime: 'python', - iac: 'sam', - assetName: 'test-project-sam-python', - } it('successfully downloads pattern code', async () => { - const mockAssetName = 'test-project-sam-python.zip' - const serverlessLandOwner = 'aws-samples' - const serverlessLandRepo = 'serverless-patterns' - const mockLocation = vscode.Uri.joinPath(mockConfig.location, mockConfig.name) - - await downloadPatternCode(mockConfig, 'test-project-sam-python') - assert(getPatternStub.calledOnce) - assert(getPatternStub.firstCall.args[0] === serverlessLandOwner) - assert(getPatternStub.firstCall.args[1] === serverlessLandRepo) - assert(getPatternStub.firstCall.args[2] === mockAssetName) - assert(getPatternStub.firstCall.args[3].toString() === mockLocation.toString()) - assert(getPatternStub.firstCall.args[4] === true) - }) - it('handles download failure', async () => { - const mockAssetName = 'test-project-sam-python.zip' - const error = new Error('Download failed') - getPatternStub.rejects(error) - try { - await downloadPatternCode(mockConfig, mockAssetName) - assert.fail('Expected an error to be thrown') - } catch (err: any) { - assert.strictEqual(err.message, 'Failed to download pattern: Error: Download failed') - } + sandbox.stub(messages, 'handleOverwriteConflict').resolves(true) + + await downloadPatternCode(mockConfig, mockConfig.assetName) + assertDownloadPatternCall(getPatternStub, mockConfig) + }) + it('downloads pattern when directory exists and user confirms overwrite', async function () { + sandbox.stub(messages, 'handleOverwriteConflict').resolves(true) + + await downloadPatternCode(mockConfig, mockConfig.assetName) + assertDownloadPatternCall(getPatternStub, mockConfig) + }) + it('throws error when directory exists and user cancels overwrite', async function () { + const handleOverwriteStub = sandbox.stub(messages, 'handleOverwriteConflict') + handleOverwriteStub.rejects(new Error('Folder already exists: test-project')) + + await assert.rejects( + () => downloadPatternCode(mockConfig, mockConfig.assetName), + /Folder already exists: test-project/ + ) }) }) describe('openReadmeFile', () => { - let sandbox: sinon.SinonSandbox + let testsandbox: sinon.SinonSandbox let spyExecuteCommand: sinon.SinonSpy beforeEach(function () { - sandbox = sinon.createSandbox() - spyExecuteCommand = sandbox.spy(vscode.commands, 'executeCommand') + testsandbox = sinon.createSandbox() + spyExecuteCommand = testsandbox.spy(vscode.commands, 'executeCommand') }) afterEach(function () { - sandbox.restore() + testsandbox.restore() }) const mockConfig = { name: 'test-project', @@ -148,35 +161,35 @@ describe('openReadmeFile', () => { } it('successfully opens README file', async () => { const mockReadmeUri = vscode.Uri.file('/test/README.md') - sandbox.stub(main, 'getProjectUri').resolves(mockReadmeUri) + testsandbox.stub(main, 'getProjectUri').resolves(mockReadmeUri) - sandbox.stub(fs, 'exists').resolves(true) + testsandbox.stub(fs, 'exists').resolves(true) // When await openReadmeFile(mockConfig) // Then - sandbox.assert.calledWith(spyExecuteCommand, 'workbench.action.focusFirstEditorGroup') - sandbox.assert.calledWith(spyExecuteCommand, 'markdown.showPreview') + testsandbox.assert.calledWith(spyExecuteCommand, 'workbench.action.focusFirstEditorGroup') + testsandbox.assert.calledWith(spyExecuteCommand, 'markdown.showPreview') }) it('handles missing README file', async () => { const mockReadmeUri = vscode.Uri.file('/test/file.md') - sandbox.stub(main, 'getProjectUri').resolves(mockReadmeUri) + testsandbox.stub(main, 'getProjectUri').resolves(mockReadmeUri) - sandbox.stub(fs, 'exists').resolves(false) + testsandbox.stub(fs, 'exists').resolves(false) // When await openReadmeFile(mockConfig) // Then - sandbox.assert.neverCalledWith(spyExecuteCommand, 'markdown.showPreview') + testsandbox.assert.neverCalledWith(spyExecuteCommand, 'markdown.showPreview') assert.ok(true, 'Function should return without throwing error when README is not found') }) it('handles error with opening README file', async () => { const mockReadmeUri = vscode.Uri.file('/test/README.md') - sandbox.stub(main, 'getProjectUri').resolves(mockReadmeUri) + testsandbox.stub(main, 'getProjectUri').resolves(mockReadmeUri) - sandbox.stub(fs, 'exists').rejects(new Error('File system error')) + testsandbox.stub(fs, 'exists').rejects(new Error('File system error')) // When await assert.rejects(() => openReadmeFile(mockConfig), { @@ -184,7 +197,7 @@ describe('openReadmeFile', () => { message: 'Error processing README file', }) // Then - sandbox.assert.neverCalledWith(spyExecuteCommand, 'markdown.showPreview') + testsandbox.assert.neverCalledWith(spyExecuteCommand, 'markdown.showPreview') }) }) diff --git a/packages/core/src/test/awsService/appBuilder/utils.test.ts b/packages/core/src/test/awsService/appBuilder/utils.test.ts index d74cfc77802..eaaa69254d7 100644 --- a/packages/core/src/test/awsService/appBuilder/utils.test.ts +++ b/packages/core/src/test/awsService/appBuilder/utils.test.ts @@ -12,9 +12,20 @@ import fs from '../../../shared/fs/fs' import { ResourceNode } from '../../../awsService/appBuilder/explorer/nodes/resourceNode' import path from 'path' import { SERVERLESS_FUNCTION_TYPE } from '../../../shared/cloudformation/cloudformation' -import { runOpenHandler, runOpenTemplate } from '../../../awsService/appBuilder/utils' +import { + runOpenHandler, + runOpenTemplate, + isPermissionError, + EnhancedLambdaClient, + EnhancedCloudFormationClient, + getLambdaClient, + getCFNClient, +} from '../../../awsService/appBuilder/utils' import { TreeNode } from '../../../shared/treeview/resourceTreeDataProvider' import { assertTextEditorContains } from '../../testUtil' +import { DefaultLambdaClient } from '../../../shared/clients/lambdaClient' +import { ToolkitError } from '../../../shared/errors' +import globals from '../../../shared/extensionGlobals' interface TestScenario { runtime: string @@ -303,4 +314,553 @@ describe('AppBuilder Utils', function () { assert(showCommand.notCalled) }) }) + + describe('Permission Error Handling', function () { + let sandbox: sinon.SinonSandbox + + beforeEach(function () { + sandbox = sinon.createSandbox() + }) + + afterEach(function () { + sandbox.restore() + }) + + describe('isPermissionError', function () { + it('should return true for AccessDeniedException', function () { + const error = Object.assign(new Error('Access denied'), { + code: 'AccessDeniedException', + time: new Date(), + statusCode: 403, + }) + assert.strictEqual(isPermissionError(error), true) + }) + + it('should return true for UnauthorizedOperation', function () { + const error = Object.assign(new Error('Unauthorized'), { + code: 'UnauthorizedOperation', + time: new Date(), + statusCode: 403, + }) + assert.strictEqual(isPermissionError(error), true) + }) + + it('should return true for Forbidden', function () { + const error = Object.assign(new Error('Forbidden'), { + code: 'Forbidden', + time: new Date(), + statusCode: 403, + }) + assert.strictEqual(isPermissionError(error), true) + }) + + it('should return true for AccessDenied', function () { + const error = Object.assign(new Error('Access denied'), { + code: 'AccessDenied', + time: new Date(), + statusCode: 403, + }) + assert.strictEqual(isPermissionError(error), true) + }) + + it('should return true for 403 status code', function () { + const error = Object.assign(new Error('Forbidden'), { + code: 'SomeError', + statusCode: 403, + time: new Date(), + }) + assert.strictEqual(isPermissionError(error), true) + }) + + it('should return false for non-permission errors', function () { + const error = Object.assign(new Error('Resource not found'), { + code: 'ResourceNotFoundException', + time: new Date(), + statusCode: 404, + }) + assert.strictEqual(isPermissionError(error), false) + }) + + it('should return false for non-AWS errors', function () { + const error = new Error('Regular error') + assert.strictEqual(isPermissionError(error), false) + }) + + it('should return false for undefined', function () { + assert.strictEqual(isPermissionError(undefined), false) + }) + }) + + describe('EnhancedLambdaClient', function () { + let mockLambdaClient: sinon.SinonStubbedInstance + let enhancedClient: EnhancedLambdaClient + + beforeEach(function () { + mockLambdaClient = sandbox.createStubInstance(DefaultLambdaClient) + // Add missing properties that EnhancedLambdaClient expects + Object.defineProperty(mockLambdaClient, 'defaultTimeoutInMs', { + value: 5 * 60 * 1000, + configurable: true, + }) + Object.defineProperty(mockLambdaClient, 'createSdkClient', { + value: sandbox.stub().resolves({}), + configurable: true, + }) + enhancedClient = new EnhancedLambdaClient(mockLambdaClient as any, 'us-east-1') + }) + + it('should enhance permission errors for getFunction', async function () { + const permissionError = Object.assign(new Error('Access denied'), { + code: 'AccessDeniedException', + time: new Date(), + statusCode: 403, + }) + mockLambdaClient.getFunction.rejects(permissionError) + + try { + await enhancedClient.getFunction('test-function') + assert.fail('Expected error to be thrown') + } catch (error) { + assert(error instanceof ToolkitError) + assert( + error.message.includes('Permission denied: Missing required permissions for lambda:getFunction') + ) + assert(error.message.includes('lambda:GetFunction')) + assert(error.message.includes('arn:aws:lambda:us-east-1:*:function:test-function')) + assert(error.message.includes('To fix this issue:')) + assert(error.message.includes('Documentation:')) + } + }) + + it('should pass through non-permission errors for getFunction', async function () { + const nonPermissionError = new Error('Function not found') + mockLambdaClient.getFunction.rejects(nonPermissionError) + + try { + await enhancedClient.getFunction('test-function') + assert.fail('Expected error to be thrown') + } catch (error) { + assert.strictEqual(error, nonPermissionError) + } + }) + + it('should enhance permission errors for listFunctions', async function () { + const permissionError = Object.assign(new Error('Access denied'), { + code: 'AccessDeniedException', + time: new Date(), + statusCode: 403, + }) + + // Create a mock async generator that throws the error + const mockAsyncGenerator = async function* (): AsyncIterableIterator { + throw permissionError + yield // This line will never be reached but satisfies ESLint require-yield rule + } + mockLambdaClient.listFunctions.returns(mockAsyncGenerator()) + + try { + const iterator = enhancedClient.listFunctions() + await iterator.next() + assert.fail('Expected error to be thrown') + } catch (error) { + assert(error instanceof ToolkitError) + assert( + error.message.includes( + 'Permission denied: Missing required permissions for lambda:listFunctions' + ) + ) + assert(error.message.includes('lambda:ListFunctions')) + } + }) + + it('should enhance permission errors for deleteFunction', async function () { + const permissionError = Object.assign(new Error('Access denied'), { + code: 'AccessDeniedException', + time: new Date(), + statusCode: 403, + }) + mockLambdaClient.deleteFunction.rejects(permissionError) + + try { + await enhancedClient.deleteFunction('test-function') + assert.fail('Expected error to be thrown') + } catch (error) { + assert(error instanceof ToolkitError) + assert( + error.message.includes( + 'Permission denied: Missing required permissions for lambda:deleteFunction' + ) + ) + assert(error.message.includes('lambda:DeleteFunction')) + assert(error.message.includes('arn:aws:lambda:us-east-1:*:function:test-function')) + } + }) + + it('should enhance permission errors for invoke', async function () { + const permissionError = Object.assign(new Error('Access denied'), { + code: 'AccessDeniedException', + time: new Date(), + statusCode: 403, + }) + mockLambdaClient.invoke.rejects(permissionError) + + try { + await enhancedClient.invoke('test-function', '{}') + assert.fail('Expected error to be thrown') + } catch (error) { + assert(error instanceof ToolkitError) + assert(error.message.includes('Permission denied: Missing required permissions for lambda:invoke')) + assert(error.message.includes('lambda:InvokeFunction')) + assert(error.message.includes('arn:aws:lambda:us-east-1:*:function:test-function')) + } + }) + + it('should enhance permission errors for getLayerVersion', async function () { + const permissionError = Object.assign(new Error('Access denied'), { + code: 'AccessDeniedException', + time: new Date(), + statusCode: 403, + }) + mockLambdaClient.getLayerVersion.rejects(permissionError) + + try { + await enhancedClient.getLayerVersion('test-layer', 1) + assert.fail('Expected error to be thrown') + } catch (error) { + assert(error instanceof ToolkitError) + assert( + error.message.includes( + 'Permission denied: Missing required permissions for lambda:getLayerVersion' + ) + ) + assert(error.message.includes('lambda:GetLayerVersion')) + assert(error.message.includes('arn:aws:lambda:us-east-1:*:layer:test-layer:1')) + } + }) + + it('should enhance permission errors for updateFunctionCode', async function () { + const permissionError = Object.assign(new Error('Access denied'), { + code: 'AccessDeniedException', + time: new Date(), + statusCode: 403, + }) + mockLambdaClient.updateFunctionCode.rejects(permissionError) + + try { + await enhancedClient.updateFunctionCode('test-function', new Uint8Array()) + assert.fail('Expected error to be thrown') + } catch (error) { + assert(error instanceof ToolkitError) + assert( + error.message.includes( + 'Permission denied: Missing required permissions for lambda:updateFunctionCode' + ) + ) + assert(error.message.includes('lambda:UpdateFunctionCode')) + assert(error.message.includes('arn:aws:lambda:us-east-1:*:function:test-function')) + } + }) + + it('should return successful results when no errors occur', async function () { + const mockResponse = { Configuration: { FunctionName: 'test-function' } } + mockLambdaClient.getFunction.resolves(mockResponse) + + const result = await enhancedClient.getFunction('test-function') + assert.strictEqual(result, mockResponse) + }) + }) + + describe('EnhancedCloudFormationClient', function () { + let mockCfnClient: any + let enhancedClient: EnhancedCloudFormationClient + + beforeEach(function () { + // Create a mock CloudFormation client with all required methods + mockCfnClient = { + describeStacks: sandbox.stub(), + getTemplate: sandbox.stub(), + createChangeSet: sandbox.stub(), + describeStackResource: sandbox.stub(), + describeStackResources: sandbox.stub(), + } + enhancedClient = new EnhancedCloudFormationClient(mockCfnClient, 'us-east-1') + }) + + it('should enhance permission errors for describeStacks', async function () { + const permissionError = Object.assign(new Error('Access denied'), { + code: 'AccessDeniedException', + time: new Date(), + statusCode: 403, + }) + mockCfnClient.describeStacks.returns({ + promise: sandbox.stub().rejects(permissionError), + } as any) + + try { + await enhancedClient.describeStacks({ StackName: 'test-stack' }) + assert.fail('Expected error to be thrown') + } catch (error) { + assert(error instanceof ToolkitError) + assert( + error.message.includes( + 'Permission denied: Missing required permissions for cloudformation:describeStacks' + ) + ) + assert(error.message.includes('cloudformation:DescribeStacks')) + assert(error.message.includes('arn:aws:cloudformation:us-east-1:*:stack/test-stack/*')) + assert(error.message.includes('To fix this issue:')) + assert(error.message.includes('Documentation:')) + } + }) + + it('should enhance permission errors for getTemplate', async function () { + const permissionError = Object.assign(new Error('Access denied'), { + code: 'AccessDeniedException', + time: new Date(), + statusCode: 403, + }) + mockCfnClient.getTemplate.returns({ + promise: sandbox.stub().rejects(permissionError), + } as any) + + try { + await enhancedClient.getTemplate({ StackName: 'test-stack' }) + assert.fail('Expected error to be thrown') + } catch (error) { + assert(error instanceof ToolkitError) + assert( + error.message.includes( + 'Permission denied: Missing required permissions for cloudformation:getTemplate' + ) + ) + assert(error.message.includes('cloudformation:GetTemplate')) + assert(error.message.includes('arn:aws:cloudformation:us-east-1:*:stack/test-stack/*')) + } + }) + + it('should enhance permission errors for createChangeSet', async function () { + const permissionError = Object.assign(new Error('Access denied'), { + code: 'AccessDeniedException', + time: new Date(), + statusCode: 403, + }) + mockCfnClient.createChangeSet.returns({ + promise: sandbox.stub().rejects(permissionError), + } as any) + + try { + await enhancedClient.createChangeSet({ + StackName: 'test-stack', + ChangeSetName: 'test-changeset', + TemplateBody: '{}', + }) + assert.fail('Expected error to be thrown') + } catch (error) { + assert(error instanceof ToolkitError) + assert( + error.message.includes( + 'Permission denied: Missing required permissions for cloudformation:createChangeSet' + ) + ) + assert(error.message.includes('cloudformation:CreateChangeSet')) + assert(error.message.includes('arn:aws:cloudformation:us-east-1:*:stack/test-stack/*')) + } + }) + + it('should enhance permission errors for describeStackResource', async function () { + const permissionError = Object.assign(new Error('Access denied'), { + code: 'AccessDeniedException', + time: new Date(), + statusCode: 403, + }) + mockCfnClient.describeStackResource.returns({ + promise: sandbox.stub().rejects(permissionError), + } as any) + + try { + await enhancedClient.describeStackResource({ + StackName: 'test-stack', + LogicalResourceId: 'TestResource', + }) + assert.fail('Expected error to be thrown') + } catch (error) { + assert(error instanceof ToolkitError) + assert( + error.message.includes( + 'Permission denied: Missing required permissions for cloudformation:describeStackResource' + ) + ) + assert(error.message.includes('cloudformation:DescribeStackResource')) + assert(error.message.includes('arn:aws:cloudformation:us-east-1:*:stack/test-stack/*')) + } + }) + + it('should enhance permission errors for describeStackResources', async function () { + const permissionError = Object.assign(new Error('Access denied'), { + code: 'AccessDeniedException', + time: new Date(), + statusCode: 403, + }) + mockCfnClient.describeStackResources.returns({ + promise: sandbox.stub().rejects(permissionError), + } as any) + + try { + await enhancedClient.describeStackResources({ StackName: 'test-stack' }) + assert.fail('Expected error to be thrown') + } catch (error) { + assert(error instanceof ToolkitError) + assert( + error.message.includes( + 'Permission denied: Missing required permissions for cloudformation:describeStackResources' + ) + ) + assert(error.message.includes('cloudformation:DescribeStackResources')) + assert(error.message.includes('arn:aws:cloudformation:us-east-1:*:stack/test-stack/*')) + } + }) + + it('should pass through non-permission errors', async function () { + const nonPermissionError = new Error('Stack not found') + mockCfnClient.describeStacks.returns({ + promise: sandbox.stub().rejects(nonPermissionError), + } as any) + + try { + await enhancedClient.describeStacks({ StackName: 'test-stack' }) + assert.fail('Expected error to be thrown') + } catch (error) { + assert.strictEqual(error, nonPermissionError) + } + }) + + it('should return successful results when no errors occur', async function () { + const mockResponse = { Stacks: [{ StackName: 'test-stack' }] } + mockCfnClient.describeStacks.returns({ + promise: sandbox.stub().resolves(mockResponse), + } as any) + + const result = await enhancedClient.describeStacks({ StackName: 'test-stack' }) + assert.strictEqual(result, mockResponse) + }) + }) + + describe('Client Factory Functions', function () { + beforeEach(function () { + // Stub the global SDK client builder + sandbox.stub(globals.sdkClientBuilder, 'createAwsService').resolves({} as any) + }) + + it('should return EnhancedLambdaClient from getLambdaClient', function () { + const client = getLambdaClient('us-east-1') + assert(client instanceof EnhancedLambdaClient) + }) + + it('should return EnhancedCloudFormationClient from getCFNClient', async function () { + const client = await getCFNClient('us-east-1') + assert(client instanceof EnhancedCloudFormationClient) + }) + }) + + describe('Error Message Content', function () { + let mockLambdaClient: sinon.SinonStubbedInstance + let enhancedClient: EnhancedLambdaClient + + beforeEach(function () { + mockLambdaClient = sandbox.createStubInstance(DefaultLambdaClient) + // Add missing properties that EnhancedLambdaClient expects + Object.defineProperty(mockLambdaClient, 'defaultTimeoutInMs', { + value: 5 * 60 * 1000, + configurable: true, + }) + Object.defineProperty(mockLambdaClient, 'createSdkClient', { + value: sandbox.stub().resolves({}), + configurable: true, + }) + enhancedClient = new EnhancedLambdaClient(mockLambdaClient as any, 'us-west-2') + }) + + it('should include all required elements in enhanced error message', async function () { + const permissionError = Object.assign(new Error('Access denied'), { + code: 'AccessDeniedException', + time: new Date(), + statusCode: 403, + }) + mockLambdaClient.getFunction.rejects(permissionError) + + try { + await enhancedClient.getFunction('my-test-function') + assert.fail('Expected error to be thrown') + } catch (error) { + assert(error instanceof ToolkitError) + + // Check that the error message contains all expected elements + const message = error.message + + // Main error description + assert(message.includes('Permission denied: Missing required permissions for lambda:getFunction')) + + // Required permissions section + assert(message.includes('Required permissions:')) + assert(message.includes('- lambda:GetFunction')) + + // Resource ARN + assert(message.includes('Resource: arn:aws:lambda:us-west-2:*:function:my-test-function')) + + // Instructions + assert(message.includes('To fix this issue:')) + assert(message.includes('1. Contact your AWS administrator')) + assert(message.includes('2. Add these permissions to your IAM user/role policy')) + assert(message.includes('3. If using IAM roles, ensure the role has these permissions attached')) + + // Documentation link + assert( + message.includes( + 'Documentation: https://docs.aws.amazon.com/lambda/latest/api/API_GetFunction.html' + ) + ) + + // Check error details + assert.strictEqual(error.code, 'InsufficientPermissions') + assert(error.details) + assert.strictEqual(error.details.service, 'lambda') + assert.strictEqual(error.details.action, 'getFunction') + assert.deepStrictEqual(error.details.requiredPermissions, ['lambda:GetFunction']) + assert.strictEqual( + error.details.resourceArn, + 'arn:aws:lambda:us-west-2:*:function:my-test-function' + ) + } + }) + + it('should handle errors without resource ARN', async function () { + const permissionError = Object.assign(new Error('Access denied'), { + code: 'AccessDeniedException', + time: new Date(), + statusCode: 403, + }) + + // Create a mock async generator that throws the error + const mockAsyncGenerator = async function* (): AsyncIterableIterator { + throw permissionError + yield // This line will never be reached but satisfies ESLint require-yield rule + } + mockLambdaClient.listFunctions.returns(mockAsyncGenerator()) + + try { + const iterator = enhancedClient.listFunctions() + await iterator.next() + assert.fail('Expected error to be thrown') + } catch (error) { + assert(error instanceof ToolkitError) + + const message = error.message + assert(message.includes('Permission denied: Missing required permissions for lambda:listFunctions')) + assert(message.includes('- lambda:ListFunctions')) + // Should not include Resource line for operations without specific resources + assert(!message.includes('Resource: arn:')) + } + }) + }) + }) }) diff --git a/packages/core/src/test/awsService/sagemaker/credentialMapping.test.ts b/packages/core/src/test/awsService/sagemaker/credentialMapping.test.ts new file mode 100644 index 00000000000..06f19a5e890 --- /dev/null +++ b/packages/core/src/test/awsService/sagemaker/credentialMapping.test.ts @@ -0,0 +1,210 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as sinon from 'sinon' +import * as assert from 'assert' +import { persistLocalCredentials, persistSSMConnection } from '../../../awsService/sagemaker/credentialMapping' +import { Auth } from '../../../auth' +import { DevSettings, fs } from '../../../shared' +import globals from '../../../shared/extensionGlobals' + +describe('credentialMapping', () => { + describe('persistLocalCredentials', () => { + const appArn = 'arn:aws:sagemaker:us-west-2:123456789012:space/d-f0lwireyzpjp/test-space' + + let sandbox: sinon.SinonSandbox + + beforeEach(() => { + sandbox = sinon.createSandbox() + }) + + afterEach(() => { + sandbox.restore() + }) + + it('writes IAM profile to mappings', async () => { + sandbox.stub(Auth.instance, 'getCurrentProfileId').returns('profile:my-iam-profile') + sandbox.stub(fs, 'existsFile').resolves(false) // simulate no existing mapping file + const writeStub = sandbox.stub(fs, 'writeFile').resolves() + + await persistLocalCredentials(appArn) + + assert.ok(writeStub.calledOnce) + const raw = writeStub.firstCall.args[1] + const data = JSON.parse(typeof raw === 'string' ? raw : raw.toString()) + + assert.deepStrictEqual(data.localCredential?.[appArn], { + type: 'iam', + profileName: 'profile:my-iam-profile', + }) + }) + + it('writes SSO credentials to mappings', async () => { + sandbox.stub(Auth.instance, 'getCurrentProfileId').returns('sso:my-sso-profile') + sandbox.stub(globals.loginManager.store, 'credentialsCache').value({ + 'sso:my-sso-profile': { + credentials: { + accessKeyId: 'AKIA123', + secretAccessKey: 'SECRET', + sessionToken: 'TOKEN', + }, + }, + }) + sandbox.stub(fs, 'existsFile').resolves(false) + const writeStub = sandbox.stub(fs, 'writeFile').resolves() + + await persistLocalCredentials(appArn) + + assert.ok(writeStub.calledOnce) + const raw = writeStub.firstCall.args[1] + const data = JSON.parse(typeof raw === 'string' ? raw : raw.toString()) + assert.deepStrictEqual(data.localCredential?.[appArn], { + type: 'sso', + accessKey: 'AKIA123', + secret: 'SECRET', + token: 'TOKEN', + }) + }) + + it('throws if no current profile ID is available', async () => { + sandbox.stub(Auth.instance, 'getCurrentProfileId').returns(undefined) + + await assert.rejects(() => persistLocalCredentials(appArn), { + message: 'No current profile ID available for saving space credentials.', + }) + }) + }) + + describe('persistSSMConnection', () => { + const appArn = 'arn:aws:sagemaker:us-west-2:123456789012:space/d-f0lwireyzpjp/test-space' + const domain = 'd-f0lwireyzpjp' + let sandbox: sinon.SinonSandbox + + beforeEach(() => { + sandbox = sinon.createSandbox() + }) + + afterEach(() => { + sandbox.restore() + }) + + function assertRefreshUrlMatches(writtenUrl: string, expectedSubdomain: string) { + assert.ok( + writtenUrl.startsWith(`https://studio-${domain}.${expectedSubdomain}`), + `Expected refresh URL to start with https://studio-${domain}.${expectedSubdomain}, got ${writtenUrl}` + ) + } + + it('uses default (studio) endpoint if no custom endpoint is set', async () => { + sandbox.stub(DevSettings.instance, 'get').returns({}) + sandbox.stub(fs, 'existsFile').resolves(false) + const writeStub = sandbox.stub(fs, 'writeFile').resolves() + + // Stub the AWS API call + const mockDescribeSpace = sandbox.stub().resolves({ + SpaceSettings: { + AppType: 'JupyterLab', + }, + }) + sandbox.stub(require('../../../shared/clients/sagemaker'), 'SagemakerClient').returns({ + describeSpace: mockDescribeSpace, + }) + + await persistSSMConnection(appArn, domain) + + const raw = writeStub.firstCall.args[1] + const data = JSON.parse(typeof raw === 'string' ? raw : raw.toString()) + + assertRefreshUrlMatches(data.deepLink?.[appArn]?.refreshUrl, 'studio.us-west-2.sagemaker.aws') + assert.deepStrictEqual(data.deepLink?.[appArn]?.requests['initial-connection'], { + sessionId: '-', + url: '-', + token: '-', + status: 'fresh', + }) + }) + + it('uses devo subdomain for beta endpoint', async () => { + sandbox.stub(DevSettings.instance, 'get').returns({ sagemaker: 'https://beta.whatever' }) + sandbox.stub(fs, 'existsFile').resolves(false) + const writeStub = sandbox.stub(fs, 'writeFile').resolves() + + // Stub the AWS API call + const mockDescribeSpace = sandbox.stub().resolves({ + SpaceSettings: { + AppType: 'JupyterLab', + }, + }) + sandbox.stub(require('../../../shared/clients/sagemaker'), 'SagemakerClient').returns({ + describeSpace: mockDescribeSpace, + }) + + await persistSSMConnection(appArn, domain, 'sess', 'wss://ws', 'token') + + const raw = writeStub.firstCall.args[1] + const data = JSON.parse(typeof raw === 'string' ? raw : raw.toString()) + + assertRefreshUrlMatches(data.deepLink?.[appArn]?.refreshUrl, 'devo.studio.us-west-2.asfiovnxocqpcry.com') + assert.deepStrictEqual(data.deepLink?.[appArn]?.requests['initial-connection'], { + sessionId: 'sess', + url: 'wss://ws', + token: 'token', + status: 'fresh', + }) + }) + + it('uses loadtest subdomain for gamma endpoint', async () => { + sandbox.stub(DevSettings.instance, 'get').returns({ sagemaker: 'https://gamma.example' }) + sandbox.stub(fs, 'existsFile').resolves(false) + const writeStub = sandbox.stub(fs, 'writeFile').resolves() + + // Stub the AWS API call + const mockDescribeSpace = sandbox.stub().resolves({ + SpaceSettings: { + AppType: 'JupyterLab', + }, + }) + sandbox.stub(require('../../../shared/clients/sagemaker'), 'SagemakerClient').returns({ + describeSpace: mockDescribeSpace, + }) + + await persistSSMConnection(appArn, domain) + + const raw = writeStub.firstCall.args[1] + const data = JSON.parse(typeof raw === 'string' ? raw : raw.toString()) + + assertRefreshUrlMatches( + data.deepLink?.[appArn]?.refreshUrl, + 'loadtest.studio.us-west-2.asfiovnxocqpcry.com' + ) + }) + + // TODO: Skipped due to hardcoded appSubDomain. Currently hardcoded to 'jupyterlab' due to + // a bug in Studio that only supports refreshing the token for both CodeEditor and JupyterLab + // Apps in the jupyterlab subdomain. This will be fixed shortly after NYSummit launch to + // support refresh URL in CodeEditor subdomain. Additionally, appType will be determined by + // the deeplink URI rather than the describeSpace call from the toolkit. + it.skip('throws error when app type is unsupported', async () => { + sandbox.stub(DevSettings.instance, 'get').returns({}) + sandbox.stub(fs, 'existsFile').resolves(false) + + // Stub the AWS API call to return an unsupported app type + const mockDescribeSpace = sandbox.stub().resolves({ + SpaceSettings: { + AppType: 'UnsupportedApp', + }, + }) + sandbox.stub(require('../../../shared/clients/sagemaker'), 'SagemakerClient').returns({ + describeSpace: mockDescribeSpace, + }) + + await assert.rejects(() => persistSSMConnection(appArn, domain), { + name: 'Error', + message: + 'Unsupported or missing app type for space. Expected JupyterLab or CodeEditor, got: UnsupportedApp', + }) + }) + }) +}) diff --git a/packages/core/src/test/awsService/sagemaker/detached-server/credentials.test.ts b/packages/core/src/test/awsService/sagemaker/detached-server/credentials.test.ts new file mode 100644 index 00000000000..a979c2186d3 --- /dev/null +++ b/packages/core/src/test/awsService/sagemaker/detached-server/credentials.test.ts @@ -0,0 +1,89 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import assert from 'assert' +import * as sinon from 'sinon' +import * as utils from '../../../../awsService/sagemaker/detached-server/utils' +import { resolveCredentialsFor } from '../../../../awsService/sagemaker/detached-server/credentials' + +const connectionId = 'arn:aws:sagemaker:region:acct:space/name' + +describe('resolveCredentialsFor', () => { + afterEach(() => sinon.restore()) + + it('throws if no profile is found', async () => { + sinon.stub(utils, 'readMapping').resolves({ localCredential: {} }) + + await assert.rejects(() => resolveCredentialsFor(connectionId), { + message: `No profile found for "${connectionId}"`, + }) + }) + + it('throws if IAM profile name is malformed', async () => { + sinon.stub(utils, 'readMapping').resolves({ + localCredential: { + [connectionId]: { + type: 'iam', + profileName: 'dev-profile', // no colon + }, + }, + }) + + await assert.rejects(() => resolveCredentialsFor(connectionId), { + message: `Invalid IAM profile name for "${connectionId}"`, + }) + }) + + it('resolves SSO credentials correctly', async () => { + sinon.stub(utils, 'readMapping').resolves({ + localCredential: { + [connectionId]: { + type: 'sso', + accessKey: 'key', + secret: 'sec', + token: 'tok', + }, + }, + }) + + const creds = await resolveCredentialsFor(connectionId) + assert.deepStrictEqual(creds, { + accessKeyId: 'key', + secretAccessKey: 'sec', + sessionToken: 'tok', + }) + }) + + it('throws if SSO credentials are incomplete', async () => { + sinon.stub(utils, 'readMapping').resolves({ + localCredential: { + [connectionId]: { + type: 'sso', + accessKey: 'key', + secret: 'sec', + token: '', // token is required but intentionally left empty for this test + }, + }, + }) + + await assert.rejects(() => resolveCredentialsFor(connectionId), { + message: `Missing SSO credentials for "${connectionId}"`, + }) + }) + + it('throws for unsupported profile types', async () => { + sinon.stub(utils, 'readMapping').resolves({ + localCredential: { + [connectionId]: { + type: 'unknown', + } as any, + }, + }) + + await assert.rejects(() => resolveCredentialsFor(connectionId), { + message: /Unsupported profile type/, // don't hard-code full value since object might be serialized + }) + }) +}) diff --git a/packages/core/src/test/awsService/sagemaker/detached-server/routes/getSession.test.ts b/packages/core/src/test/awsService/sagemaker/detached-server/routes/getSession.test.ts new file mode 100644 index 00000000000..5b3f176a29f --- /dev/null +++ b/packages/core/src/test/awsService/sagemaker/detached-server/routes/getSession.test.ts @@ -0,0 +1,102 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as http from 'http' +import * as sinon from 'sinon' +import assert from 'assert' +import { handleGetSession } from '../../../../../awsService/sagemaker/detached-server/routes/getSession' +import * as credentials from '../../../../../awsService/sagemaker/detached-server/credentials' +import * as utils from '../../../../../awsService/sagemaker/detached-server/utils' +import * as errorPage from '../../../../../awsService/sagemaker/detached-server/errorPage' + +describe('handleGetSession', () => { + let req: Partial + let res: Partial + let resWriteHead: sinon.SinonSpy + let resEnd: sinon.SinonSpy + + beforeEach(() => { + resWriteHead = sinon.spy() + resEnd = sinon.spy() + + res = { + writeHead: resWriteHead, + end: resEnd, + } + sinon.stub(errorPage, 'openErrorPage') + }) + + it('responds with 400 if connection_identifier is missing', async () => { + req = { url: '/session' } + await handleGetSession(req as http.IncomingMessage, res as http.ServerResponse) + + assert(resWriteHead.calledWith(400)) + assert(resEnd.calledWithMatch(/Missing required query parameter/)) + }) + + it('responds with 500 if resolveCredentialsFor throws', async () => { + req = { url: '/session?connection_identifier=arn:aws:sagemaker:region:acc:space/domain/name' } + sinon.stub(credentials, 'resolveCredentialsFor').rejects(new Error('creds error')) + sinon.stub(utils, 'parseArn').returns({ + region: 'us-west-2', + accountId: '123456789012', + spaceName: 'space-name', + }) + + await handleGetSession(req as http.IncomingMessage, res as http.ServerResponse) + + assert(resWriteHead.calledWith(500)) + assert(resEnd.calledWith('creds error')) + }) + + it('responds with 500 if startSagemakerSession throws', async () => { + req = { url: '/session?connection_identifier=arn:aws:sagemaker:region:acc:space/domain/name' } + sinon.stub(credentials, 'resolveCredentialsFor').resolves({}) + sinon.stub(utils, 'parseArn').returns({ + region: 'us-west-2', + accountId: '123456789012', + spaceName: 'space-name', + }) + sinon.stub(utils, 'startSagemakerSession').rejects(new Error('session error')) + + await handleGetSession(req as http.IncomingMessage, res as http.ServerResponse) + + assert(resWriteHead.calledWith(500)) + assert(resEnd.calledWith('Failed to start SageMaker session')) + }) + + it('responds with 200 and session data on success', async () => { + req = { url: '/session?connection_identifier=arn:aws:sagemaker:region:acc:space/domain/name' } + sinon.stub(credentials, 'resolveCredentialsFor').resolves({}) + sinon.stub(utils, 'parseArn').returns({ + region: 'us-west-2', + accountId: '123456789012', + spaceName: 'space-name', + }) + sinon.stub(utils, 'startSagemakerSession').resolves({ + SessionId: 'abc123', + StreamUrl: 'https://stream', + TokenValue: 'token123', + $metadata: { httpStatusCode: 200 }, + }) + + await handleGetSession(req as http.IncomingMessage, res as http.ServerResponse) + + assert(resWriteHead.calledWith(200)) + assert( + resEnd.calledWithMatch( + JSON.stringify({ + SessionId: 'abc123', + StreamUrl: 'https://stream', + TokenValue: 'token123', + }) + ) + ) + }) + + afterEach(() => { + sinon.restore() + }) +}) diff --git a/packages/core/src/test/awsService/sagemaker/detached-server/routes/getSessionAsync.test.ts b/packages/core/src/test/awsService/sagemaker/detached-server/routes/getSessionAsync.test.ts new file mode 100644 index 00000000000..8d3ab8563ee --- /dev/null +++ b/packages/core/src/test/awsService/sagemaker/detached-server/routes/getSessionAsync.test.ts @@ -0,0 +1,99 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as http from 'http' +import * as sinon from 'sinon' +import assert from 'assert' +import { SessionStore } from '../../../../../awsService/sagemaker/detached-server/sessionStore' +import { handleGetSessionAsync } from '../../../../../awsService/sagemaker/detached-server/routes/getSessionAsync' +import * as utils from '../../../../../awsService/sagemaker/detached-server/utils' + +describe('handleGetSessionAsync', () => { + let req: Partial + let res: Partial + let resWriteHead: sinon.SinonSpy + let resEnd: sinon.SinonSpy + let storeStub: sinon.SinonStubbedInstance + + beforeEach(() => { + resWriteHead = sinon.spy() + resEnd = sinon.spy() + res = { writeHead: resWriteHead, end: resEnd } + + storeStub = sinon.createStubInstance(SessionStore) + sinon.stub(SessionStore.prototype, 'getFreshEntry').callsFake(storeStub.getFreshEntry) + sinon.stub(SessionStore.prototype, 'getStatus').callsFake(storeStub.getStatus) + sinon.stub(SessionStore.prototype, 'getRefreshUrl').callsFake(storeStub.getRefreshUrl) + sinon.stub(SessionStore.prototype, 'markPending').callsFake(storeStub.markPending) + }) + + it('responds with 400 if required query parameters are missing', async () => { + req = { url: '/session_async?connection_identifier=abc' } // missing request_id + await handleGetSessionAsync(req as http.IncomingMessage, res as http.ServerResponse) + + assert(resWriteHead.calledWith(400)) + assert(resEnd.calledWithMatch(/Missing required query parameters/)) + }) + + it('responds with 200 and session data if freshEntry exists', async () => { + req = { url: '/session_async?connection_identifier=abc&request_id=req123' } + storeStub.getFreshEntry.returns(Promise.resolve({ sessionId: 'sid', token: 'tok', url: 'wss://test' })) + + await handleGetSessionAsync(req as http.IncomingMessage, res as http.ServerResponse) + + assert(resWriteHead.calledWith(200)) + const actualJson = JSON.parse(resEnd.firstCall.args[0]) + assert.deepStrictEqual(actualJson, { + SessionId: 'sid', + TokenValue: 'tok', + StreamUrl: 'wss://test', + }) + }) + + it('responds with 204 if session is pending', async () => { + req = { url: '/session_async?connection_identifier=abc&request_id=req123' } + storeStub.getFreshEntry.returns(Promise.resolve(undefined)) + storeStub.getStatus.returns(Promise.resolve('pending')) + + await handleGetSessionAsync(req as http.IncomingMessage, res as http.ServerResponse) + + assert(resWriteHead.calledWith(204)) + assert(resEnd.calledOnce) + }) + + it('responds with 202 if status is not-started and opens browser', async () => { + req = { url: '/session_async?connection_identifier=abc&request_id=req123' } + + storeStub.getFreshEntry.returns(Promise.resolve(undefined)) + storeStub.getStatus.returns(Promise.resolve('not-started')) + storeStub.getRefreshUrl.returns(Promise.resolve('https://example.com/refresh')) + storeStub.markPending.returns(Promise.resolve()) + + sinon.stub(utils, 'readServerInfo').resolves({ pid: 1234, port: 4567 }) + sinon + .stub(utils, 'parseArn') + .returns({ region: 'us-east-1', accountId: '123456789012', spaceName: 'test-space' }) + sinon.stub(utils, 'open').resolves() + await handleGetSessionAsync(req as http.IncomingMessage, res as http.ServerResponse) + + assert(resWriteHead.calledWith(202)) + assert(resEnd.calledWithMatch(/Session is not ready yet/)) + assert(storeStub.markPending.calledWith('abc', 'req123')) + }) + + it('responds with 500 if unexpected error occurs', async () => { + req = { url: '/session_async?connection_identifier=abc&request_id=req123' } + storeStub.getFreshEntry.throws(new Error('fail')) + + await handleGetSessionAsync(req as http.IncomingMessage, res as http.ServerResponse) + + assert(resWriteHead.calledWith(500)) + assert(resEnd.calledWith('Unexpected error')) + }) + + afterEach(() => { + sinon.restore() + }) +}) diff --git a/packages/core/src/test/awsService/sagemaker/detached-server/routes/refreshToken.test.ts b/packages/core/src/test/awsService/sagemaker/detached-server/routes/refreshToken.test.ts new file mode 100644 index 00000000000..2fe6b3c648d --- /dev/null +++ b/packages/core/src/test/awsService/sagemaker/detached-server/routes/refreshToken.test.ts @@ -0,0 +1,74 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as http from 'http' +import * as sinon from 'sinon' +import assert from 'assert' +import { SessionStore } from '../../../../../awsService/sagemaker/detached-server/sessionStore' +import { handleRefreshToken } from '../../../../../awsService/sagemaker/detached-server/routes/refreshToken' + +describe('handleRefreshToken', () => { + let req: Partial + let res: Partial + let resWriteHead: sinon.SinonSpy + let resEnd: sinon.SinonSpy + let storeStub: sinon.SinonStubbedInstance + + beforeEach(() => { + resWriteHead = sinon.spy() + resEnd = sinon.spy() + + res = { + writeHead: resWriteHead, + end: resEnd, + } + + storeStub = sinon.createStubInstance(SessionStore) + sinon.stub(SessionStore.prototype, 'setSession').callsFake(storeStub.setSession) + }) + + it('responds with 400 if any required query parameter is missing', async () => { + req = { url: '/refresh?connection_identifier=abc&request_id=req123' } // missing others + + await handleRefreshToken(req as http.IncomingMessage, res as http.ServerResponse) + + assert(resWriteHead.calledWith(400)) + assert(resEnd.calledWithMatch(/Missing required parameters/)) + }) + + it('responds with 500 if setSession throws', async () => { + req = { + url: '/refresh?connection_identifier=abc&request_id=req123&ws_url=wss://abc&token=tok123&session=sess123', + } + storeStub.setSession.throws(new Error('store error')) + + await handleRefreshToken(req as http.IncomingMessage, res as http.ServerResponse) + + assert(resWriteHead.calledWith(500)) + assert(resEnd.calledWith('Failed to save session token')) + }) + + it('responds with 200 if session is saved successfully', async () => { + req = { + url: '/refresh?connection_identifier=abc&request_id=req123&ws_url=wss://abc&token=tok123&session=sess123', + } + + await handleRefreshToken(req as http.IncomingMessage, res as http.ServerResponse) + + assert(resWriteHead.calledWith(200)) + assert(resEnd.calledWith('Session token refreshed successfully')) + assert( + storeStub.setSession.calledWith('abc', 'req123', { + sessionId: 'sess123', + token: 'tok123', + url: 'wss://abc', + }) + ) + }) + + afterEach(() => { + sinon.restore() + }) +}) diff --git a/packages/core/src/test/awsService/sagemaker/detached-server/sessionStore.test.ts b/packages/core/src/test/awsService/sagemaker/detached-server/sessionStore.test.ts new file mode 100644 index 00000000000..2a7828a4951 --- /dev/null +++ b/packages/core/src/test/awsService/sagemaker/detached-server/sessionStore.test.ts @@ -0,0 +1,145 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as sinon from 'sinon' +import assert from 'assert' +import * as utils from '../../../../awsService/sagemaker/detached-server/utils' +import { SessionStore } from '../../../../awsService/sagemaker/detached-server/sessionStore' +import { SsmConnectionInfo } from '../../../../awsService/sagemaker/types' + +describe('SessionStore', () => { + let readMappingStub: sinon.SinonStub + let writeMappingStub: sinon.SinonStub + const connectionId = 'abc' + const requestId = 'req123' + + const baseMapping = { + deepLink: { + [connectionId]: { + refreshUrl: 'https://refresh.url', + requests: { + [requestId]: { sessionId: 's1', token: 't1', url: 'u1', status: 'fresh' }, + 'initial-connection': { sessionId: 's0', token: 't0', url: 'u0', status: 'fresh' }, + }, + }, + }, + } + + beforeEach(() => { + readMappingStub = sinon.stub(utils, 'readMapping').returns(JSON.parse(JSON.stringify(baseMapping))) + writeMappingStub = sinon.stub(utils, 'writeMapping') + }) + + afterEach(() => sinon.restore()) + + it('gets refreshUrl', async () => { + const store = new SessionStore() + const result = await store.getRefreshUrl(connectionId) + assert.strictEqual(result, 'https://refresh.url') + }) + + it('throws if no mapping exists for connectionId', async () => { + const store = new SessionStore() + readMappingStub.returns({ deepLink: {} }) + + await assert.rejects(() => store.getRefreshUrl('missing'), /No mapping found/) + }) + + it('returns fresh entry and marks consumed', async () => { + const store = new SessionStore() + const result = await store.getFreshEntry(connectionId, requestId) + assert.deepStrictEqual(result, { + sessionId: 's0', + token: 't0', + url: 'u0', + status: 'consumed', + }) + assert(writeMappingStub.calledOnce) + }) + + it('returns async fresh entry and deletes it', async () => { + const store = new SessionStore() + // Disable initial-connection freshness + readMappingStub.returns({ + deepLink: { + [connectionId]: { + refreshUrl: 'url', + requests: { + 'initial-connection': { status: 'consumed' }, + [requestId]: { sessionId: 'a', token: 'b', url: 'c', status: 'fresh' }, + }, + }, + }, + }) + const result = await store.getFreshEntry(connectionId, requestId) + assert.ok(result, 'Expected result to be defined') + assert.strictEqual(result.sessionId, 'a') + assert(writeMappingStub.calledOnce) + + // Verify the entry was deleted from the mapping + const updated = writeMappingStub.firstCall.args[0] + assert.strictEqual(updated.deepLink[connectionId].requests[requestId], undefined) + }) + + it('returns undefined if no fresh entries exist', async () => { + const store = new SessionStore() + readMappingStub.returns({ + deepLink: { + [connectionId]: { + refreshUrl: 'url', + requests: { + 'initial-connection': { status: 'consumed' }, + [requestId]: { status: 'pending' }, + }, + }, + }, + }) + const result = await store.getFreshEntry(connectionId, requestId) + assert.strictEqual(result, undefined) + }) + + it('gets status of known entry', async () => { + const store = new SessionStore() + const result = await store.getStatus(connectionId, requestId) + assert.strictEqual(result, 'fresh') + }) + + it('returns not-started if request not found', async () => { + const store = new SessionStore() + const result = await store.getStatus(connectionId, 'unknown') + assert.strictEqual(result, 'not-started') + }) + + it('marks entry as consumed', async () => { + const store = new SessionStore() + await store.markConsumed(connectionId, requestId) + const updated = writeMappingStub.firstCall.args[0] + assert.strictEqual(updated.deepLink[connectionId].requests[requestId].status, 'consumed') + }) + + it('marks request as pending', async () => { + const store = new SessionStore() + await store.markPending(connectionId, 'newReq') + const updated = writeMappingStub.firstCall.args[0] + assert.strictEqual(updated.deepLink[connectionId].requests['newReq'].status, 'pending') + }) + + it('sets session entry with default fresh status', async () => { + const store = new SessionStore() + const info: SsmConnectionInfo = { + sessionId: 's99', + token: 't99', + url: 'u99', + } + await store.setSession(connectionId, 'r99', info) + const written = writeMappingStub.firstCall.args[0] + assert.deepStrictEqual(written.deepLink[connectionId].requests['r99'], { + sessionId: 's99', + token: 't99', + url: 'u99', + status: 'fresh', + }) + }) +}) diff --git a/packages/core/src/test/awsService/sagemaker/detached-server/utils.test.ts b/packages/core/src/test/awsService/sagemaker/detached-server/utils.test.ts new file mode 100644 index 00000000000..bc8d0a8867b --- /dev/null +++ b/packages/core/src/test/awsService/sagemaker/detached-server/utils.test.ts @@ -0,0 +1,112 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* eslint-disable no-restricted-imports */ +import * as assert from 'assert' +import { parseArn, writeMapping, readMapping } from '../../../../awsService/sagemaker/detached-server/utils' +import { promises as fs } from 'fs' +import * as path from 'path' +import * as os from 'os' +import { SpaceMappings } from '../../../../awsService/sagemaker/types' + +describe('parseArn', () => { + it('parses a standard SageMaker ARN with forward slash', () => { + const arn = 'arn:aws:sagemaker:us-west-2:123456789012:space/domain-name/my-space-name' + const result = parseArn(arn) + assert.deepStrictEqual(result, { + region: 'us-west-2', + accountId: '123456789012', + spaceName: 'my-space-name', + }) + }) + + it('parses an ARN prefixed with sagemaker-user@', () => { + const arn = 'sagemaker-user@arn:aws:sagemaker:ap-southeast-1:123456789012:space/foo/my-space-name' + const result = parseArn(arn) + assert.deepStrictEqual(result, { + region: 'ap-southeast-1', + accountId: '123456789012', + spaceName: 'my-space-name', + }) + }) + + it('throws on malformed ARN', () => { + const invalidArn = 'arn:aws:invalid:format' + assert.throws(() => parseArn(invalidArn), /Invalid SageMaker ARN format/) + }) + + it('throws when missing region/account', () => { + const invalidArn = 'arn:aws:sagemaker:::space/xyz' + assert.throws(() => parseArn(invalidArn), /Invalid SageMaker ARN format/) + }) +}) + +describe('writeMapping', () => { + let testDir: string + + beforeEach(async () => { + testDir = await fs.mkdtemp(path.join(os.tmpdir(), 'sagemaker-test-')) + }) + + afterEach(async () => { + await fs.rmdir(testDir, { recursive: true }) + }) + + it('handles concurrent writes without race conditions', async () => { + const mapping1: SpaceMappings = { + localCredential: { + 'space-1': { type: 'iam', profileName: 'profile1' }, + }, + } + const mapping2: SpaceMappings = { + localCredential: { + 'space-2': { type: 'iam', profileName: 'profile2' }, + }, + } + const mapping3: SpaceMappings = { + deepLink: { + 'space-3': { + requests: { + req1: { + sessionId: 'session-456', + url: 'wss://example3.com', + token: 'token-456', + }, + }, + refreshUrl: 'https://example3.com/refresh', + }, + }, + } + + const writePromises = [writeMapping(mapping1), writeMapping(mapping2), writeMapping(mapping3)] + + await Promise.all(writePromises) + + const finalContent = await readMapping() + const possibleResults = [mapping1, mapping2, mapping3] + const isValidResult = possibleResults.some( + (expected) => JSON.stringify(finalContent) === JSON.stringify(expected) + ) + assert.strictEqual(isValidResult, true, 'Final content should match one of the written mappings') + }) + + it('queues multiple writes and processes them sequentially', async () => { + const mappings = Array.from({ length: 5 }, (_, i) => ({ + localCredential: { + [`space-${i}`]: { type: 'iam' as const, profileName: `profile-${i}` }, + }, + })) + + const writePromises = mappings.map((mapping) => writeMapping(mapping)) + + await Promise.all(writePromises) + + const finalContent = await readMapping() + assert.strictEqual(typeof finalContent, 'object', 'Final content should be a valid object') + + const isValidResult = mappings.some((mapping) => JSON.stringify(finalContent) === JSON.stringify(mapping)) + assert.strictEqual(isValidResult, true, 'Final content should match one of the written mappings') + }) +}) diff --git a/packages/core/src/test/awsService/sagemaker/explorer/sagemakerParentNode.test.ts b/packages/core/src/test/awsService/sagemaker/explorer/sagemakerParentNode.test.ts new file mode 100644 index 00000000000..8fccfe4bfd9 --- /dev/null +++ b/packages/core/src/test/awsService/sagemaker/explorer/sagemakerParentNode.test.ts @@ -0,0 +1,344 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as sinon from 'sinon' +import * as vscode from 'vscode' +import { DescribeDomainResponse } from '@amzn/sagemaker-client' +import { GetCallerIdentityResponse } from 'aws-sdk/clients/sts' +import { SagemakerClient, SagemakerSpaceApp } from '../../../../shared/clients/sagemaker' +import { SagemakerConstants } from '../../../../awsService/sagemaker/explorer/constants' +import { + SagemakerParentNode, + SelectedDomainUsers, + SelectedDomainUsersByRegion, +} from '../../../../awsService/sagemaker/explorer/sagemakerParentNode' +import { globals } from '../../../../shared' +import { DefaultStsClient } from '../../../../shared/clients/stsClient' +import { assertNodeListOnlyHasPlaceholderNode } from '../../../utilities/explorerNodeAssertions' +import assert from 'assert' + +describe('sagemakerParentNode', function () { + let testNode: SagemakerParentNode + let client: SagemakerClient + let fetchSpaceAppsAndDomainsStub: sinon.SinonStub< + [], + Promise<[Map, Map]> + > + let getCallerIdentityStub: sinon.SinonStub<[], Promise> + const testRegion = 'testRegion' + const domainsMap: Map = new Map([ + ['domain1', { DomainId: 'domain1', DomainName: 'domainName1' }], + ['domain2', { DomainId: 'domain2', DomainName: 'domainName2' }], + ]) + const spaceAppsMap: Map = new Map([ + [ + 'domain1__name1', + { + SpaceName: 'name1', + DomainId: 'domain1', + OwnershipSettingsSummary: { OwnerUserProfileName: 'user1-abcd' }, + Status: 'InService', + DomainSpaceKey: 'domain1__name1', + }, + ], + [ + 'domain2__name2', + { + SpaceName: 'name2', + DomainId: 'domain2', + OwnershipSettingsSummary: { OwnerUserProfileName: 'user2-efgh' }, + Status: 'InService', + DomainSpaceKey: 'domain2__name2', + }, + ], + ]) + const spaceAppsMapPending: Map = new Map([ + [ + 'domain1__name3', + { + SpaceName: 'name3', + DomainId: 'domain1', + OwnershipSettingsSummary: { OwnerUserProfileName: 'user1-abcd' }, + Status: 'InService', + DomainSpaceKey: 'domain1__name3', + App: { + Status: 'InService', + }, + }, + ], + [ + 'domain2__name4', + { + SpaceName: 'name4', + DomainId: 'domain2', + OwnershipSettingsSummary: { OwnerUserProfileName: 'user2-efgh' }, + Status: 'InService', + DomainSpaceKey: 'domain2__name4', + App: { + Status: 'Pending', + }, + }, + ], + ]) + const iamUser = { + UserId: 'test-userId', + Account: '123456789012', + Arn: 'arn:aws:iam::123456789012:user/user2', + } + const assumedRoleUser = { + UserId: 'test-userId', + Account: '123456789012', + Arn: 'arn:aws:sts::123456789012:assumed-role/UserRole/user2', + } + const ssoUser = { + UserId: 'test-userId', + Account: '123456789012', + Arn: 'arn:aws:sts::123456789012:assumed-role/AWSReservedSSO_MyPermissionSet_abcd1234/user2', + } + const getConfigTrue = { + get: () => true, + } + const getConfigFalse = { + get: () => false, + } + + before(function () { + client = new SagemakerClient(testRegion) + }) + + beforeEach(function () { + fetchSpaceAppsAndDomainsStub = sinon.stub(SagemakerClient.prototype, 'fetchSpaceAppsAndDomains') + getCallerIdentityStub = sinon.stub(DefaultStsClient.prototype, 'getCallerIdentity') + testNode = new SagemakerParentNode(testRegion, client) + }) + + afterEach(function () { + fetchSpaceAppsAndDomainsStub.restore() + getCallerIdentityStub.restore() + testNode.pollingSet.clear() + testNode.pollingSet.clearTimer() + sinon.restore() + }) + + it('returns placeholder node if no children are present', async function () { + fetchSpaceAppsAndDomainsStub.returns( + Promise.resolve([new Map(), new Map()]) + ) + getCallerIdentityStub.returns(Promise.resolve(iamUser)) + + const childNodes = await testNode.getChildren() + assertNodeListOnlyHasPlaceholderNode(childNodes) + }) + + it('has child nodes', async function () { + fetchSpaceAppsAndDomainsStub.returns(Promise.resolve([spaceAppsMap, domainsMap])) + getCallerIdentityStub.returns(Promise.resolve(iamUser)) + sinon + .stub(vscode.workspace, 'getConfiguration') + .returns(getConfigFalse as unknown as vscode.WorkspaceConfiguration) + + const childNodes = await testNode.getChildren() + assert.strictEqual(childNodes.length, spaceAppsMap.size, 'Unexpected child count') + assert.strictEqual(childNodes[0].label, 'name1 (Stopped)', 'Unexpected node label') + assert.strictEqual(childNodes[1].label, 'name2 (Stopped)', 'Unexpected node label') + }) + + it('adds pending nodes to polling nodes set', async function () { + fetchSpaceAppsAndDomainsStub.returns(Promise.resolve([spaceAppsMapPending, domainsMap])) + getCallerIdentityStub.returns(Promise.resolve(iamUser)) + + await testNode.updateChildren() + assert.strictEqual(testNode.pollingSet.size, 1) + fetchSpaceAppsAndDomainsStub.restore() + }) + + it('filters spaces owned by user profiles that match the IAM user', async function () { + fetchSpaceAppsAndDomainsStub.returns(Promise.resolve([spaceAppsMap, domainsMap])) + getCallerIdentityStub.returns(Promise.resolve(iamUser)) + sinon + .stub(vscode.workspace, 'getConfiguration') + .returns(getConfigTrue as unknown as vscode.WorkspaceConfiguration) + + const childNodes = await testNode.getChildren() + assert.strictEqual(childNodes.length, 1, 'Unexpected child count') + assert.strictEqual(childNodes[0].label, 'name2 (Stopped)', 'Unexpected node label') + }) + + it('filters spaces owned by user profiles that match the IAM assumed-role session name', async function () { + fetchSpaceAppsAndDomainsStub.returns(Promise.resolve([spaceAppsMap, domainsMap])) + getCallerIdentityStub.returns(Promise.resolve(assumedRoleUser)) + sinon + .stub(vscode.workspace, 'getConfiguration') + .returns(getConfigTrue as unknown as vscode.WorkspaceConfiguration) + + const childNodes = await testNode.getChildren() + assert.strictEqual(childNodes.length, 1, 'Unexpected child count') + assert.strictEqual(childNodes[0].label, 'name2 (Stopped)', 'Unexpected node label') + }) + + it('filters spaces owned by user profiles that match the Identity Center user', async function () { + fetchSpaceAppsAndDomainsStub.returns(Promise.resolve([spaceAppsMap, domainsMap])) + getCallerIdentityStub.returns(Promise.resolve(ssoUser)) + sinon + .stub(vscode.workspace, 'getConfiguration') + .returns(getConfigFalse as unknown as vscode.WorkspaceConfiguration) + + const childNodes = await testNode.getChildren() + assert.strictEqual(childNodes.length, 1, 'Unexpected child count') + assert.strictEqual(childNodes[0].label, 'name2 (Stopped)', 'Unexpected node label') + }) + + describe('getSelectedDomainUsers', function () { + let originalState: Map + + beforeEach(async function () { + testNode = new SagemakerParentNode(testRegion, client) + originalState = new Map( + globals.globalState.get(SagemakerConstants.SelectedDomainUsersState, []) + ) + }) + + afterEach(async function () { + await globals.globalState.update(SagemakerConstants.SelectedDomainUsersState, [...originalState]) + }) + + it('gets cached selectedDomainUsers for a given region', async function () { + await globals.globalState.update(SagemakerConstants.SelectedDomainUsersState, [ + [testRegion, [['arn:aws:iam::123456789012:user/user2', ['domain2__user-cached']]]], + ]) + testNode.callerIdentity = iamUser + sinon + .stub(vscode.workspace, 'getConfiguration') + .returns(getConfigTrue as unknown as vscode.WorkspaceConfiguration) + + const result = await testNode.getSelectedDomainUsers() + assert.deepStrictEqual( + [...result], + ['domain2__user-cached'], + 'Should match only cached selected domain user' + ) + }) + + it('gets default selectedDomainUsers', async function () { + await globals.globalState.update(SagemakerConstants.SelectedDomainUsersState, []) + testNode.spaceApps = spaceAppsMap + testNode.callerIdentity = iamUser + sinon + .stub(vscode.workspace, 'getConfiguration') + .returns(getConfigTrue as unknown as vscode.WorkspaceConfiguration) + + const result = await testNode.getSelectedDomainUsers() + assert.deepStrictEqual( + [...result], + ['domain2__user2-efgh'], + 'Should match only default selected domain user' + ) + }) + }) + + describe('saveSelectedDomainUsers', function () { + let originalState: Map + + beforeEach(async function () { + testNode = new SagemakerParentNode(testRegion, client) + originalState = new Map( + globals.globalState.get(SagemakerConstants.SelectedDomainUsersState, []) + ) + }) + + afterEach(async function () { + await globals.globalState.update(SagemakerConstants.SelectedDomainUsersState, [...originalState]) + }) + + it('saves selectedDomainUsers for a given region', async function () { + testNode.callerIdentity = iamUser + testNode.saveSelectedDomainUsers(['domain1__user-1', 'domain2__user-2']) + + const selectedDomainUsersByRegionMap = new Map( + globals.globalState.get(SagemakerConstants.SelectedDomainUsersState, []) + ) + const selectedDomainUsers = new Map(selectedDomainUsersByRegionMap.get(testRegion)) + + assert.deepStrictEqual(selectedDomainUsers.get(iamUser.Arn), ['domain1__user-1', 'domain2__user-2']) + }) + }) + + describe('getLocalSelectedDomainUsers', function () { + const createSpaceApp = (ownerName: string): SagemakerSpaceApp => ({ + SpaceName: 'space1', + DomainId: 'domain1', + Status: 'InService', + OwnershipSettingsSummary: { + OwnerUserProfileName: ownerName, + }, + DomainSpaceKey: 'domain1__name1', + }) + + beforeEach(function () { + testNode = new SagemakerParentNode(testRegion, client) + }) + + it('matches IAM user ARN when filtering is enabled', async function () { + testNode.callerIdentity = { + Arn: 'arn:aws:iam::123456789012:user/user1', + } + + testNode.spaceApps = new Map([ + ['domain1__space1', createSpaceApp('user1-abc')], + ['domain1__space2', createSpaceApp('user2-xyz')], + ]) + + sinon.stub(vscode.workspace, 'getConfiguration').returns(getConfigTrue as any) + + const result = await testNode.getLocalSelectedDomainUsers() + assert.deepStrictEqual(result, ['domain1__user1-abc'], 'Should match only user1-prefixed space') + }) + + it('matches IAM assumed-role ARN when filtering is enabled', async function () { + testNode.callerIdentity = { + Arn: 'arn:aws:sts::123456789012:assumed-role/SomeRole/user2', + } + + testNode.spaceApps = new Map([ + ['domain1__space1', createSpaceApp('user2-xyz')], + ['domain1__space2', createSpaceApp('user3-def')], + ]) + + sinon.stub(vscode.workspace, 'getConfiguration').returns(getConfigTrue as any) + + const result = await testNode.getLocalSelectedDomainUsers() + assert.deepStrictEqual(result, ['domain1__user2-xyz'], 'Should match only user2-prefixed space') + }) + + it('matches Identity Center ARN when IAM filtering is disabled', async function () { + testNode.callerIdentity = { + Arn: 'arn:aws:sts::123456789012:assumed-role/AWSReservedSSO_PermissionSet_abcd/user3', + } + + testNode.spaceApps = new Map([ + ['domain1__space1', createSpaceApp('user3-aaa')], + ['domain1__space2', createSpaceApp('other-user')], + ]) + + sinon.stub(vscode.workspace, 'getConfiguration').returns(getConfigFalse as any) + + const result = await testNode.getLocalSelectedDomainUsers() + assert.deepStrictEqual(result, ['domain1__user3-aaa'], 'Should match only user3-prefixed space') + }) + + it('returns empty array if no match is found', async function () { + testNode.callerIdentity = { + Arn: 'arn:aws:iam::123456789012:user/no-match', + } + + testNode.spaceApps = new Map([['domain1__space1', createSpaceApp('someone-else')]]) + + sinon.stub(vscode.workspace, 'getConfiguration').returns(getConfigTrue as any) + + const result = await testNode.getLocalSelectedDomainUsers() + assert.deepStrictEqual(result, [], 'Should return empty list when no prefix matches') + }) + }) +}) diff --git a/packages/core/src/test/awsService/sagemaker/explorer/sagemakerSpaceNode.test.ts b/packages/core/src/test/awsService/sagemaker/explorer/sagemakerSpaceNode.test.ts new file mode 100644 index 00000000000..57b4d7a80c6 --- /dev/null +++ b/packages/core/src/test/awsService/sagemaker/explorer/sagemakerSpaceNode.test.ts @@ -0,0 +1,93 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' +import * as sinon from 'sinon' +import assert from 'assert' +import { AppType } from '@aws-sdk/client-sagemaker' +import { SagemakerClient, SagemakerSpaceApp } from '../../../../shared/clients/sagemaker' +import { SagemakerSpaceNode } from '../../../../awsService/sagemaker/explorer/sagemakerSpaceNode' +import { SagemakerParentNode } from '../../../../awsService/sagemaker/explorer/sagemakerParentNode' +import { PollingSet } from '../../../../shared/utilities/pollingSet' + +describe('SagemakerSpaceNode', function () { + const testRegion = 'testRegion' + let client: SagemakerClient + let testParent: SagemakerParentNode + let testSpaceApp: SagemakerSpaceApp + let describeAppStub: sinon.SinonStub + let testSpaceAppNode: SagemakerSpaceNode + + beforeEach(function () { + testSpaceApp = { + SpaceName: 'TestSpace', + DomainId: 'd-12345', + App: { AppName: 'TestApp', Status: 'InService' }, + SpaceSettingsSummary: { AppType: AppType.JupyterLab }, + OwnershipSettingsSummary: { OwnerUserProfileName: 'test-user' }, + SpaceSharingSettingsSummary: { SharingType: 'Private' }, + Status: 'InService', + DomainSpaceKey: '123', + } + + sinon.stub(PollingSet.prototype, 'add') + client = new SagemakerClient(testRegion) + testParent = new SagemakerParentNode(testRegion, client) + + describeAppStub = sinon.stub(SagemakerClient.prototype, 'describeApp') + testSpaceAppNode = new SagemakerSpaceNode(testParent, client, testRegion, testSpaceApp) + }) + + afterEach(function () { + sinon.restore() + }) + + it('initializes with correct label, description, and tooltip', function () { + const node = new SagemakerSpaceNode(testParent, client, testRegion, testSpaceApp) + + assert.strictEqual(node.label, 'TestSpace (Running)') + assert.strictEqual(node.description, 'Private space') + assert.ok(node.tooltip instanceof vscode.MarkdownString) + assert.ok((node.tooltip as vscode.MarkdownString).value.includes('**Space:** TestSpace')) + }) + + it('falls back to defaults if optional fields are missing', function () { + const partialApp: SagemakerSpaceApp = { + SpaceName: undefined, + DomainId: 'domainId', + Status: 'Failed', + DomainSpaceKey: '123', + } + + const node = new SagemakerSpaceNode(testParent, client, testRegion, partialApp) + + assert.strictEqual(node.label, '(no name) (Failed)') + assert.strictEqual(node.description, 'Unknown space') + assert.ok((node.tooltip as vscode.MarkdownString).value.includes('**Space:** -')) + }) + + it('returns ARN from describeApp', async function () { + describeAppStub.resolves({ AppArn: 'arn:aws:sagemaker:1234:app/TestApp' }) + + const node = new SagemakerSpaceNode(testParent, client, testRegion, testSpaceApp) + const arn = await node.getAppArn() + + assert.strictEqual(arn, 'arn:aws:sagemaker:1234:app/TestApp') + sinon.assert.calledOnce(describeAppStub) + sinon.assert.calledWithExactly(describeAppStub, { + DomainId: 'd-12345', + AppName: 'TestApp', + AppType: AppType.JupyterLab, + SpaceName: 'TestSpace', + }) + }) + + it('updates status with new spaceApp', async function () { + const newStatus = 'Starting' + const newSpaceApp = { ...testSpaceApp, App: { AppName: 'TestApp', Status: 'Pending' } } as SagemakerSpaceApp + testSpaceAppNode.updateSpace(newSpaceApp) + assert.strictEqual(testSpaceAppNode.getStatus(), newStatus) + }) +}) diff --git a/packages/core/src/test/awsService/sagemaker/model.test.ts b/packages/core/src/test/awsService/sagemaker/model.test.ts new file mode 100644 index 00000000000..892baf2f77b --- /dev/null +++ b/packages/core/src/test/awsService/sagemaker/model.test.ts @@ -0,0 +1,194 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' +import * as sinon from 'sinon' +import * as os from 'os' +import * as path from 'path' +import { DevSettings, fs, ToolkitError } from '../../../shared' +import { removeKnownHost, startLocalServer, stopLocalServer } from '../../../awsService/sagemaker/model' +import { assertLogsContain } from '../../globalSetup.test' +import assert from 'assert' + +describe('SageMaker Model', () => { + describe('startLocalServer', function () { + const ctx = { + globalStorageUri: vscode.Uri.file(path.join(os.tmpdir(), 'test-storage')), + extensionPath: path.join(os.tmpdir(), 'extension'), + asAbsolutePath: (relPath: string) => path.join(path.join(os.tmpdir(), 'extension'), relPath), + } as vscode.ExtensionContext + + let sandbox: sinon.SinonSandbox + + beforeEach(() => { + sandbox = sinon.createSandbox() + }) + + afterEach(() => { + sandbox.restore() + }) + + it('waits for info file and starts server', async function () { + // Simulate the file doesn't exist initially, then appears on 3rd check + const existsStub = sandbox.stub(fs, 'existsFile') + existsStub.onCall(0).resolves(false) + existsStub.onCall(1).resolves(false) + existsStub.onCall(2).resolves(true) + + sandbox.stub(require('fs'), 'openSync').returns(42) + + const stopStub = sandbox.stub().resolves() + sandbox.replace(require('../../../awsService/sagemaker/model'), 'stopLocalServer', stopStub) + + const spawnStub = sandbox.stub().returns({ unref: sandbox.stub() }) + sandbox.replace(require('../../../awsService/sagemaker/utils'), 'spawnDetachedServer', spawnStub) + + sandbox.stub(DevSettings.instance, 'get').returns({ sagemaker: 'https://fake-endpoint' }) + + await startLocalServer(ctx) + + sinon.assert.called(spawnStub) + sinon.assert.calledWith( + spawnStub, + process.execPath, + [ctx.asAbsolutePath('dist/src/awsService/sagemaker/detached-server/server.js')], + sinon.match.any + ) + + assert.ok(existsStub.callCount >= 3, 'should have retried for file existence') + }) + }) + + describe('stopLocalServer', function () { + const ctx = { + globalStorageUri: vscode.Uri.file(path.join(os.tmpdir(), 'test-storage')), + } as vscode.ExtensionContext + + const infoFilePath = path.join(ctx.globalStorageUri.fsPath, 'sagemaker-local-server-info.json') + const validPid = 12345 + const validJson = JSON.stringify({ pid: validPid }) + let sandbox: sinon.SinonSandbox + + beforeEach(() => { + sandbox = sinon.createSandbox() + }) + + afterEach(() => { + sandbox.restore() + }) + + it('logs debug when successfully stops server and deletes file', async function () { + sandbox.stub(fs, 'existsFile').resolves(true) + sandbox.stub(fs, 'readFileText').resolves(validJson) + const killStub = sandbox.stub(process, 'kill').returns(true) + const deleteStub = sandbox.stub(fs, 'delete').resolves() + + await stopLocalServer(ctx) + + sinon.assert.calledWith(killStub, validPid) + sinon.assert.calledWith(deleteStub, infoFilePath) + assertLogsContain(`stopped local server with PID ${validPid}`, false, 'debug') + assertLogsContain('removed server info file.', false, 'debug') + }) + + it('throws ToolkitError when info file is invalid JSON', async function () { + sandbox.stub(fs, 'existsFile').resolves(true) + sandbox.stub(fs, 'readFileText').resolves('invalid json') + + try { + await stopLocalServer(ctx) + assert.ok(false, 'Expected error not thrown') + } catch (err) { + assert.ok(err instanceof ToolkitError) + assert.strictEqual(err.message, 'failed to parse server info file') + } + }) + + it('throws ToolkitError when killing process fails for another reason', async function () { + sandbox.stub(fs, 'existsFile').resolves(true) + sandbox.stub(fs, 'readFileText').resolves(validJson) + sandbox.stub(fs, 'delete').resolves() + sandbox.stub(process, 'kill').throws({ code: 'EPERM', message: 'permission denied' }) + + try { + await stopLocalServer(ctx) + assert.ok(false) + } catch (err) { + assert.ok(err instanceof ToolkitError) + assert.strictEqual(err.message, 'failed to stop local server') + } + }) + }) + + describe('removeKnownHost', function () { + const knownHostsPath = path.join(os.homedir(), '.ssh', 'known_hosts') + const hostname = 'test.host.com' + let sandbox: sinon.SinonSandbox + + beforeEach(function () { + sandbox = sinon.createSandbox() + }) + + afterEach(function () { + sandbox.restore() + }) + + it('removes line with hostname and writes updated file', async function () { + sandbox.stub(fs, 'existsFile').resolves(true) + + const inputContent = `${hostname} ssh-rsa AAAA\nsome.other.com ssh-rsa BBBB` + const expectedOutput = `some.other.com ssh-rsa BBBB` + + sandbox.stub(fs, 'readFileText').resolves(inputContent) + + const writeStub = sandbox.stub(fs, 'writeFile').resolves() + await removeKnownHost(hostname) + + sinon.assert.calledWith( + writeStub, + knownHostsPath, + sinon.match((value: string) => value.trim() === expectedOutput), + { atomic: true } + ) + }) + + it('logs warning when known_hosts does not exist', async function () { + sandbox.stub(fs, 'existsFile').resolves(false) + + await removeKnownHost('test.host.com') + + assertLogsContain(`known_hosts not found at`, false, 'warn') + }) + + it('throws ToolkitError when reading known_hosts fails', async function () { + sandbox.stub(fs, 'existsFile').resolves(true) + sandbox.stub(fs, 'readFileText').rejects(new Error('read failed')) + + try { + await removeKnownHost(hostname) + assert.ok(false, 'Expected error was not thrown') + } catch (err) { + assert.ok(err instanceof ToolkitError) + assert.strictEqual(err.message, 'Failed to read known_hosts file') + assert.strictEqual((err as ToolkitError).cause?.message, 'read failed') + } + }) + + it('throws ToolkitError when writing known_hosts fails', async function () { + sandbox.stub(fs, 'existsFile').resolves(true) + sandbox.stub(fs, 'readFileText').resolves(`${hostname} ssh-rsa key\nsomehost ssh-rsa key`) + sandbox.stub(fs, 'writeFile').rejects(new Error('write failed')) + + try { + await removeKnownHost(hostname) + assert.ok(false, 'Expected error was not thrown') + } catch (err) { + assert.ok(err instanceof ToolkitError) + assert.strictEqual(err.message, 'Failed to write updated known_hosts file') + assert.strictEqual((err as ToolkitError).cause?.message, 'write failed') + } + }) + }) +}) diff --git a/packages/core/src/test/awsService/sagemaker/remoteUtils.test.ts b/packages/core/src/test/awsService/sagemaker/remoteUtils.test.ts new file mode 100644 index 00000000000..4168dfdeee4 --- /dev/null +++ b/packages/core/src/test/awsService/sagemaker/remoteUtils.test.ts @@ -0,0 +1,76 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as sinon from 'sinon' +import * as assert from 'assert' +import { getRemoteAppMetadata } from '../../../awsService/sagemaker/remoteUtils' +import { fs } from '../../../shared/fs/fs' +import { SagemakerClient } from '../../../shared/clients/sagemaker' + +describe('getRemoteAppMetadata', function () { + let sandbox: sinon.SinonSandbox + let fsStub: sinon.SinonStub + let parseRegionStub: sinon.SinonStub + let describeSpaceStub: sinon.SinonStub + let loggerStub: sinon.SinonStub + + const mockMetadata = { + AppType: 'JupyterLab', + DomainId: 'd-f0lwireyzpjp', + SpaceName: 'test-ae-3', + ExecutionRoleArn: 'arn:aws:iam::177118115371:role/service-role/AmazonSageMaker-ExecutionRole-20250415T091941', + ResourceArn: 'arn:aws:sagemaker:us-west-2:177118115371:app/d-f0lwireyzpjp/test-ae-3/JupyterLab/default', + ResourceName: 'default', + AppImageVersion: '', + ResourceArnCaseSensitive: + 'arn:aws:sagemaker:us-west-2:177118115371:app/d-f0lwireyzpjp/test-ae-3/JupyterLab/default', + IpAddressType: 'ipv4', + } + + const mockSpaceDetails = { + OwnershipSettings: { + OwnerUserProfileName: 'test-user-profile', + }, + } + + beforeEach(() => { + sandbox = sinon.createSandbox() + fsStub = sandbox.stub(fs, 'readFileText') + parseRegionStub = sandbox + .stub() + .returns({ region: 'us-west-2', accountId: '123456789012', spaceName: 'test-space' }) + sandbox.replace(require('../../../awsService/sagemaker/detached-server/utils'), 'parseArn', parseRegionStub) + + describeSpaceStub = sandbox.stub().resolves(mockSpaceDetails) + sandbox.stub(SagemakerClient.prototype, 'describeSpace').callsFake(describeSpaceStub) + + loggerStub = sandbox.stub().returns({ + error: sandbox.stub(), + }) + sandbox.replace(require('../../../shared/logger/logger'), 'getLogger', loggerStub) + }) + + afterEach(() => { + sandbox.restore() + }) + + it('successfully reads metadata file and returns remote app metadata', async function () { + fsStub.resolves(JSON.stringify(mockMetadata)) + + const result = await getRemoteAppMetadata() + + assert.deepStrictEqual(result, { + DomainId: 'd-f0lwireyzpjp', + UserProfileName: 'test-user-profile', + }) + + sinon.assert.calledWith(fsStub, '/opt/ml/metadata/resource-metadata.json') + sinon.assert.calledWith(parseRegionStub, mockMetadata.ResourceArn) + sinon.assert.calledWith(describeSpaceStub, { + DomainId: 'd-f0lwireyzpjp', + SpaceName: 'test-ae-3', + }) + }) +}) diff --git a/packages/core/src/test/awsService/sagemaker/uriHandlers.test.ts b/packages/core/src/test/awsService/sagemaker/uriHandlers.test.ts new file mode 100644 index 00000000000..9ff24b2a3f9 --- /dev/null +++ b/packages/core/src/test/awsService/sagemaker/uriHandlers.test.ts @@ -0,0 +1,59 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as sinon from 'sinon' +import * as vscode from 'vscode' +import assert from 'assert' +import { UriHandler } from '../../../shared/vscode/uriHandler' +import { VSCODE_EXTENSION_ID } from '../../../shared/extensions' +import { register } from '../../../awsService/sagemaker/uriHandlers' + +function createConnectUri(params: { [key: string]: string }): vscode.Uri { + const query = Object.entries(params) + .map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`) + .join('&') + return vscode.Uri.parse(`vscode://${VSCODE_EXTENSION_ID.awstoolkit}/connect/sagemaker?${query}`) +} + +describe('SageMaker URI handler', function () { + let handler: UriHandler + let deeplinkConnectStub: sinon.SinonStub + + beforeEach(function () { + handler = new UriHandler() + deeplinkConnectStub = sinon.stub().resolves() + sinon.replace(require('../../../awsService/sagemaker/commands'), 'deeplinkConnect', deeplinkConnectStub) + + register({ + uriHandler: handler, + } as any) + }) + + afterEach(function () { + sinon.restore() + }) + + it('calls deeplinkConnect with all expected params', async function () { + const params = { + connection_identifier: 'abc123', + domain: 'my-domain', + user_profile: 'me', + session: 'sess-xyz', + ws_url: 'wss://example.com', + 'cell-number': '4', + token: 'my-token', + } + + const uri = createConnectUri(params) + await handler.handleUri(uri) + + assert.ok(deeplinkConnectStub.calledOnce) + assert.deepStrictEqual(deeplinkConnectStub.firstCall.args[1], 'abc123') + assert.deepStrictEqual(deeplinkConnectStub.firstCall.args[2], 'sess-xyz') + assert.deepStrictEqual(deeplinkConnectStub.firstCall.args[3], 'wss://example.com&cell-number=4') + assert.deepStrictEqual(deeplinkConnectStub.firstCall.args[4], 'my-token') + assert.deepStrictEqual(deeplinkConnectStub.firstCall.args[5], 'my-domain') + }) +}) diff --git a/packages/core/src/test/awsService/sagemaker/utils.test.ts b/packages/core/src/test/awsService/sagemaker/utils.test.ts new file mode 100644 index 00000000000..c73fd6968fc --- /dev/null +++ b/packages/core/src/test/awsService/sagemaker/utils.test.ts @@ -0,0 +1,150 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import { AppStatus, SpaceStatus } from '@aws-sdk/client-sagemaker' +import { generateSpaceStatus, ActivityCheckInterval } from '../../../awsService/sagemaker/utils' +import * as assert from 'assert' +import * as sinon from 'sinon' +import { fs } from '../../../shared/fs/fs' +import * as utils from '../../../awsService/sagemaker/utils' + +describe('generateSpaceStatus', function () { + it('returns Failed if space status is Failed', function () { + assert.strictEqual(generateSpaceStatus(SpaceStatus.Failed, AppStatus.InService), 'Failed') + }) + + it('returns Failed if space status is Delete_Failed', function () { + assert.strictEqual(generateSpaceStatus(SpaceStatus.Delete_Failed, AppStatus.InService), 'Failed') + }) + + it('returns Failed if space status is Update_Failed', function () { + assert.strictEqual(generateSpaceStatus(SpaceStatus.Update_Failed, AppStatus.InService), 'Failed') + }) + + it('returns Failed if app status is Failed and space status is not Updating', function () { + assert.strictEqual(generateSpaceStatus(SpaceStatus.Deleting, AppStatus.Failed), 'Failed') + }) + + it('does not return Failed if app status is Failed but space status is Updating', function () { + assert.strictEqual(generateSpaceStatus(SpaceStatus.Updating, AppStatus.Failed), 'Updating') + }) + + it('returns Running if both statuses are InService', function () { + assert.strictEqual(generateSpaceStatus(SpaceStatus.InService, AppStatus.InService), 'Running') + }) + + it('returns Starting if app is Pending and space is InService', function () { + assert.strictEqual(generateSpaceStatus(SpaceStatus.InService, AppStatus.Pending), 'Starting') + }) + + it('returns Updating if space status is Updating', function () { + assert.strictEqual(generateSpaceStatus(SpaceStatus.Updating, AppStatus.Deleting), 'Updating') + }) + + it('returns Stopping if app is Deleting and space is InService', function () { + assert.strictEqual(generateSpaceStatus(SpaceStatus.InService, AppStatus.Deleting), 'Stopping') + }) + + it('returns Stopped if app is Deleted and space is InService', function () { + assert.strictEqual(generateSpaceStatus(SpaceStatus.InService, AppStatus.Deleted), 'Stopped') + }) + + it('returns Stopped if app status is undefined and space is InService', function () { + assert.strictEqual(generateSpaceStatus(SpaceStatus.InService, undefined), 'Stopped') + }) + + it('returns Deleting if space is Deleting', function () { + assert.strictEqual(generateSpaceStatus(SpaceStatus.Deleting, AppStatus.InService), 'Deleting') + }) + + it('returns Unknown if none of the above match', function () { + assert.strictEqual(generateSpaceStatus(undefined, undefined), 'Unknown') + assert.strictEqual( + generateSpaceStatus('SomeOtherStatus' as SpaceStatus, 'RandomAppStatus' as AppStatus), + 'Unknown' + ) + }) +}) + +describe('checkTerminalActivity', function () { + let sandbox: sinon.SinonSandbox + let fsReaddirStub: sinon.SinonStub + let fsStatStub: sinon.SinonStub + let fsWriteFileStub: sinon.SinonStub + + beforeEach(function () { + sandbox = sinon.createSandbox() + fsReaddirStub = sandbox.stub(fs, 'readdir') + fsStatStub = sandbox.stub(fs, 'stat') + fsWriteFileStub = sandbox.stub(fs, 'writeFile') + }) + + afterEach(function () { + sandbox.restore() + }) + + it('should write to idle file when recent terminal activity is detected', async function () { + const idleFilePath = '/tmp/test-idle-file' + const recentTime = Date.now() - ActivityCheckInterval / 2 // Recent activity + + fsReaddirStub.resolves([ + ['pts1', 1], + ['pts2', 1], + ]) // Mock file entries + fsStatStub.onFirstCall().resolves({ mtime: new Date(recentTime) }) + fsWriteFileStub.resolves() + + await utils.checkTerminalActivity(idleFilePath) + + // Verify that fs.writeFile was called (which means updateIdleFile was called) + assert.strictEqual(fsWriteFileStub.callCount, 1) + assert.strictEqual(fsWriteFileStub.firstCall.args[0], idleFilePath) + + // Verify the timestamp is a valid ISO string + const timestamp = fsWriteFileStub.firstCall.args[1] + assert.strictEqual(typeof timestamp, 'string') + assert.ok(!isNaN(Date.parse(timestamp))) + }) + + it('should stop checking once activity is detected', async function () { + const idleFilePath = '/tmp/test-idle-file' + const recentTime = Date.now() - ActivityCheckInterval / 2 + + fsReaddirStub.resolves([ + ['pts1', 1], + ['pts2', 1], + ['pts3', 1], + ]) + fsStatStub.onFirstCall().resolves({ mtime: new Date(recentTime) }) // First file has activity + fsWriteFileStub.resolves() + + await utils.checkTerminalActivity(idleFilePath) + + // Should only call stat once since activity was detected on first file + assert.strictEqual(fsStatStub.callCount, 1) + // Should write to file once + assert.strictEqual(fsWriteFileStub.callCount, 1) + }) + + it('should handle stat error gracefully and continue checking other files', async function () { + const idleFilePath = '/tmp/test-idle-file' + const recentTime = Date.now() - ActivityCheckInterval / 2 + const statError = new Error('File not found') + + fsReaddirStub.resolves([ + ['pts1', 1], + ['pts2', 1], + ]) + fsStatStub.onFirstCall().rejects(statError) // First file fails + fsStatStub.onSecondCall().resolves({ mtime: new Date(recentTime) }) // Second file succeeds + fsWriteFileStub.resolves() + + await utils.checkTerminalActivity(idleFilePath) + + // Should continue and find activity on second file + assert.strictEqual(fsStatStub.callCount, 2) + assert.strictEqual(fsWriteFileStub.callCount, 1) + }) +}) diff --git a/packages/core/src/test/codewhisperer/commands/basicCommands.test.ts b/packages/core/src/test/codewhisperer/commands/basicCommands.test.ts index b911c9687ee..05164274b70 100644 --- a/packages/core/src/test/codewhisperer/commands/basicCommands.test.ts +++ b/packages/core/src/test/codewhisperer/commands/basicCommands.test.ts @@ -8,7 +8,7 @@ import assert from 'assert' import * as sinon from 'sinon' import * as CodeWhispererConstants from '../../../codewhisperer/models/constants' import { createCodeScanIssue, createMockDocument, resetCodeWhispererGlobalVariables } from '../testUtil' -import { assertNoTelemetryMatch, assertTelemetry, assertTelemetryCurried, tryRegister } from '../../testUtil' +import { assertTelemetry, assertTelemetryCurried, tryRegister } from '../../testUtil' import { toggleCodeSuggestions, showSecurityScan, @@ -19,10 +19,8 @@ import { reconnect, signoutCodeWhisperer, toggleCodeScans, - generateFix, rejectFix, ignoreIssue, - regenerateFix, ignoreAllIssues, } from '../../../codewhisperer/commands/basicCommands' import { FakeExtensionContext } from '../../fakeExtensionContext' @@ -30,7 +28,7 @@ import { testCommand } from '../../shared/vscode/testUtils' import { Command, placeholder } from '../../../shared/vscode/commands2' import { SecurityPanelViewProvider } from '../../../codewhisperer/views/securityPanelViewProvider' import { DefaultCodeWhispererClient } from '../../../codewhisperer/client/codewhisperer' -import { Stub, stub } from '../../utilities/stubber' +import { stub } from '../../utilities/stubber' import { AuthUtil } from '../../../codewhisperer/util/authUtil' import { getTestWindow } from '../../shared/vscode/window' import { ExtContext } from '../../../shared/extensions' @@ -68,7 +66,6 @@ import { SecurityIssueProvider } from '../../../codewhisperer/service/securityIs import { CodeWhispererSettings } from '../../../codewhisperer/util/codewhispererSettings' import { confirm } from '../../../shared' import * as commentUtils from '../../../shared/utilities/commentUtils' -import * as startCodeFixGeneration from '../../../codewhisperer/commands/startCodeFixGeneration' import * as extUtils from '../../../shared/extensionUtilities' describe('CodeWhisperer-basicCommands', function () { @@ -790,173 +787,7 @@ def execute_input_compliant(): }) }) - describe('generateFix', function () { - let sandbox: sinon.SinonSandbox - let mockClient: Stub - let startCodeFixGenerationStub: sinon.SinonStub - let filePath: string - let codeScanIssue: CodeScanIssue - let issueItem: IssueItem - let updateSecurityIssueWebviewMock: sinon.SinonStub - let updateIssueMock: sinon.SinonStub - let refreshTreeViewMock: sinon.SinonStub - let mockExtContext: ExtContext - - beforeEach(async function () { - sandbox = sinon.createSandbox() - mockClient = stub(DefaultCodeWhispererClient) - startCodeFixGenerationStub = sinon.stub(startCodeFixGeneration, 'startCodeFixGeneration') - filePath = 'dummy/file.py' - codeScanIssue = createCodeScanIssue({ - findingId: randomUUID(), - ruleId: 'dummy-rule-id', - }) - issueItem = new IssueItem(filePath, codeScanIssue) - updateSecurityIssueWebviewMock = sinon.stub(securityIssueWebview, 'updateSecurityIssueWebview') - updateIssueMock = sinon.stub(SecurityIssueProvider.instance, 'updateIssue') - refreshTreeViewMock = sinon.stub(SecurityIssueTreeViewProvider.instance, 'refresh') - mockExtContext = await FakeExtensionContext.getFakeExtContext() - }) - - afterEach(function () { - sandbox.restore() - }) - - it('should call generateFix command successfully', async function () { - startCodeFixGenerationStub.resolves({ - suggestedFix: { - codeDiff: 'codeDiff', - description: 'description', - references: [], - }, - jobId: 'jobId', - }) - - targetCommand = testCommand(generateFix, mockClient, mockExtContext) - await targetCommand.execute(codeScanIssue, filePath, 'webview') - - assert.ok(updateSecurityIssueWebviewMock.calledWith(sinon.match({ isGenerateFixLoading: true }))) - assert.ok( - startCodeFixGenerationStub.calledWith(mockClient, codeScanIssue, filePath, codeScanIssue.findingId) - ) - - const expectedUpdatedIssue = { - ...codeScanIssue, - fixJobId: 'jobId', - suggestedFixes: [{ code: 'codeDiff', description: 'description', references: [] }], - } - assert.ok( - updateSecurityIssueWebviewMock.calledWith( - sinon.match({ - issue: expectedUpdatedIssue, - isGenerateFixLoading: false, - filePath: filePath, - shouldRefreshView: true, - }) - ) - ) - assert.ok(updateIssueMock.calledWith(expectedUpdatedIssue, filePath)) - assert.ok(refreshTreeViewMock.calledOnce) - - assertTelemetry('codewhisperer_codeScanIssueGenerateFix', { - detectorId: codeScanIssue.detectorId, - findingId: codeScanIssue.findingId, - ruleId: codeScanIssue.ruleId, - component: 'webview', - result: 'Succeeded', - }) - }) - - it('should call generateFix from tree view item', async function () { - startCodeFixGenerationStub.resolves({ - suggestedFix: { - codeDiff: 'codeDiff', - description: 'description', - references: [], - }, - jobId: 'jobId', - }) - - targetCommand = testCommand(generateFix, mockClient, mockExtContext) - await targetCommand.execute(issueItem, filePath, 'tree') - - assertTelemetry('codewhisperer_codeScanIssueGenerateFix', { - detectorId: codeScanIssue.detectorId, - findingId: codeScanIssue.findingId, - ruleId: codeScanIssue.ruleId, - component: 'tree', - result: 'Succeeded', - }) - }) - - it('should call generateFix with refresh=true to indicate fix regenerated', async function () { - startCodeFixGenerationStub.resolves({ - suggestedFix: { - codeDiff: 'codeDiff', - description: 'description', - references: [], - }, - jobId: 'jobId', - }) - - targetCommand = testCommand(generateFix, mockClient, mockExtContext) - await targetCommand.execute(codeScanIssue, filePath, 'webview', true) - - assertTelemetry('codewhisperer_codeScanIssueGenerateFix', { - detectorId: codeScanIssue.detectorId, - findingId: codeScanIssue.findingId, - ruleId: codeScanIssue.ruleId, - component: 'webview', - result: 'Succeeded', - variant: 'refresh', - }) - }) - - it('should handle generateFix error', async function () { - startCodeFixGenerationStub.throws(new Error('Unexpected error')) - - targetCommand = testCommand(generateFix, mockClient, mockExtContext) - await targetCommand.execute(codeScanIssue, filePath, 'webview') - - assert.ok(updateSecurityIssueWebviewMock.calledWith(sinon.match({ isGenerateFixLoading: true }))) - assert.ok( - updateSecurityIssueWebviewMock.calledWith( - sinon.match({ - issue: codeScanIssue, - isGenerateFixLoading: false, - generateFixError: 'Unexpected error', - shouldRefreshView: false, - }) - ) - ) - assert.ok(updateIssueMock.calledWith(codeScanIssue, filePath)) - assert.ok(refreshTreeViewMock.calledOnce) - - assertTelemetry('codewhisperer_codeScanIssueGenerateFix', { - detectorId: codeScanIssue.detectorId, - findingId: codeScanIssue.findingId, - ruleId: codeScanIssue.ruleId, - component: 'webview', - result: 'Failed', - reason: 'Error', - reasonDesc: 'Unexpected error', - }) - }) - - it('exits early for SAS findings', async function () { - targetCommand = testCommand(generateFix, mockClient, mockExtContext) - codeScanIssue = createCodeScanIssue({ - ruleId: CodeWhispererConstants.sasRuleId, - }) - issueItem = new IssueItem(filePath, codeScanIssue) - await targetCommand.execute(codeScanIssue, filePath, 'webview') - assert.ok(updateSecurityIssueWebviewMock.notCalled) - assert.ok(startCodeFixGenerationStub.notCalled) - assert.ok(updateIssueMock.notCalled) - assert.ok(refreshTreeViewMock.notCalled) - assertNoTelemetryMatch('codewhisperer_codeScanIssueGenerateFix') - }) - }) + // TODO: Add integ test for generateTest describe('rejectFix', function () { let mockExtensionContext: vscode.ExtensionContext @@ -1150,51 +981,4 @@ def execute_input_compliant(): }) }) }) - - describe('regenerateFix', function () { - let sandbox: sinon.SinonSandbox - let filePath: string - let codeScanIssue: CodeScanIssue - let issueItem: IssueItem - let rejectFixMock: sinon.SinonStub - let generateFixMock: sinon.SinonStub - - beforeEach(function () { - sandbox = sinon.createSandbox() - filePath = 'dummy/file.py' - codeScanIssue = createCodeScanIssue({ - findingId: randomUUID(), - suggestedFixes: [{ code: 'diff', description: 'description' }], - }) - issueItem = new IssueItem(filePath, codeScanIssue) - rejectFixMock = sinon.stub() - generateFixMock = sinon.stub() - }) - - afterEach(function () { - sandbox.restore() - }) - - it('should call regenerateFix command successfully', async function () { - const updatedIssue = createCodeScanIssue({ findingId: 'updatedIssue' }) - sinon.stub(rejectFix, 'execute').value(rejectFixMock.resolves(updatedIssue)) - sinon.stub(generateFix, 'execute').value(generateFixMock) - targetCommand = testCommand(regenerateFix) - await targetCommand.execute(codeScanIssue, filePath) - - assert.ok(rejectFixMock.calledWith(codeScanIssue, filePath)) - assert.ok(generateFixMock.calledWith(updatedIssue, filePath)) - }) - - it('should call regenerateFix from tree view item', async function () { - const updatedIssue = createCodeScanIssue({ findingId: 'updatedIssue' }) - sinon.stub(rejectFix, 'execute').value(rejectFixMock.resolves(updatedIssue)) - sinon.stub(generateFix, 'execute').value(generateFixMock) - targetCommand = testCommand(regenerateFix) - await targetCommand.execute(issueItem, filePath) - - assert.ok(rejectFixMock.calledWith(codeScanIssue, filePath)) - assert.ok(generateFixMock.calledWith(updatedIssue, filePath)) - }) - }) }) diff --git a/packages/core/src/test/codewhisperer/commands/transformByQ.test.ts b/packages/core/src/test/codewhisperer/commands/transformByQ.test.ts index edb2524ee68..8d2017100b9 100644 --- a/packages/core/src/test/codewhisperer/commands/transformByQ.test.ts +++ b/packages/core/src/test/codewhisperer/commands/transformByQ.test.ts @@ -53,18 +53,21 @@ import * as nodefs from 'fs' // eslint-disable-line no-restricted-imports describe('transformByQ', function () { let fetchStub: sinon.SinonStub let tempDir: string - const validCustomVersionsFile = `name: "custom-dependency-management" + const validCustomVersionsFile = `name: "dependency-upgrade" description: "Custom dependency version management for Java migration from JDK 8/11/17 to JDK 17/21" dependencyManagement: dependencies: - identifier: "com.example:library1" - targetVersion: "2.1.0" - versionProperty: "library1.version" - originType: "FIRST_PARTY" + targetVersion: "2.1.0" + versionProperty: "library1.version" # Optional + originType: "FIRST_PARTY" # or "THIRD_PARTY" + - identifier: "com.example:library2" + targetVersion: "3.0.0" + originType: "THIRD_PARTY" plugins: - - identifier: "com.example.plugin" - targetVersion: "1.2.0" - versionProperty: "plugin.version"` + - identifier: "com.example:plugin" + targetVersion: "1.2.0" + versionProperty: "plugin.version" # Optional` const validSctFile = ` @@ -119,6 +122,7 @@ dependencyManagement: }) afterEach(async function () { + fetchStub.restore() sinon.restore() await fs.delete(tempDir, { recursive: true }) }) @@ -405,7 +409,6 @@ dependencyManagement: path: tempDir, name: tempFileName, }, - humanInTheLoopFlag: false, projectPath: tempDir, zipManifest: transformManifest, }).then((zipCodeResult) => { @@ -462,7 +465,7 @@ dependencyManagement: ] for (const folder of m2Folders) { - const folderPath = path.join(tempDir, folder) + const folderPath = path.join(tempDir, 'dependencies', folder) await fs.mkdir(folderPath) for (const file of filesToAdd) { await fs.writeFile(path.join(folderPath, file), 'sample content for the test file') @@ -476,7 +479,6 @@ dependencyManagement: path: tempDir, name: tempFileName, }, - humanInTheLoopFlag: false, projectPath: tempDir, zipManifest: new ZipManifest(), }).then((zipCodeResult) => { @@ -569,14 +571,14 @@ dependencyManagement: }) it(`WHEN validateCustomVersionsFile on fully valid .yaml file THEN passes validation`, async function () { - const isValidFile = await validateCustomVersionsFile(validCustomVersionsFile) - assert.strictEqual(isValidFile, true) + const missingKey = await validateCustomVersionsFile(validCustomVersionsFile) + assert.strictEqual(missingKey, undefined) }) it(`WHEN validateCustomVersionsFile on invalid .yaml file THEN fails validation`, async function () { const invalidFile = validCustomVersionsFile.replace('dependencyManagement', 'invalidKey') - const isValidFile = await validateCustomVersionsFile(invalidFile) - assert.strictEqual(isValidFile, false) + const missingKey = await validateCustomVersionsFile(invalidFile) + assert.strictEqual(missingKey, 'dependencyManagement') }) it(`WHEN validateMetadataFile on fully valid .sct file THEN passes validation`, async function () { @@ -662,7 +664,6 @@ dependencyManagement: message: expectedMessage, } ) - sinon.assert.callCount(fetchStub, 4) }) it('should not retry upload on non-retriable error', async () => { diff --git a/packages/core/src/test/codewhisperer/mergeIssuesDisplayFindings.test.ts b/packages/core/src/test/codewhisperer/mergeIssuesDisplayFindings.test.ts new file mode 100644 index 00000000000..3a8c06a3c7d --- /dev/null +++ b/packages/core/src/test/codewhisperer/mergeIssuesDisplayFindings.test.ts @@ -0,0 +1,88 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import assert from 'assert' +import { SecurityIssueProvider } from '../../codewhisperer/service/securityIssueProvider' +import { createCodeScanIssue } from './testUtil' +import { displayFindingsDetectorName } from '../../codewhisperer/models/constants' +import { AggregatedCodeScanIssue } from '../../codewhisperer/models/model' + +describe('mergeIssuesDisplayFindings', () => { + let provider: SecurityIssueProvider + const testFilePath = '/test/file.py' + + beforeEach(() => { + provider = Object.create(SecurityIssueProvider.prototype) + provider.issues = [] + }) + + it('should add new issues when no existing group', () => { + const newIssues: AggregatedCodeScanIssue = { + filePath: testFilePath, + issues: [createCodeScanIssue({ findingId: 'new-1' })], + } + + provider.mergeIssuesDisplayFindings(newIssues, true) + + assert.strictEqual(provider.issues.length, 1) + assert.strictEqual(provider.issues[0].filePath, testFilePath) + assert.strictEqual(provider.issues[0].issues.length, 1) + assert.strictEqual(provider.issues[0].issues[0].findingId, 'new-1') + }) + + it('should keep displayFindings when fromQCA is true', () => { + provider.issues = [ + { + filePath: testFilePath, + issues: [ + createCodeScanIssue({ findingId: 'qca-1', detectorName: 'QCA-detector' }), + createCodeScanIssue({ findingId: 'display-1', detectorName: displayFindingsDetectorName }), + ], + }, + ] + + const newIssues: AggregatedCodeScanIssue = { + filePath: testFilePath, + issues: [createCodeScanIssue({ findingId: 'new-qca-1', detectorName: 'QCA-detector' })], + } + + provider.mergeIssuesDisplayFindings(newIssues, true) + + assert.strictEqual(provider.issues.length, 1) + assert.strictEqual(provider.issues[0].issues.length, 2) + + const findingIds = provider.issues[0].issues.map((issue) => issue.findingId) + assert.ok(findingIds.includes('display-1')) + assert.ok(findingIds.includes('new-qca-1')) + assert.ok(!findingIds.includes('qca-1')) + }) + + it('should keep QCA findings when fromQCA is false', () => { + provider.issues = [ + { + filePath: testFilePath, + issues: [ + createCodeScanIssue({ findingId: 'qca-1', detectorName: 'QCA-detector' }), + createCodeScanIssue({ findingId: 'display-1', detectorName: displayFindingsDetectorName }), + ], + }, + ] + + const newIssues: AggregatedCodeScanIssue = { + filePath: testFilePath, + issues: [createCodeScanIssue({ findingId: 'new-display-1', detectorName: displayFindingsDetectorName })], + } + + provider.mergeIssuesDisplayFindings(newIssues, false) + + assert.strictEqual(provider.issues.length, 1) + assert.strictEqual(provider.issues[0].issues.length, 2) + + const findingIds = provider.issues[0].issues.map((issue) => issue.findingId) + assert.ok(findingIds.includes('qca-1')) + assert.ok(findingIds.includes('new-display-1')) + assert.ok(!findingIds.includes('display-1')) + }) +}) diff --git a/packages/core/src/test/codewhisperer/zipUtil.test.ts b/packages/core/src/test/codewhisperer/zipUtil.test.ts index e6c4f4148e5..102bf2fc441 100644 --- a/packages/core/src/test/codewhisperer/zipUtil.test.ts +++ b/packages/core/src/test/codewhisperer/zipUtil.test.ts @@ -7,15 +7,12 @@ import assert from 'assert' import vscode from 'vscode' import sinon from 'sinon' import { join } from 'path' -import path from 'path' import JSZip from 'jszip' import { getTestWorkspaceFolder } from '../../testInteg/integrationTestsUtilities' import { ZipUtil } from '../../codewhisperer/util/zipUtil' import { CodeAnalysisScope, codeScanTruncDirPrefix } from '../../codewhisperer/models/constants' import { ToolkitError } from '../../shared/errors' import { fs } from '../../shared/fs/fs' -import { tempDirPath } from '../../shared/filesystemUtilities' -import { CodeWhispererConstants } from '../../codewhisperer/indexNode' describe('zipUtil', function () { const workspaceFolder = getTestWorkspaceFolder() @@ -140,43 +137,4 @@ describe('zipUtil', function () { assert.ok(files.includes(join('workspaceFolder', 'workspaceFolder', 'App.java'))) }) }) - - describe('generateZipTestGen', function () { - let zipUtil: ZipUtil - let getZipDirPathStub: sinon.SinonStub - let testTempDirPath: string - - beforeEach(function () { - zipUtil = new ZipUtil() - testTempDirPath = path.join(tempDirPath, CodeWhispererConstants.TestGenerationTruncDirPrefix) - getZipDirPathStub = sinon.stub(zipUtil, 'getZipDirPath') - getZipDirPathStub.callsFake(() => testTempDirPath) - }) - - afterEach(function () { - sinon.restore() - }) - - it('should generate zip for test generation successfully', async function () { - const mkdirSpy = sinon.spy(fs, 'mkdir') - - const result = await zipUtil.generateZipTestGen(appRoot, false) - - assert.ok(mkdirSpy.calledWith(path.join(testTempDirPath, 'utgRequiredArtifactsDir'))) - assert.ok( - mkdirSpy.calledWith(path.join(testTempDirPath, 'utgRequiredArtifactsDir', 'buildAndExecuteLogDir')) - ) - assert.ok(mkdirSpy.calledWith(path.join(testTempDirPath, 'utgRequiredArtifactsDir', 'repoMapData'))) - assert.ok(mkdirSpy.calledWith(path.join(testTempDirPath, 'utgRequiredArtifactsDir', 'testCoverageDir'))) - - assert.strictEqual(result.rootDir, testTempDirPath) - assert.strictEqual(result.zipFilePath, testTempDirPath + CodeWhispererConstants.codeScanZipExt) - assert.ok(result.srcPayloadSizeInBytes > 0) - assert.strictEqual(result.buildPayloadSizeInBytes, 0) - assert.ok(result.zipFileSizeInBytes > 0) - assert.strictEqual(result.lines, 150) - assert.strictEqual(result.language, 'java') - assert.strictEqual(result.scannedFiles.size, 4) - }) - }) }) diff --git a/packages/core/src/test/credentials/auth.test.ts b/packages/core/src/test/credentials/auth.test.ts index 022e2c5c6e7..a409f2ba2e2 100644 --- a/packages/core/src/test/credentials/auth.test.ts +++ b/packages/core/src/test/credentials/auth.test.ts @@ -570,6 +570,47 @@ describe('Auth', function () { assert.strictEqual((await promptForConnection(auth))?.id, conn.id) }) + it('shows a second quickPick for linked IAM profiles when selecting an SSO connection', async function () { + let quickPickCount = 0 + getTestWindow().onDidShowQuickPick(async (picker) => { + await picker.untilReady() + quickPickCount++ + + if (quickPickCount === 1) { + // First picker: select the SSO connection + const connItem = picker.findItemOrThrow(/IAM Identity Center/) + picker.acceptItem(connItem) + } else if (quickPickCount === 2) { + // Second picker: select the linked IAM profile + const linkedItem = picker.findItemOrThrow(/TestRole/) + picker.acceptItem(linkedItem) + } + }) + + const linkedSsoProfile = createSsoProfile({ scopes: scopesSsoAccountAccess }) + const conn = await auth.createConnection(linkedSsoProfile) + + // Mock the SSOClient to return account roles + auth.ssoClient.listAccounts.returns( + toCollection(async function* () { + yield [{ accountId: '123456789012' }] + }) + ) + auth.ssoClient.listAccountRoles.callsFake(() => + toCollection(async function* () { + yield [{ accountId: '123456789012', roleName: 'TestRole' }] + }) + ) + + // Should get a linked IAM profile back, not the SSO connection + const result = await promptForConnection(auth) + assert.ok(isIamConnection(result || undefined), 'Expected an IAM connection to be returned') + assert.ok( + result?.id.startsWith(`sso:${conn.id}#`), + 'Expected the IAM connection to be linked to the SSO connection' + ) + }) + it('refreshes when clicking the refresh button', async function () { getTestWindow().onDidShowQuickPick(async (picker) => { await picker.untilReady() diff --git a/packages/core/src/test/feedback/commands/submitFeedbackListener.test.ts b/packages/core/src/test/feedback/commands/submitFeedbackListener.test.ts index 176e12974ea..3fbf666a6ea 100644 --- a/packages/core/src/test/feedback/commands/submitFeedbackListener.test.ts +++ b/packages/core/src/test/feedback/commands/submitFeedbackListener.test.ts @@ -10,9 +10,14 @@ import { FeedbackWebview } from '../../../feedback/vue/submitFeedback' import sinon from 'sinon' import { waitUntil } from '../../../shared' -const comment = 'comment' +const comment = + 'This is a detailed feedback comment that meets the minimum length requirement. ' + + 'It includes specific information about the issue, steps to reproduce, expected behavior, and actual behavior. ' + + 'This comment is long enough to pass the 188 character validation rule.' const sentiment = 'Positive' const message = { command: 'submitFeedback', comment: comment, sentiment: sentiment } +const shortComment = 'This is a short comment' +const shortMessage = { command: 'submitFeedback', comment: shortComment, sentiment: sentiment } describe('submitFeedbackListener', function () { let mockTelemetry: TelemetryService @@ -47,5 +52,14 @@ describe('submitFeedbackListener', function () { const result = await webview.submit(message) assert.strictEqual(result, expectedError) }) + + it(`validates ${productName} feedback comment length is at least 188 characters`, async function () { + const postStub = sinon.stub() + mockTelemetry.postFeedback = postStub + const webview = new FeedbackWebview(mockTelemetry, productName) + const result = await webview.submit(shortMessage) + assert.strictEqual(result, 'Please add atleast 100 characters in the template describing your issue.') + assert.strictEqual(postStub.called, false, 'postFeedback should not be called for short comments') + }) } }) diff --git a/packages/core/src/test/index.ts b/packages/core/src/test/index.ts index 9a01973e26d..c682b1f367e 100644 --- a/packages/core/src/test/index.ts +++ b/packages/core/src/test/index.ts @@ -22,6 +22,5 @@ export { getTestWorkspaceFolder } from '../testInteg/integrationTestsUtilities' export * from './codewhisperer/testUtil' export * from './credentials/testUtil' export * from './testUtil' -export * from './amazonq/utils' export * from './fake/mockFeatureConfigData' export * from './shared/ui/testUtils' diff --git a/packages/core/src/test/lambda/commands/deleteLambda.test.ts b/packages/core/src/test/lambda/commands/deleteLambda.test.ts index 366d7344ef6..8da82c2c21e 100644 --- a/packages/core/src/test/lambda/commands/deleteLambda.test.ts +++ b/packages/core/src/test/lambda/commands/deleteLambda.test.ts @@ -11,7 +11,7 @@ import { stub } from '../../utilities/stubber' describe('deleteLambda', async function () { function createLambdaClient() { - const client = stub(DefaultLambdaClient, { regionCode: 'region-1' }) + const client = stub(DefaultLambdaClient, { regionCode: 'region-1', userAgent: undefined }) client.deleteFunction.resolves() return client diff --git a/packages/core/src/test/lambda/commands/editLambda.test.ts b/packages/core/src/test/lambda/commands/editLambda.test.ts new file mode 100644 index 00000000000..44d874c14fe --- /dev/null +++ b/packages/core/src/test/lambda/commands/editLambda.test.ts @@ -0,0 +1,307 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as vscode from 'vscode' +import assert from 'assert' +import * as sinon from 'sinon' +import { + editLambda, + watchForUpdates, + promptForSync, + deployFromTemp, + getReadme, + deleteFilesInFolder, + overwriteChangesForEdit, +} from '../../../lambda/commands/editLambda' +import { LambdaFunction } from '../../../lambda/commands/uploadLambda' +import * as downloadLambda from '../../../lambda/commands/downloadLambda' +import * as uploadLambda from '../../../lambda/commands/uploadLambda' +import * as utils from '../../../lambda/utils' +import * as messages from '../../../shared/utilities/messages' +import fs from '../../../shared/fs/fs' +import { LambdaFunctionNodeDecorationProvider } from '../../../lambda/explorer/lambdaFunctionNodeDecorationProvider' +import path from 'path' +import globals from '../../../shared/extensionGlobals' +import { lambdaTempPath } from '../../../lambda/utils' + +describe('editLambda', function () { + let mockLambda: LambdaFunction + let mockTemp: string + let mockUri: vscode.Uri + + // Stub variables + let getFunctionInfoStub: sinon.SinonStub + let setFunctionInfoStub: sinon.SinonStub + let compareCodeShaStub: sinon.SinonStub + let downloadLambdaStub: sinon.SinonStub + let openLambdaFileStub: sinon.SinonStub + let runUploadDirectoryStub: sinon.SinonStub + let showConfirmationMessageStub: sinon.SinonStub + let createFileSystemWatcherStub: sinon.SinonStub + let existsDirStub: sinon.SinonStub + let mkdirStub: sinon.SinonStub + let promptDeployStub: sinon.SinonStub + let readdirStub: sinon.SinonStub + let readFileTextStub: sinon.SinonStub + let writeFileStub: sinon.SinonStub + let copyStub: sinon.SinonStub + let asAbsolutePathStub: sinon.SinonStub + let deleteStub: sinon.SinonStub + + beforeEach(function () { + mockLambda = { + name: 'test-function', + region: 'us-east-1', + configuration: { + FunctionName: 'test-function', + CodeSha256: 'test-sha', + Runtime: 'nodejs18.x', + }, + } + mockTemp = utils.getTempLocation(mockLambda.name, mockLambda.region) + mockUri = vscode.Uri.file(mockTemp) + + // Create stubs + getFunctionInfoStub = sinon.stub(utils, 'getFunctionInfo').resolves(undefined) + setFunctionInfoStub = sinon.stub(utils, 'setFunctionInfo').resolves() + compareCodeShaStub = sinon.stub(utils, 'compareCodeSha').resolves(true) + downloadLambdaStub = sinon.stub(downloadLambda, 'downloadLambdaInLocation').resolves() + openLambdaFileStub = sinon.stub(downloadLambda, 'openLambdaFile').resolves() + runUploadDirectoryStub = sinon.stub(uploadLambda, 'runUploadDirectory').resolves() + showConfirmationMessageStub = sinon.stub(messages, 'showConfirmationMessage').resolves(true) + createFileSystemWatcherStub = sinon.stub(vscode.workspace, 'createFileSystemWatcher').returns({ + onDidChange: sinon.stub(), + onDidCreate: sinon.stub(), + onDidDelete: sinon.stub(), + dispose: sinon.stub(), + } as any) + existsDirStub = sinon.stub(fs, 'existsDir').resolves(true) + mkdirStub = sinon.stub(fs, 'mkdir').resolves() + readdirStub = sinon.stub(fs, 'readdir').resolves([['file', vscode.FileType.File]]) + promptDeployStub = sinon.stub().resolves(true) + sinon.replace(require('../../../lambda/commands/editLambda'), 'promptDeploy', promptDeployStub) + readFileTextStub = sinon.stub(fs, 'readFileText').resolves('# Lambda Edit README') + writeFileStub = sinon.stub(fs, 'writeFile').resolves() + copyStub = sinon.stub(fs, 'copy').resolves() + asAbsolutePathStub = sinon.stub(globals.context, 'asAbsolutePath').callsFake((p) => `/absolute/${p}`) + deleteStub = sinon.stub(fs, 'delete').resolves() + + // Other stubs + sinon.stub(utils, 'getLambdaDetails').returns({ fileName: 'index.js', functionName: 'test-function' }) + sinon.stub(fs, 'stat').resolves({ ctime: Date.now() } as any) + sinon.stub(vscode.workspace, 'saveAll').resolves(true) + sinon.stub(LambdaFunctionNodeDecorationProvider.prototype, 'addBadge').resolves() + sinon.stub(LambdaFunctionNodeDecorationProvider.prototype, 'removeBadge').resolves() + sinon.stub(LambdaFunctionNodeDecorationProvider, 'getInstance').returns({ + addBadge: sinon.stub().resolves(), + removeBadge: sinon.stub().resolves(), + } as any) + }) + + afterEach(function () { + sinon.restore() + }) + + describe('editLambda', function () { + it('returns early if folder already exists in workspace', async function () { + sinon.stub(vscode.workspace, 'workspaceFolders').value([{ uri: vscode.Uri.file(mockTemp) }]) + + const result = await editLambda(mockLambda) + + assert.strictEqual(result, mockTemp) + }) + + it('downloads lambda when no local code exists', async function () { + await editLambda(mockLambda) + + assert(downloadLambdaStub.calledOnce) + }) + + it('prompts for overwrite when local code differs from remote', async function () { + getFunctionInfoStub.resolves('old-sha') + compareCodeShaStub.resolves(false) + + await editLambda(mockLambda) + + assert(showConfirmationMessageStub.calledOnce) + }) + + it('opens existing file when user declines overwrite', async function () { + getFunctionInfoStub.resolves('old-sha') + compareCodeShaStub.resolves(false) + showConfirmationMessageStub.resolves(false) + + // Specify that it's from the explorer because otherwise there's no need to open + await editLambda(mockLambda, 'explorer') + + assert(openLambdaFileStub.calledOnce) + }) + + it('downloads lambda when directory exists but is empty', async function () { + getFunctionInfoStub.resolves('old-sha') + readdirStub.resolves([]) + + await editLambda(mockLambda) + + assert(downloadLambdaStub.calledOnce) + assert(showConfirmationMessageStub.notCalled) + }) + + it('downloads lambda when directory does not exist', async function () { + getFunctionInfoStub.resolves('old-sha') + existsDirStub.resolves(false) + + await editLambda(mockLambda) + + assert(downloadLambdaStub.calledOnce) + assert(showConfirmationMessageStub.notCalled) + }) + + it('sets up file watcher after download', async function () { + const watcherStub = { + onDidChange: sinon.stub(), + onDidCreate: sinon.stub(), + onDidDelete: sinon.stub(), + } + createFileSystemWatcherStub.returns(watcherStub) + + await editLambda(mockLambda) + + assert(watcherStub.onDidChange.calledOnce) + assert(watcherStub.onDidCreate.calledOnce) + assert(watcherStub.onDidDelete.calledOnce) + }) + }) + + describe('watchForUpdates', function () { + it('creates file system watcher with correct pattern', function () { + const watcher = { + onDidChange: sinon.stub(), + onDidCreate: sinon.stub(), + onDidDelete: sinon.stub(), + } + createFileSystemWatcherStub.returns(watcher) + + watchForUpdates(mockLambda, mockUri) + + assert(createFileSystemWatcherStub.calledOnce) + const pattern = createFileSystemWatcherStub.firstCall.args[0] + assert(pattern instanceof vscode.RelativePattern) + }) + + it('sets up change, create, and delete handlers', function () { + const watcher = { + onDidChange: sinon.stub(), + onDidCreate: sinon.stub(), + onDidDelete: sinon.stub(), + } + createFileSystemWatcherStub.returns(watcher) + + watchForUpdates(mockLambda, mockUri) + + assert(watcher.onDidChange.calledOnce) + assert(watcher.onDidCreate.calledOnce) + assert(watcher.onDidDelete.calledOnce) + }) + }) + + describe('promptForSync', function () { + it('returns early if directory does not exist', async function () { + existsDirStub.resolves(false) + + await promptForSync(mockLambda, mockUri, vscode.Uri.file('/test/file.js')) + + assert(setFunctionInfoStub.notCalled) + }) + }) + + describe('deployFromTemp', function () { + it('uploads without confirmation when code is up to date', async function () { + await deployFromTemp(mockLambda, mockUri) + + assert(showConfirmationMessageStub.notCalled) + assert(runUploadDirectoryStub.calledOnce) + }) + + it('prompts for confirmation when code is outdated', async function () { + compareCodeShaStub.resolves(false) + + await deployFromTemp(mockLambda, mockUri) + + assert(showConfirmationMessageStub.calledOnce) + }) + + it('does not upload when user declines overwrite', async function () { + compareCodeShaStub.resolves(false) + showConfirmationMessageStub.resolves(false) + + await deployFromTemp(mockLambda, mockUri) + + assert(runUploadDirectoryStub.notCalled) + }) + + it('updates function info after successful upload', async function () { + await deployFromTemp(mockLambda, mockUri) + + assert(runUploadDirectoryStub.calledOnce) + assert( + setFunctionInfoStub.calledWith(mockLambda, { + lastDeployed: sinon.match.number, + undeployed: false, + }) + ) + }) + }) + + describe('deleteFilesInFolder', function () { + it('deletes all files in the specified folder', async function () { + readdirStub.resolves([ + ['file1.js', vscode.FileType.File], + ['file2.js', vscode.FileType.File], + ]) + + await deleteFilesInFolder(path.join('test', 'folder')) + + assert(deleteStub.calledTwice) + assert(deleteStub.calledWith(path.join('test', 'folder', 'file1.js'), { recursive: true, force: true })) + assert(deleteStub.calledWith(path.join('test', 'folder', 'file2.js'), { recursive: true, force: true })) + }) + }) + + describe('overwriteChangesForEdit', function () { + it('clears directory and downloads lambda code', async function () { + await overwriteChangesForEdit(mockLambda, mockTemp) + + assert(readdirStub.calledWith(mockTemp)) + assert(downloadLambdaStub.calledWith(mockLambda, 'local', mockTemp)) + assert(setFunctionInfoStub.calledWith(mockLambda, sinon.match.object)) + }) + + it('creates directory if it does not exist', async function () { + existsDirStub.resolves(false) + + await overwriteChangesForEdit(mockLambda, mockTemp) + + assert(mkdirStub.calledWith(mockTemp)) + }) + }) + + describe('getReadme', function () { + it('reads markdown file and writes README.md to temp path', async function () { + const result = await getReadme() + + assert(readFileTextStub.calledOnce) + assert(asAbsolutePathStub.calledWith(path.join('resources', 'markdown', 'lambdaEdit.md'))) + assert(writeFileStub.calledWith(path.join(lambdaTempPath, 'README.md'), '# Lambda Edit README')) + assert.strictEqual(result, path.join(lambdaTempPath, 'README.md')) + }) + + it('copies all required icon files', async function () { + await getReadme() + + assert.strictEqual(copyStub.callCount, 3) + }) + }) +}) diff --git a/packages/core/src/test/lambda/explorer/cloudFormationNodes.test.ts b/packages/core/src/test/lambda/explorer/cloudFormationNodes.test.ts index 8cbeedf25f3..ba8d7ccd516 100644 --- a/packages/core/src/test/lambda/explorer/cloudFormationNodes.test.ts +++ b/packages/core/src/test/lambda/explorer/cloudFormationNodes.test.ts @@ -26,7 +26,7 @@ import { getLabel } from '../../../shared/treeview/utils' const regionCode = 'someregioncode' function createLambdaClient(...functionNames: string[]) { - const client = stub(DefaultLambdaClient, { regionCode }) + const client = stub(DefaultLambdaClient, { regionCode, userAgent: undefined }) client.listFunctions.returns(asyncGenerator(functionNames.map((name) => ({ FunctionName: name })))) return client diff --git a/packages/core/src/test/lambda/explorer/lambdaFunctionFileNode.test.ts b/packages/core/src/test/lambda/explorer/lambdaFunctionFileNode.test.ts new file mode 100644 index 00000000000..59235bf7558 --- /dev/null +++ b/packages/core/src/test/lambda/explorer/lambdaFunctionFileNode.test.ts @@ -0,0 +1,58 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import assert from 'assert' +import { LambdaFunctionNode } from '../../../lambda/explorer/lambdaFunctionNode' +import { TestAWSTreeNode } from '../../shared/treeview/nodes/testAWSTreeNode' +import { LambdaFunctionFileNode } from '../../../lambda/explorer/lambdaFunctionFileNode' +import path from 'path' + +describe('LambdaFunctionFileNode', function () { + const fakeFunctionConfig = { + FunctionName: 'testFunctionName', + FunctionArn: 'testFunctionARN', + } + const fakeFilename = 'fakeFile' + const fakeRegion = 'fakeRegion' + const functionNode = new LambdaFunctionNode(new TestAWSTreeNode('test node'), fakeRegion, fakeFunctionConfig) + const filePath = path.join( + '/tmp/aws-toolkit-vscode/lambda', + fakeRegion, + fakeFunctionConfig.FunctionName, + fakeFilename + ) + + let testNode: LambdaFunctionFileNode + + before(async function () { + testNode = new LambdaFunctionFileNode(functionNode, fakeFilename, filePath) + }) + + it('instantiates without issue', function () { + assert.ok(testNode) + }) + + it('initializes the parent node', function () { + assert.equal(testNode.parent, functionNode, 'unexpected parent node') + }) + + it('initializes the label', function () { + assert.equal(testNode.label, fakeFilename) + }) + + it('has no children', async function () { + const childNodes = await testNode.getChildren() + assert.ok(childNodes) + assert.strictEqual(childNodes.length, 0, 'Expected zero children') + }) + + it('has correct command', function () { + assert.deepStrictEqual(testNode.command, { + command: 'aws.openLambdaFile', + title: 'Open file', + arguments: [filePath], + }) + }) +}) diff --git a/packages/core/src/test/lambda/explorer/lambdaFunctionFolderNode.test.ts b/packages/core/src/test/lambda/explorer/lambdaFunctionFolderNode.test.ts new file mode 100644 index 00000000000..67471bc4e24 --- /dev/null +++ b/packages/core/src/test/lambda/explorer/lambdaFunctionFolderNode.test.ts @@ -0,0 +1,57 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import assert from 'assert' +import { LambdaFunctionNode } from '../../../lambda/explorer/lambdaFunctionNode' +import { TestAWSTreeNode } from '../../shared/treeview/nodes/testAWSTreeNode' +import path from 'path' +import { LambdaFunctionFolderNode } from '../../../lambda/explorer/lambdaFunctionFolderNode' +import { fs } from '../../../shared/fs/fs' + +describe('LambdaFunctionFileNode', function () { + const fakeFunctionConfig = { + FunctionName: 'testFunctionName', + FunctionArn: 'testFunctionARN', + } + const fakeRegion = 'fakeRegion' + const fakeSubFolder = 'fakeSubFolder' + const fakeFile = 'fakeFilename' + const functionNode = new LambdaFunctionNode(new TestAWSTreeNode('test node'), fakeRegion, fakeFunctionConfig) + + const regionPath = path.join('/tmp/aws-toolkit-vscode/lambda', fakeRegion) + const functionPath = path.join(regionPath, fakeFunctionConfig.FunctionName) + const subFolderPath = path.join(functionPath, fakeSubFolder) + + let testNode: LambdaFunctionFolderNode + + before(async function () { + await fs.mkdir(subFolderPath) + await fs.writeFile(path.join(subFolderPath, fakeFile), 'fakefilecontent') + + testNode = new LambdaFunctionFolderNode(functionNode, fakeSubFolder, subFolderPath) + }) + + after(async function () { + await fs.delete(regionPath, { recursive: true }) + }) + + it('instantiates without issue', function () { + assert.ok(testNode) + }) + + it('initializes the parent node', function () { + assert.equal(testNode.parent, functionNode, 'unexpected parent node') + }) + + it('initializes the label', function () { + assert.equal(testNode.label, fakeSubFolder) + }) + + it('loads function files', async function () { + const functionFiles = await testNode.loadFunctionFiles() + assert.equal(functionFiles.length, 1) + assert.equal(functionFiles[0].label, fakeFile) + }) +}) diff --git a/packages/core/src/test/lambda/explorer/lambdaFunctionNode.test.ts b/packages/core/src/test/lambda/explorer/lambdaFunctionNode.test.ts index cb9ffc9b5f2..184bdd915b8 100644 --- a/packages/core/src/test/lambda/explorer/lambdaFunctionNode.test.ts +++ b/packages/core/src/test/lambda/explorer/lambdaFunctionNode.test.ts @@ -4,23 +4,54 @@ */ import assert from 'assert' -import { Lambda } from 'aws-sdk' import * as os from 'os' import { LambdaFunctionNode } from '../../../lambda/explorer/lambdaFunctionNode' import { TestAWSTreeNode } from '../../shared/treeview/nodes/testAWSTreeNode' +import path from 'path' +import { fs } from '../../../shared/fs/fs' +import { + contextValueLambdaFunction, + contextValueLambdaFunctionImportable, +} from '../../../lambda/explorer/lambdaFunctionNode' +import sinon from 'sinon' +import * as editLambdaModule from '../../../lambda/commands/editLambda' describe('LambdaFunctionNode', function () { const parentNode = new TestAWSTreeNode('test node') + const fakeRegion = 'fakeRegion' + const fakeFilename = 'fakeFilename' + + const fakeFunctionConfig = { + FunctionName: 'testFunctionName', + FunctionArn: 'testFunctionARN', + } + + const regionPath = path.join('/tmp/aws-toolkit-vscode/lambda', fakeRegion) + const functionPath = path.join(regionPath, fakeFunctionConfig.FunctionName) + const filePath = path.join(functionPath, fakeFilename) + let testNode: LambdaFunctionNode - let fakeFunctionConfig: Lambda.FunctionConfiguration - before(function () { - fakeFunctionConfig = { - FunctionName: 'testFunctionName', - FunctionArn: 'testFunctionARN', - } + let editLambdaStub: sinon.SinonStub + + before(async function () { + await fs.mkdir(functionPath) + await fs.writeFile(filePath, 'fakefilecontent') + + // Stub the editLambdaCommand to return the function path + editLambdaStub = sinon.stub(editLambdaModule, 'editLambdaCommand').resolves(functionPath) + + testNode = new LambdaFunctionNode( + parentNode, + 'someregioncode', + fakeFunctionConfig, + contextValueLambdaFunctionImportable + ) + }) - testNode = new LambdaFunctionNode(parentNode, 'someregioncode', fakeFunctionConfig) + after(async function () { + await fs.delete(regionPath, { recursive: true }) + editLambdaStub.restore() }) it('instantiates without issue', async function () { @@ -43,6 +74,11 @@ describe('LambdaFunctionNode', function () { assert.strictEqual(testNode.functionName, fakeFunctionConfig.FunctionName) }) + it('initializes resourceUri', async function () { + assert.strictEqual(testNode.resourceUri?.scheme, 'lambda') + assert.strictEqual(testNode.resourceUri?.path, `someregioncode/${fakeFunctionConfig.FunctionName}`) + }) + it('initializes the tooltip', async function () { assert.strictEqual( testNode.tooltip, @@ -50,9 +86,27 @@ describe('LambdaFunctionNode', function () { ) }) - it('has no children', async function () { + it('loads function files', async function () { + const functionFiles = await testNode.loadFunctionFiles(functionPath) + assert.equal(functionFiles.length, 1) + assert.equal(functionFiles[0].label, fakeFilename) + }) + + it('has child if importable', async function () { const childNodes = await testNode.getChildren() assert.ok(childNodes) - assert.strictEqual(childNodes.length, 0, 'Expected node to have no children') + assert.equal(childNodes.length, 1, 'Expected node to have one child, should be "failed to load resources"') + }) + + it('is not collapsible if not importable', async function () { + const nonImportableNode = new LambdaFunctionNode( + parentNode, + fakeRegion, + fakeFunctionConfig, + contextValueLambdaFunction + ) + const childNodes = await nonImportableNode.getChildren() + assert.ok(childNodes) + assert.equal(childNodes.length, 0, 'Expected node to have no children') }) }) diff --git a/packages/core/src/test/lambda/explorer/lambdaFunctionNodeDecorationProvider.test.ts b/packages/core/src/test/lambda/explorer/lambdaFunctionNodeDecorationProvider.test.ts new file mode 100644 index 00000000000..19a2662815f --- /dev/null +++ b/packages/core/src/test/lambda/explorer/lambdaFunctionNodeDecorationProvider.test.ts @@ -0,0 +1,147 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import assert from 'assert' +import * as vscode from 'vscode' +import * as sinon from 'sinon' +import * as path from 'path' +import { LambdaFunctionNodeDecorationProvider } from '../../../lambda/explorer/lambdaFunctionNodeDecorationProvider' +import * as utils from '../../../lambda/utils' +import { fs } from '../../../shared/fs/fs' + +describe('LambdaFunctionNodeDecorationProvider', function () { + let provider: LambdaFunctionNodeDecorationProvider + let getFunctionInfoStub: sinon.SinonStub + let fsStatStub: sinon.SinonStub + let fsReaddirStub: sinon.SinonStub + + const filepath = path.join(utils.getTempLocation('test-function', 'us-east-1'), 'index.js') + const functionUri = vscode.Uri.parse('lambda:us-east-1/test-function') + const fileUri = vscode.Uri.file(filepath) + + beforeEach(function () { + provider = LambdaFunctionNodeDecorationProvider.getInstance() + getFunctionInfoStub = sinon.stub(utils, 'getFunctionInfo') + fsStatStub = sinon.stub(fs, 'stat') + fsReaddirStub = sinon.stub(fs, 'readdir') + }) + + afterEach(function () { + sinon.restore() + }) + + describe('provideFileDecoration', function () { + it('returns decoration for lambda URI with undeployed changes', async function () { + getFunctionInfoStub.resolves(true) + + const decoration = await provider.provideFileDecoration(functionUri) + + assert.ok(decoration) + assert.strictEqual(decoration.badge, 'M') + assert.strictEqual(decoration.tooltip, 'This function has undeployed changes') + assert.strictEqual(decoration.propagate, false) + }) + + it('returns undefined for lambda URI without undeployed changes', async function () { + getFunctionInfoStub.resolves(false) + + const decoration = await provider.provideFileDecoration(functionUri) + + assert.strictEqual(decoration, undefined) + }) + + it('returns decoration for file URI with modifications after deployment', async function () { + const lastDeployed = 1 + const fileModified = 2 + + getFunctionInfoStub.resolves({ lastDeployed, undeployed: true }) + fsStatStub.resolves({ mtime: fileModified }) + + const decoration = await provider.provideFileDecoration(fileUri) + + assert.ok(decoration) + assert.strictEqual(decoration.badge, 'M') + assert.strictEqual(decoration.tooltip, 'This function has undeployed changes') + assert.strictEqual(decoration.propagate, true) + }) + + it('returns undefined for file URI without modifications after deployment', async function () { + const lastDeployed = 2 + const fileModified = 1 + + getFunctionInfoStub.resolves({ lastDeployed, undeployed: true }) + fsStatStub.resolves({ mtime: fileModified }) + + const decoration = await provider.provideFileDecoration(fileUri) + + assert.strictEqual(decoration, undefined) + }) + + it('returns undefined for file URI when no deployment info exists', async function () { + getFunctionInfoStub.resolves(undefined) + + const decoration = await provider.provideFileDecoration(fileUri) + + assert.strictEqual(decoration, undefined) + }) + + it('returns undefined for file URI that does not match lambda pattern', async function () { + const uri = vscode.Uri.file(path.join('not', 'in', 'tmp')) + + const decoration = await provider.provideFileDecoration(uri) + + assert.strictEqual(decoration, undefined) + }) + + it('handles errors gracefully when checking file modification', async function () { + getFunctionInfoStub.resolves(0) + fsStatStub.rejects(new Error('File not found')) + + const decoration = await provider.provideFileDecoration(fileUri) + + assert.strictEqual(decoration, undefined) + }) + }) + + describe('addBadge', function () { + it('fires decoration change events for both URIs', async function () { + const fileUri = vscode.Uri.file(path.join('test', 'file.js')) + const functionUri = vscode.Uri.parse('lambda:us-east-1/test-function') + + let eventCount = 0 + const disposable = provider.onDidChangeFileDecorations(() => { + eventCount++ + }) + + await provider.addBadge(fileUri, functionUri) + + assert.strictEqual(eventCount, 2) + disposable.dispose() + }) + }) + + describe('getFilePaths', function () { + it('returns all file paths recursively', async function () { + const basePath = path.join('test', 'dir') + + // Mock first readdir call + fsReaddirStub.onFirstCall().resolves([ + ['file1.js', vscode.FileType.File], + ['subdir', vscode.FileType.Directory], + ]) + + // Mock second readdir call for subdirectory + fsReaddirStub.onSecondCall().resolves([['file2.js', vscode.FileType.File]]) + + // Access private method through any cast for testing + const paths = await (provider as any).getFilePaths(basePath) + + assert.ok(paths.includes(basePath)) + assert.ok(paths.includes(path.join('test', 'dir', 'file1.js'))) + assert.ok(paths.includes(path.join('test', 'dir', 'subdir'))) + assert.ok(paths.includes(path.join('test', 'dir', 'subdir', 'file2.js'))) + }) + }) +}) diff --git a/packages/core/src/test/lambda/explorer/lambdaNodes.test.ts b/packages/core/src/test/lambda/explorer/lambdaNodes.test.ts index ba494680911..86ed7bbe44c 100644 --- a/packages/core/src/test/lambda/explorer/lambdaNodes.test.ts +++ b/packages/core/src/test/lambda/explorer/lambdaNodes.test.ts @@ -4,8 +4,8 @@ */ import assert from 'assert' -import { LambdaFunctionNode } from '../../../lambda/explorer/lambdaFunctionNode' -import { contextValueLambdaFunction, LambdaNode } from '../../../lambda/explorer/lambdaNodes' +import { contextValueLambdaFunction, LambdaFunctionNode } from '../../../lambda/explorer/lambdaFunctionNode' +import { LambdaNode } from '../../../lambda/explorer/lambdaNodes' import { asyncGenerator } from '../../../shared/utilities/collectionUtils' import { assertNodeListOnlyHasErrorNode, @@ -17,7 +17,7 @@ import { DefaultLambdaClient } from '../../../shared/clients/lambdaClient' const regionCode = 'someregioncode' function createLambdaClient(...functionNames: string[]) { - const client = stub(DefaultLambdaClient, { regionCode }) + const client = stub(DefaultLambdaClient, { regionCode, userAgent: undefined }) client.listFunctions.returns(asyncGenerator(functionNames.map((name) => ({ FunctionName: name })))) return client diff --git a/packages/core/src/test/lambda/remoteDebugging/ldkClient.test.ts b/packages/core/src/test/lambda/remoteDebugging/ldkClient.test.ts new file mode 100644 index 00000000000..91f99aa0409 --- /dev/null +++ b/packages/core/src/test/lambda/remoteDebugging/ldkClient.test.ts @@ -0,0 +1,471 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import assert from 'assert' +import sinon from 'sinon' +import { Lambda } from 'aws-sdk' +import { LdkClient, getRegionFromArn, isTunnelInfo } from '../../../lambda/remoteDebugging/ldkClient' +import { LocalProxy } from '../../../lambda/remoteDebugging/localProxy' +import * as utils from '../../../lambda/remoteDebugging/utils' +import * as telemetryUtil from '../../../shared/telemetry/util' +import globals from '../../../shared/extensionGlobals' +import { createMockFunctionConfig, createMockProgress } from './testUtils' + +describe('LdkClient', () => { + let sandbox: sinon.SinonSandbox + let ldkClient: LdkClient + let mockLambdaClient: any + let mockIoTSTClient: any + let mockLocalProxy: any + + beforeEach(() => { + sandbox = sinon.createSandbox() + + // Mock Lambda client + mockLambdaClient = { + getFunction: sandbox.stub(), + updateFunctionConfiguration: sandbox.stub(), + publishVersion: sandbox.stub(), + deleteFunction: sandbox.stub(), + } + sandbox.stub(utils, 'getLambdaClientWithAgent').returns(mockLambdaClient) + + // Mock IoT ST client with proper promise structure + const createPromiseStub = () => sandbox.stub() + mockIoTSTClient = { + listTunnels: sandbox.stub().returns({ promise: createPromiseStub() }), + openTunnel: sandbox.stub().returns({ promise: createPromiseStub() }), + closeTunnel: sandbox.stub().returns({ promise: createPromiseStub() }), + rotateTunnelAccessToken: sandbox.stub().returns({ promise: createPromiseStub() }), + } + sandbox.stub(utils, 'getIoTSTClientWithAgent').resolves(mockIoTSTClient) + + // Mock LocalProxy + mockLocalProxy = { + start: sandbox.stub(), + stop: sandbox.stub(), + } + sandbox.stub(LocalProxy.prototype, 'start').callsFake(mockLocalProxy.start) + sandbox.stub(LocalProxy.prototype, 'stop').callsFake(mockLocalProxy.stop) + + // Mock global state + const stateStorage = new Map() + const mockGlobalState = { + get: (key: string) => stateStorage.get(key), + update: async (key: string, value: any) => { + stateStorage.set(key, value) + return Promise.resolve() + }, + } + sandbox.stub(globals, 'globalState').value(mockGlobalState) + + // Mock telemetry util + sandbox.stub(telemetryUtil, 'getClientId').returns('test-client-id') + ldkClient = LdkClient.instance + ldkClient.dispose() + }) + + afterEach(() => { + sandbox.restore() + }) + + describe('Singleton Pattern', () => { + it('should return the same instance', () => { + const instance1 = LdkClient.instance + const instance2 = LdkClient.instance + assert.strictEqual(instance1, instance2, 'Should return the same singleton instance') + }) + }) + + describe('dispose()', () => { + it('should dispose resources properly', () => { + // Set up a mock local proxy + ;(ldkClient as any).localProxy = mockLocalProxy + + ldkClient.dispose() + + assert(mockLocalProxy.stop.calledOnce, 'Should stop local proxy') + assert.strictEqual((ldkClient as any).localProxy, undefined, 'Should clear local proxy reference') + }) + + it('should clear client caches', () => { + // Add some clients to cache + ;(ldkClient as any).lambdaClientCache.set('us-east-1', mockLambdaClient) + ;(ldkClient as any).lambdaClientCache.set('us-west-2', mockLambdaClient) + + assert.strictEqual((ldkClient as any).lambdaClientCache.size, 2, 'Should have cached clients') + + ldkClient.dispose() + + assert.strictEqual((ldkClient as any).lambdaClientCache.size, 0, 'Should clear Lambda client cache') + }) + }) + + describe('createOrReuseTunnel()', () => { + it('should create new tunnel when none exists', async () => { + mockIoTSTClient.listTunnels().promise.resolves({ tunnelSummaries: [] }) + mockIoTSTClient.openTunnel().promise.resolves({ + tunnelId: 'tunnel-123', + sourceAccessToken: 'source-token', + destinationAccessToken: 'dest-token', + }) + + const result = await ldkClient.createOrReuseTunnel('us-east-1') + + assert(result, 'Should return tunnel info') + assert.strictEqual(result?.tunnelID, 'tunnel-123') + assert.strictEqual(result?.sourceToken, 'source-token') + assert.strictEqual(result?.destinationToken, 'dest-token') + assert(mockIoTSTClient.listTunnels.called, 'Should list existing tunnels') + assert(mockIoTSTClient.openTunnel.called, 'Should create new tunnel') + }) + + it('should reuse existing tunnel with sufficient time remaining', async () => { + const existingTunnel = { + tunnelId: 'existing-tunnel', + description: 'RemoteDebugging+test-client-id', + status: 'OPEN', + createdAt: new Date(Date.now() - 60 * 60 * 1000), // 1 hour ago + } + + mockIoTSTClient.listTunnels().promise.resolves({ tunnelSummaries: [existingTunnel] }) + mockIoTSTClient.rotateTunnelAccessToken().promise.resolves({ + sourceAccessToken: 'rotated-source-token', + destinationAccessToken: 'rotated-dest-token', + }) + + const result = await ldkClient.createOrReuseTunnel('us-east-1') + + assert(result, 'Should return tunnel info') + assert.strictEqual(result?.tunnelID, 'existing-tunnel') + assert.strictEqual(result?.sourceToken, 'rotated-source-token') + assert.strictEqual(result?.destinationToken, 'rotated-dest-token') + }) + + it('should handle tunnel creation errors', async () => { + mockIoTSTClient.listTunnels().promise.resolves({ tunnelSummaries: [] }) + mockIoTSTClient.openTunnel().promise.rejects(new Error('Tunnel creation failed')) + + await assert.rejects( + async () => await ldkClient.createOrReuseTunnel('us-east-1'), + /Error creating\/reusing tunnel/, + 'Should throw error on tunnel creation failure' + ) + }) + }) + + describe('refreshTunnelTokens()', () => { + it('should refresh tunnel tokens successfully', async () => { + mockIoTSTClient.rotateTunnelAccessToken().promise.resolves({ + sourceAccessToken: 'new-source-token', + destinationAccessToken: 'new-dest-token', + }) + + const result = await ldkClient.refreshTunnelTokens('tunnel-123', 'us-east-1') + + assert(result, 'Should return tunnel info') + assert.strictEqual(result?.tunnelID, 'tunnel-123') + assert.strictEqual(result?.sourceToken, 'new-source-token') + assert.strictEqual(result?.destinationToken, 'new-dest-token') + }) + + it('should handle token refresh errors', async () => { + mockIoTSTClient.rotateTunnelAccessToken().promise.rejects(new Error('Token refresh failed')) + + await assert.rejects( + async () => await ldkClient.refreshTunnelTokens('tunnel-123', 'us-east-1'), + /Error refreshing tunnel tokens/, + 'Should throw error on token refresh failure' + ) + }) + }) + + describe('getFunctionDetail()', () => { + const mockFunctionConfig: Lambda.FunctionConfiguration = createMockFunctionConfig({ + FunctionArn: 'arn:aws:lambda:us-east-1:123456789012:function:testFunction', + }) + + it('should get function details successfully', async () => { + mockLambdaClient.getFunction.resolves({ Configuration: mockFunctionConfig }) + + const result = await ldkClient.getFunctionDetail(mockFunctionConfig.FunctionArn!) + + assert.deepStrictEqual(result, mockFunctionConfig, 'Should return function configuration') + }) + + it('should handle function details retrieval errors', async () => { + mockLambdaClient.getFunction.reset() + mockLambdaClient.getFunction.rejects(new Error('Function not found')) + + const result = await ldkClient.getFunctionDetail(mockFunctionConfig.FunctionArn!) + + assert.strictEqual(result, undefined, 'Should return undefined on error') + }) + + it('should handle invalid ARN', async () => { + const result = await ldkClient.getFunctionDetail('invalid-arn') + + assert.strictEqual(result, undefined, 'Should return undefined for invalid ARN') + }) + }) + + describe('createDebugDeployment()', () => { + const mockFunctionConfig: Lambda.FunctionConfiguration = createMockFunctionConfig({ + FunctionArn: 'arn:aws:lambda:us-east-1:123456789012:function:testFunction', + }) + + const mockProgress = createMockProgress() + + beforeEach(() => { + mockLambdaClient.updateFunctionConfiguration.resolves({}) + mockLambdaClient.publishVersion.resolves({ Version: 'v1' }) + }) + + it('should create debug deployment successfully without version publishing', async () => { + const result = await ldkClient.createDebugDeployment( + mockFunctionConfig, + 'dest-token', + 900, + false, + 'layer-arn', + mockProgress as any + ) + + assert.strictEqual(result, '$Latest', 'Should return $Latest for non-version deployment') + assert(mockLambdaClient.updateFunctionConfiguration.calledOnce, 'Should update function configuration') + assert(mockLambdaClient.publishVersion.notCalled, 'Should not publish version') + }) + + it('should create debug deployment with version publishing', async () => { + const result = await ldkClient.createDebugDeployment( + mockFunctionConfig, + 'dest-token', + 900, + true, + 'layer-arn', + mockProgress as any + ) + + assert.strictEqual(result, 'v1', 'Should return version number') + assert(mockLambdaClient.publishVersion.calledOnce, 'Should publish version') + }) + + it('should handle deployment errors', async () => { + mockLambdaClient.updateFunctionConfiguration.reset() + mockLambdaClient.updateFunctionConfiguration.rejects(new Error('Update failed')) + + await assert.rejects( + async () => + await ldkClient.createDebugDeployment( + mockFunctionConfig, + 'dest-token', + 900, + false, + 'layer-arn', + mockProgress as any + ), + /Failed to create debug deployment/, + 'Should throw error on deployment failure' + ) + }) + + it('should handle missing function ARN', async () => { + const configWithoutArn = { ...mockFunctionConfig, FunctionArn: undefined } + + await assert.rejects( + async () => + await ldkClient.createDebugDeployment( + configWithoutArn, + 'dest-token', + 900, + false, + 'layer-arn', + mockProgress as any + ), + /Function ARN is missing/, + 'Should throw error for missing ARN' + ) + }) + }) + + describe('removeDebugDeployment()', () => { + const mockFunctionConfig: Lambda.FunctionConfiguration = createMockFunctionConfig({ + FunctionArn: 'arn:aws:lambda:us-east-1:123456789012:function:testFunction', + }) + + beforeEach(() => { + mockLambdaClient.updateFunctionConfiguration.resolves({}) + }) + + it('should remove debug deployment successfully', async () => { + const result = await ldkClient.removeDebugDeployment(mockFunctionConfig, false) + + assert.strictEqual(result, true, 'Should return true on successful removal') + assert(mockLambdaClient.updateFunctionConfiguration.calledOnce, 'Should update function configuration') + }) + + it('should handle removal errors', async () => { + mockLambdaClient.updateFunctionConfiguration.rejects(new Error('Update failed')) + + await assert.rejects( + async () => await ldkClient.removeDebugDeployment(mockFunctionConfig, false), + /Error removing debug deployment/, + 'Should throw error on removal failure' + ) + }) + + it('should handle missing function ARN', async () => { + const configWithoutArn = { ...mockFunctionConfig, FunctionArn: undefined, FunctionName: undefined } + + await assert.rejects( + async () => await ldkClient.removeDebugDeployment(configWithoutArn, false), + /Error removing debug deployment/, + 'Should throw error for missing ARN' + ) + }) + }) + + describe('deleteDebugVersion()', () => { + it('should delete debug version successfully', async () => { + mockLambdaClient.deleteFunction.resolves({}) + + const result = await ldkClient.deleteDebugVersion( + 'arn:aws:lambda:us-east-1:123456789012:function:testFunction', + 'v1' + ) + + assert.strictEqual(result, true, 'Should return true on successful deletion') + assert(mockLambdaClient.deleteFunction.calledOnce, 'Should call deleteFunction') + }) + + it('should handle version deletion errors', async () => { + mockLambdaClient.deleteFunction.rejects(new Error('Delete failed')) + + const result = await ldkClient.deleteDebugVersion( + 'arn:aws:lambda:us-east-1:123456789012:function:testFunction', + 'v1' + ) + + assert.strictEqual(result, false, 'Should return false on deletion error') + }) + + it('should handle invalid ARN for version deletion', async () => { + const result = await ldkClient.deleteDebugVersion('invalid-arn', 'v1') + + assert.strictEqual(result, false, 'Should return false for invalid ARN') + }) + }) + + describe('startProxy()', () => { + beforeEach(() => { + mockLocalProxy.start.resolves(9229) + mockLocalProxy.stop.returns() + }) + + it('should start proxy successfully', async () => { + const result = await ldkClient.startProxy('us-east-1', 'source-token', 9229) + + assert.strictEqual(result, true, 'Should return true on successful start') + assert( + mockLocalProxy.start.calledWith('us-east-1', 'source-token', 9229), + 'Should start proxy with correct parameters' + ) + }) + + it('should stop existing proxy before starting new one', async () => { + // Create a spy for the stop method + const stopSpy = sandbox.spy() + + // Set up existing proxy with the spy + ;(ldkClient as any).localProxy = { stop: stopSpy } + + await ldkClient.startProxy('us-east-1', 'source-token', 9229) + + assert(stopSpy.called, 'Should stop existing proxy') + }) + + it('should handle proxy start errors', async () => { + mockLocalProxy.start.rejects(new Error('Proxy start failed')) + + await assert.rejects( + async () => await ldkClient.startProxy('us-east-1', 'source-token', 9229), + /Failed to start proxy/, + 'Should throw error on proxy start failure' + ) + }) + }) + + describe('stopProxy()', () => { + it('should stop proxy successfully', async () => { + // Set up existing proxy + ;(ldkClient as any).localProxy = { stop: mockLocalProxy.stop } + + const result = await ldkClient.stopProxy() + + assert.strictEqual(result, true, 'Should return true on successful stop') + assert(mockLocalProxy.stop.calledOnce, 'Should stop proxy') + assert.strictEqual((ldkClient as any).localProxy, undefined, 'Should clear proxy reference') + }) + + it('should handle stopping when no proxy exists', async () => { + const result = await ldkClient.stopProxy() + + assert.strictEqual(result, true, 'Should return true when no proxy to stop') + }) + }) +}) + +describe('Helper Functions', () => { + describe('getRegionFromArn', () => { + it('should extract region from valid ARN', () => { + const arn = 'arn:aws:lambda:us-east-1:123456789012:function:testFunction' + const result = getRegionFromArn(arn) + assert.strictEqual(result, 'us-east-1', 'Should extract region correctly') + }) + + it('should handle undefined ARN', () => { + const result = getRegionFromArn(undefined) + assert.strictEqual(result, undefined, 'Should return undefined for undefined ARN') + }) + + it('should handle invalid ARN format', () => { + const result = getRegionFromArn('invalid-arn') + assert.strictEqual(result, undefined, 'Should return undefined for invalid ARN') + }) + + it('should handle ARN with insufficient parts', () => { + const result = getRegionFromArn('arn:aws:lambda') + assert.strictEqual(result, undefined, 'Should return undefined for ARN with insufficient parts') + }) + }) + + describe('isTunnelInfo', () => { + it('should validate correct tunnel info', () => { + const tunnelInfo = { + tunnelID: 'tunnel-123', + sourceToken: 'source-token', + destinationToken: 'dest-token', + } + const result = isTunnelInfo(tunnelInfo) + assert.strictEqual(result, true, 'Should validate correct tunnel info') + }) + + it('should reject invalid tunnel info', () => { + const invalidTunnelInfo = { + tunnelID: 'tunnel-123', + sourceToken: 'source-token', + // missing destinationToken + } + const result = isTunnelInfo(invalidTunnelInfo as any) + assert.strictEqual(result, false, 'Should reject invalid tunnel info') + }) + + it('should reject non-object types', () => { + assert.strictEqual(isTunnelInfo('string' as any), false, 'Should reject string') + assert.strictEqual(isTunnelInfo(123 as any), false, 'Should reject number') + assert.strictEqual(isTunnelInfo(undefined as any), false, 'Should reject undefined') + }) + }) +}) diff --git a/packages/core/src/test/lambda/remoteDebugging/ldkController.test.ts b/packages/core/src/test/lambda/remoteDebugging/ldkController.test.ts new file mode 100644 index 00000000000..6c2a173fdaa --- /dev/null +++ b/packages/core/src/test/lambda/remoteDebugging/ldkController.test.ts @@ -0,0 +1,600 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import assert from 'assert' +import * as vscode from 'vscode' +import sinon, { SinonStubbedInstance, createStubInstance } from 'sinon' +import { Lambda } from 'aws-sdk' +import { + RemoteDebugController, + DebugConfig, + activateRemoteDebugging, + revertExistingConfig, + getLambdaSnapshot, +} from '../../../lambda/remoteDebugging/ldkController' +import { LdkClient } from '../../../lambda/remoteDebugging/ldkClient' +import globals from '../../../shared/extensionGlobals' +import * as messages from '../../../shared/utilities/messages' +import { getOpenExternalStub } from '../../globalSetup.test' +import { assertTelemetry } from '../../testUtil' +import { + createMockFunctionConfig, + createMockDebugConfig, + createMockGlobalState, + setupMockLdkClientOperations, + setupMockVSCodeDebugAPIs, + setupMockRevertExistingConfig, + setupDebuggingState, + setupMockCleanupOperations, +} from './testUtils' + +describe('RemoteDebugController', () => { + let sandbox: sinon.SinonSandbox + let mockLdkClient: SinonStubbedInstance + let controller: RemoteDebugController + let mockGlobalState: any + + beforeEach(() => { + sandbox = sinon.createSandbox() + + // Mock LdkClient + mockLdkClient = createStubInstance(LdkClient) + sandbox.stub(LdkClient, 'instance').get(() => mockLdkClient) + + // Mock global state with actual storage + mockGlobalState = createMockGlobalState() + sandbox.stub(globals, 'globalState').value(mockGlobalState) + + // Get controller instance + controller = RemoteDebugController.instance + + // Ensure clean state + controller.ensureCleanState() + }) + + afterEach(() => { + sandbox.restore() + }) + + describe('Singleton Pattern', () => { + it('should return the same instance', () => { + const instance1 = RemoteDebugController.instance + const instance2 = RemoteDebugController.instance + assert.strictEqual(instance1, instance2, 'Should return the same singleton instance') + }) + }) + + describe('State Management', () => { + it('should initialize with clean state', () => { + controller.ensureCleanState() + + assert.strictEqual(controller.isDebugging, false, 'Should not be debugging initially') + assert.strictEqual(controller.qualifier, undefined, 'Qualifier should be undefined initially') + }) + + it('should clean up disposables on ensureCleanState', () => { + // Set up some mock disposables + const mockDisposable = { dispose: sandbox.stub() } + ;(controller as any).debugSessionDisposables.set('test-arn', mockDisposable) + + controller.ensureCleanState() + + assert(mockDisposable.dispose.calledOnce, 'Should dispose existing disposables') + assert.strictEqual((controller as any).debugSessionDisposables.size, 0, 'Should clear disposables map') + }) + }) + + describe('Runtime Support Checks', () => { + it('should support code download for node and python runtimes', () => { + assert.strictEqual(controller.supportCodeDownload('nodejs18.x'), true, 'Should support Node.js') + assert.strictEqual(controller.supportCodeDownload('python3.9'), true, 'Should support Python') + assert.strictEqual( + controller.supportCodeDownload('java11'), + false, + 'Should not support Java for code download' + ) + assert.strictEqual(controller.supportCodeDownload(undefined), false, 'Should not support undefined runtime') + }) + + it('should support remote debug for node, python, and java runtimes', () => { + assert.strictEqual(controller.supportRuntimeRemoteDebug('nodejs18.x'), true, 'Should support Node.js') + assert.strictEqual(controller.supportRuntimeRemoteDebug('python3.9'), true, 'Should support Python') + assert.strictEqual(controller.supportRuntimeRemoteDebug('java11'), true, 'Should support Java') + assert.strictEqual(controller.supportRuntimeRemoteDebug('dotnet6'), false, 'Should not support .NET') + assert.strictEqual( + controller.supportRuntimeRemoteDebug(undefined), + false, + 'Should not support undefined runtime' + ) + }) + + it('should get remote debug layer for supported regions and architectures', () => { + const result = controller.getRemoteDebugLayer('us-east-1', ['x86_64']) + + assert.strictEqual(typeof result, 'string', 'Should return layer ARN for supported region and architecture') + assert(result?.includes('us-east-1'), 'Should contain the region in the ARN') + assert(result?.includes('LDKLayerX86'), 'Should contain the x86 layer name') + }) + + it('should return undefined for unsupported regions', () => { + const result = controller.getRemoteDebugLayer('unsupported-region', ['x86_64']) + + assert.strictEqual(result, undefined, 'Should return undefined for unsupported region') + }) + + it('should return undefined when region or architectures are undefined', () => { + assert.strictEqual(controller.getRemoteDebugLayer(undefined, ['x86_64']), undefined) + assert.strictEqual(controller.getRemoteDebugLayer('us-west-2', undefined), undefined) + }) + }) + + describe('Extension Installation', () => { + it('should return true when extension is already installed', async () => { + // Mock VSCode extensions API - return extension as already installed + const mockExtension = { id: 'ms-vscode.js-debug', isActive: true } + sandbox.stub(vscode.extensions, 'getExtension').returns(mockExtension as any) + + const result = await controller.installDebugExtension('nodejs18.x') + + assert.strictEqual(result, true, 'Should return true when extension is already installed') + }) + + it('should return true when extension installation succeeds', async () => { + // Mock extension as not installed initially, then installed after command + const getExtensionStub = sandbox.stub(vscode.extensions, 'getExtension') + getExtensionStub.onFirstCall().returns(undefined) // Not installed initially + getExtensionStub.onSecondCall().returns({ isActive: true } as any) // Installed after command + + sandbox.stub(vscode.commands, 'executeCommand').resolves() + sandbox.stub(messages, 'showConfirmationMessage').resolves(true) + + const result = await controller.installDebugExtension('python3.9') + + assert.strictEqual(result, true, 'Should return true when installation succeeds') + }) + + it('should return false when user cancels extension installation', async () => { + // Mock extension as not installed + sandbox.stub(vscode.extensions, 'getExtension').returns(undefined) + sandbox.stub(messages, 'showConfirmationMessage').resolves(false) + + const result = await controller.installDebugExtension('python3.9') + + assert.strictEqual(result, false, 'Should return false when user cancels') + }) + + it('should handle Java runtime workflow', async () => { + // Mock extension as already installed to skip extension installation + const mockExtension = { id: 'redhat.java', isActive: true } + sandbox.stub(vscode.extensions, 'getExtension').returns(mockExtension as any) + + // Mock no Java path found + sandbox.stub(require('../../../shared/utilities/pathFind'), 'findJavaPath').resolves(undefined) + + // Mock user choosing to install JVM + const showConfirmationStub = sandbox.stub(messages, 'showConfirmationMessage').resolves(true) + + // Mock openExternal to prevent actual URL opening + // sandbox.stub(vscode.env, 'openExternal').resolves(true) + getOpenExternalStub().resolves(true) + const result = await controller.installDebugExtension('java11') + + assert.strictEqual(result, false, 'Should return false to allow user to install JVM') + assert(showConfirmationStub.calledOnce, 'Should show JVM installation dialog') + }) + + it('should throw error for undefined runtime', async () => { + await assert.rejects( + async () => await controller.installDebugExtension(undefined), + /Runtime is undefined/, + 'Should throw error for undefined runtime' + ) + }) + }) + + describe('Debug Session Management', () => { + let mockConfig: DebugConfig + let mockFunctionConfig: Lambda.FunctionConfiguration + + beforeEach(() => { + mockConfig = createMockDebugConfig({ + layerArn: 'arn:aws:lambda:us-west-2:123456789012:layer:LDKLayerX86:6', + }) + + mockFunctionConfig = createMockFunctionConfig() + }) + + it('should start debugging successfully', async () => { + // Mock VSCode APIs + setupMockVSCodeDebugAPIs(sandbox) + + // Mock runtime support + sandbox.stub(controller, 'supportRuntimeRemoteDebug').returns(true) + + // Mock successful LdkClient operations + setupMockLdkClientOperations(mockLdkClient, mockFunctionConfig) + + // Mock revertExistingConfig + setupMockRevertExistingConfig(sandbox) + + await controller.startDebugging(mockConfig.functionArn, 'nodejs18.x', mockConfig) + + // Assert state changes + assert.strictEqual(controller.isDebugging, true, 'Should be in debugging state') + // Qualifier is only set for version publishing, not for $LATEST + assert.strictEqual(controller.qualifier, undefined, 'Should not set qualifier for $LATEST') + + // Verify LdkClient calls + assert(mockLdkClient.getFunctionDetail.calledWith(mockConfig.functionArn), 'Should get function details') + assert(mockLdkClient.createOrReuseTunnel.calledOnce, 'Should create tunnel') + assert(mockLdkClient.createDebugDeployment.calledOnce, 'Should create debug deployment') + assert(mockLdkClient.startProxy.calledOnce, 'Should start proxy') + + assertTelemetry('lambda_remoteDebugStart', { + result: 'Succeeded', + source: 'remoteDebug', + action: '{"port":9229,"remoteRoot":"/var/task","skipFiles":[],"shouldPublishVersion":false,"lambdaTimeout":900,"layerArn":"arn:aws:lambda:us-west-2:123456789012:layer:LDKLayerX86:6"}', + runtimeString: 'nodejs18.x', + }) + }) + + it('should handle debugging start failure and cleanup', async () => { + // Mock VSCode APIs + setupMockVSCodeDebugAPIs(sandbox) + + // Mock runtime support + sandbox.stub(controller, 'supportRuntimeRemoteDebug').returns(true) + + // Mock function config retrieval success but tunnel creation failure + setupMockLdkClientOperations(mockLdkClient, mockFunctionConfig) + mockLdkClient.createOrReuseTunnel.rejects(new Error('Tunnel creation failed')) + + // Mock revertExistingConfig + setupMockRevertExistingConfig(sandbox) + + let errorThrown = false + try { + await controller.startDebugging(mockConfig.functionArn, 'nodejs18.x', mockConfig) + } catch (error) { + errorThrown = true + assert(error instanceof Error, 'Should throw an error') + assert( + error.message.includes('Error StartDebugging') || error.message.includes('Tunnel creation failed'), + 'Should throw relevant error' + ) + } + + assert(errorThrown, 'Should have thrown an error') + + // Assert state is cleaned up + assert.strictEqual(controller.isDebugging, false, 'Should not be in debugging state after failure') + assert(mockLdkClient.stopProxy.calledOnce, 'Should attempt cleanup') + }) + + it('should handle version publishing workflow', async () => { + // Mock VSCode APIs + setupMockVSCodeDebugAPIs(sandbox) + + // Mock runtime support + sandbox.stub(controller, 'supportRuntimeRemoteDebug').returns(true) + + const versionConfig = { ...mockConfig, shouldPublishVersion: true } + + // Mock successful LdkClient operations with version publishing + setupMockLdkClientOperations(mockLdkClient, mockFunctionConfig) + mockLdkClient.createDebugDeployment.resolves('v1') + + // Mock revertExistingConfig + setupMockRevertExistingConfig(sandbox) + + await controller.startDebugging(versionConfig.functionArn, 'nodejs18.x', versionConfig) + + assert.strictEqual(controller.isDebugging, true, 'Should be in debugging state') + assert.strictEqual(controller.qualifier, 'v1', 'Should set version qualifier') + // Verify telemetry was emitted with version action + assertTelemetry('lambda_remoteDebugStart', { + result: 'Succeeded', + source: 'remoteDebug', + action: '{"port":9229,"remoteRoot":"/var/task","skipFiles":[],"shouldPublishVersion":true,"lambdaTimeout":900,"layerArn":"arn:aws:lambda:us-west-2:123456789012:layer:LDKLayerX86:6"}', + runtimeString: 'nodejs18.x', + }) + }) + + it('should prevent multiple debugging sessions', async () => { + // Set controller to already debugging + controller.isDebugging = true + + await controller.startDebugging(mockConfig.functionArn, 'nodejs18.x', mockConfig) + + // Should not call LdkClient methods + assert(mockLdkClient.getFunctionDetail.notCalled, 'Should not start new session') + }) + }) + + describe('Stop Debugging', () => { + it('should stop debugging successfully', async () => { + // Mock VSCode APIs + sandbox.stub(vscode.commands, 'executeCommand').resolves() + + // Set up debugging state + await setupDebuggingState(controller, mockGlobalState) + + // Mock successful cleanup operations + setupMockCleanupOperations(mockLdkClient) + + await controller.stopDebugging() + + // Assert state is cleaned up + assert.strictEqual(controller.isDebugging, false, 'Should not be in debugging state') + + // Verify cleanup operations + assert(mockLdkClient.stopProxy.calledOnce, 'Should stop proxy') + assert(mockLdkClient.removeDebugDeployment.calledOnce, 'Should remove debug deployment') + assert(mockLdkClient.deleteDebugVersion.calledOnce, 'Should delete debug version') + assertTelemetry('lambda_remoteDebugStop', { + result: 'Succeeded', + }) + }) + + it('should handle stop debugging when not debugging', async () => { + controller.isDebugging = false + + await controller.stopDebugging() + + // Should complete without error when not debugging + assert.strictEqual(controller.isDebugging, false, 'Should remain not debugging') + }) + + it('should handle cleanup errors gracefully', async () => { + // Mock VSCode APIs + sandbox.stub(vscode.commands, 'executeCommand').resolves() + + controller.isDebugging = true + + const mockFunctionConfig = { + FunctionName: 'testFunction', + FunctionArn: 'arn:aws:lambda:us-west-2:123456789012:function:testFunction', + } + // Set up the snapshot in mock state + await mockGlobalState.update('aws.lambda.remoteDebugSnapshot', mockFunctionConfig) + + // Mock cleanup failure + mockLdkClient.stopProxy.rejects(new Error('Cleanup failed')) + mockLdkClient.removeDebugDeployment.resolves(true) + + await assert.rejects( + async () => await controller.stopDebugging(), + /error when stopping remote debug/, + 'Should throw error on cleanup failure' + ) + + // State should still be cleaned up + assert.strictEqual(controller.isDebugging, false, 'Should clean up state even on error') + // Verify telemetry was emitted for failure + assertTelemetry('lambda_remoteDebugStop', { + result: 'Failed', + }) + }) + }) + + describe('Snapshot Management', () => { + it('should get lambda snapshot from global state', async () => { + const mockSnapshot = { + FunctionName: 'testFunction', + FunctionArn: 'arn:aws:lambda:us-west-2:123456789012:function:testFunction', + } + // Set up the snapshot in mock state + await mockGlobalState.update('aws.lambda.remoteDebugSnapshot', mockSnapshot) + + const result = getLambdaSnapshot() + + assert.deepStrictEqual(result, mockSnapshot, 'Should return snapshot from global state') + }) + + it('should return undefined when no snapshot exists', () => { + const result = getLambdaSnapshot() + + assert.strictEqual(result, undefined, 'Should return undefined when no snapshot') + }) + }) + + describe('Telemetry Verification', () => { + let mockConfig: DebugConfig + let mockFunctionConfig: Lambda.FunctionConfiguration + + beforeEach(() => { + mockConfig = createMockDebugConfig({ + layerArn: 'arn:aws:lambda:us-west-2:123456789012:layer:LDKLayerX86:6', + }) + + mockFunctionConfig = createMockFunctionConfig() + }) + + it('should emit lambda_remoteDebugStart telemetry for failed debugging start', async () => { + // Mock VSCode APIs + setupMockVSCodeDebugAPIs(sandbox) + + // Mock runtime support + sandbox.stub(controller, 'supportRuntimeRemoteDebug').returns(true) + + // Mock function config retrieval success but tunnel creation failure + setupMockLdkClientOperations(mockLdkClient, mockFunctionConfig) + mockLdkClient.createOrReuseTunnel.rejects(new Error('Tunnel creation failed')) + + // Mock revertExistingConfig + setupMockRevertExistingConfig(sandbox) + + try { + await controller.startDebugging(mockConfig.functionArn, 'nodejs18.x', mockConfig) + } catch (error) { + // Expected to throw + } + + // Verify telemetry was emitted for failure + assertTelemetry('lambda_remoteDebugStart', { + result: 'Failed', + source: 'remoteDebug', + action: '{"port":9229,"remoteRoot":"/var/task","skipFiles":[],"shouldPublishVersion":false,"lambdaTimeout":900,"layerArn":"arn:aws:lambda:us-west-2:123456789012:layer:LDKLayerX86:6"}', + runtimeString: 'nodejs18.x', + }) + }) + }) +}) + +describe('Module Functions', () => { + let sandbox: sinon.SinonSandbox + let mockGlobalState: any + + beforeEach(() => { + sandbox = sinon.createSandbox() + + // Mock global state with actual storage + mockGlobalState = createMockGlobalState() + sandbox.stub(globals, 'globalState').value(mockGlobalState) + }) + + afterEach(() => { + sandbox.restore() + }) + + describe('activateRemoteDebugging', () => { + it('should activate remote debugging and ensure clean state', async () => { + // Mock revertExistingConfig + sandbox + .stub(require('../../../lambda/remoteDebugging/ldkController'), 'revertExistingConfig') + .resolves(true) + + // Mock controller + const mockController = { + ensureCleanState: sandbox.stub(), + } + sandbox.stub(RemoteDebugController, 'instance').get(() => mockController) + + await activateRemoteDebugging() + + assert(mockController.ensureCleanState.calledOnce, 'Should ensure clean state') + }) + + it('should handle activation errors gracefully', async () => { + // Mock revertExistingConfig to throw error + sandbox + .stub(require('../../../lambda/remoteDebugging/ldkController'), 'revertExistingConfig') + .rejects(new Error('Revert failed')) + + // Should not throw error, just handle gracefully + await activateRemoteDebugging() + + // Test passes if no error is thrown + assert(true, 'Should handle activation errors gracefully') + }) + }) + + describe('revertExistingConfig', () => { + let mockLdkClient: SinonStubbedInstance + + beforeEach(() => { + mockLdkClient = createStubInstance(LdkClient) + sandbox.stub(LdkClient, 'instance').get(() => mockLdkClient) + }) + + it('should return true when no existing config', async () => { + // mockGlobalState.get.returns(undefined) + + const result = await revertExistingConfig() + + assert.strictEqual(result, true, 'Should return true when no config to revert') + }) + + it('should revert existing config successfully', async () => { + const mockSnapshot = { + FunctionName: 'testFunction', + FunctionArn: 'arn:aws:lambda:us-west-2:123456789012:function:testFunction', + Timeout: 30, + } + const mockCurrentConfig = { + FunctionName: 'testFunction', + FunctionArn: 'arn:aws:lambda:us-west-2:123456789012:function:testFunction', + Timeout: 900, // Different from snapshot + } + + // Set up the snapshot in mock state + await mockGlobalState.update('aws.lambda.remoteDebugSnapshot', mockSnapshot) + mockLdkClient.getFunctionDetail.resolves(mockCurrentConfig) + mockLdkClient.removeDebugDeployment.resolves(true) + + const showConfirmationStub = sandbox.stub(messages, 'showConfirmationMessage').resolves(true) + const result = await revertExistingConfig() + + assert.strictEqual(result, true, 'Should return true on successful revert') + assert(showConfirmationStub.calledOnce, 'Should show confirmation dialog') + assert(mockLdkClient.removeDebugDeployment.calledWith(mockSnapshot, false), 'Should revert config') + }) + + it('should handle user cancellation of revert', async () => { + const mockSnapshot = { + FunctionName: 'testFunction', + FunctionArn: 'arn:aws:lambda:us-west-2:123456789012:function:testFunction', + } + const mockCurrentConfig = { + FunctionName: 'testFunction', + FunctionArn: 'arn:aws:lambda:us-west-2:123456789012:function:testFunction', + Timeout: 900, + } + + // Set up the snapshot in mock state + await mockGlobalState.update('aws.lambda.remoteDebugSnapshot', mockSnapshot) + mockLdkClient.getFunctionDetail.resolves(mockCurrentConfig) + + sandbox.stub(messages, 'showConfirmationMessage').resolves(false) + + const result = await revertExistingConfig() + + assert.strictEqual(result, true, 'Should return true when user cancels') + // Verify snapshot was cleared + assert.strictEqual( + mockGlobalState.get('aws.lambda.remoteDebugSnapshot'), + undefined, + 'Should clear snapshot' + ) + }) + + it('should handle corrupted snapshot gracefully', async () => { + const corruptedSnapshot = { + // Missing FunctionArn and FunctionName + Timeout: 30, + } + + // Set up corrupted snapshot in mock state + await mockGlobalState.update('aws.lambda.remoteDebugSnapshot', corruptedSnapshot) + + const result = await revertExistingConfig() + + assert.strictEqual(result, true, 'Should return true for corrupted snapshot') + // Verify snapshot was cleared + assert.strictEqual( + mockGlobalState.get('aws.lambda.remoteDebugSnapshot'), + undefined, + 'Should clear corrupted snapshot' + ) + }) + + it('should handle revert errors', async () => { + const mockSnapshot = { + FunctionName: 'testFunction', + FunctionArn: 'arn:aws:lambda:us-west-2:123456789012:function:testFunction', + } + + // Set up the snapshot in mock state + await mockGlobalState.update('aws.lambda.remoteDebugSnapshot', mockSnapshot) + mockLdkClient.getFunctionDetail.rejects(new Error('Failed to get function')) + + await assert.rejects( + async () => await revertExistingConfig(), + /Error in revertExistingConfig/, + 'Should throw error on revert failure' + ) + }) + }) +}) diff --git a/packages/core/src/test/lambda/remoteDebugging/localProxy.test.ts b/packages/core/src/test/lambda/remoteDebugging/localProxy.test.ts new file mode 100644 index 00000000000..7c1bd0479b4 --- /dev/null +++ b/packages/core/src/test/lambda/remoteDebugging/localProxy.test.ts @@ -0,0 +1,421 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import assert from 'assert' +import sinon from 'sinon' +import WebSocket from 'ws' +import { LocalProxy } from '../../../lambda/remoteDebugging/localProxy' + +describe('LocalProxy', () => { + let sandbox: sinon.SinonSandbox + let localProxy: LocalProxy + + beforeEach(() => { + sandbox = sinon.createSandbox() + localProxy = new LocalProxy() + }) + + afterEach(() => { + localProxy.stop() + sandbox.restore() + }) + + describe('Constructor', () => { + it('should initialize with default values', () => { + const proxy = new LocalProxy() + assert.strictEqual((proxy as any).isConnected, false, 'Should not be connected initially') + assert.strictEqual((proxy as any).reconnectAttempts, 0, 'Should have zero reconnect attempts') + assert.strictEqual((proxy as any).currentStreamId, 1, 'Should start with stream ID 1') + assert.strictEqual((proxy as any).nextConnectionId, 1, 'Should start with connection ID 1') + }) + }) + + describe('Protobuf Loading', () => { + it('should load protobuf definition successfully', async () => { + const proxy = new LocalProxy() + await (proxy as any).loadProtobufDefinition() + + assert((proxy as any).Message, 'Should load Message type') + assert.strictEqual(typeof (proxy as any).Message, 'object', 'Message should be a protobuf Type object') + assert.strictEqual((proxy as any).Message.constructor.name, 'Type', 'Message should be a protobuf Type') + }) + + it('should not reload protobuf definition if already loaded', async () => { + const proxy = new LocalProxy() + await (proxy as any).loadProtobufDefinition() + const firstMessage = (proxy as any).Message + + await (proxy as any).loadProtobufDefinition() + const secondMessage = (proxy as any).Message + + assert.strictEqual(firstMessage, secondMessage, 'Should not reload protobuf definition') + }) + }) + + describe('TCP Server Management', () => { + it('should close TCP server and connections properly', () => { + const mockSocket = { + removeAllListeners: sandbox.stub(), + destroy: sandbox.stub(), + } + + const mockServer = { + removeAllListeners: sandbox.stub(), + close: sandbox.stub().callsArg(0), + } + + // Set up mock state + ;(localProxy as any).tcpServer = mockServer + ;(localProxy as any).tcpConnections = new Map([[1, { socket: mockSocket }]]) + ;(localProxy as any).closeTcpServer() + + assert(mockSocket.removeAllListeners.called, 'Should remove socket listeners') + assert(mockSocket.destroy.calledOnce, 'Should destroy socket') + assert(mockServer.removeAllListeners.called, 'Should remove server listeners') + assert(mockServer.close.calledOnce, 'Should close server') + }) + }) + + describe('WebSocket Connection Management', () => { + it('should create WebSocket with correct URL and headers', async () => { + const mockWs = { + on: sandbox.stub(), + once: sandbox.stub(), + readyState: WebSocket.OPEN, + removeAllListeners: sandbox.stub(), + close: sandbox.stub(), + terminate: sandbox.stub(), + } + + // Set up LocalProxy with required properties + ;(localProxy as any).region = 'us-east-1' + ;(localProxy as any).accessToken = 'test-access-token' + + // Mock the WebSocket constructor + const WebSocketStub = sandbox.stub().returns(mockWs) + sandbox.stub(WebSocket, 'WebSocket').callsFake(WebSocketStub) + + // Mock the open event to resolve the promise + mockWs.on.withArgs('open').callsArg(1) + + await (localProxy as any).connectWebSocket() + + assert(WebSocketStub.calledOnce, 'Should create WebSocket') + const [url, protocols, options] = WebSocketStub.getCall(0).args + + assert(url.includes('wss://data.tunneling.iot.'), 'Should use correct WebSocket URL') + assert(url.includes('.amazonaws.com:443/tunnel'), 'Should use correct WebSocket URL') + assert(url.includes('local-proxy-mode=source'), 'Should set local proxy mode') + assert.deepStrictEqual(protocols, ['aws.iot.securetunneling-3.0'], 'Should use correct protocol') + assert(options && options.headers && options.headers['access-token'], 'Should include access token header') + assert(options && options.headers && options.headers['client-token'], 'Should include client token header') + }) + + it('should handle WebSocket connection errors', async () => { + const mockWs = { + on: sandbox.stub(), + once: sandbox.stub(), + readyState: WebSocket.CONNECTING, + removeAllListeners: sandbox.stub(), + close: sandbox.stub(), + terminate: sandbox.stub(), + } + + sandbox.stub(WebSocket, 'WebSocket').returns(mockWs) + + // Mock the error event + mockWs.on.withArgs('error').callsArgWith(1, new Error('Connection failed')) + + await assert.rejects( + async () => await (localProxy as any).connectWebSocket(), + /Connection failed/, + 'Should throw error on WebSocket connection failure' + ) + }) + + it('should close WebSocket connection properly', () => { + const mockWs = { + readyState: WebSocket.OPEN, + removeAllListeners: sandbox.stub(), + close: sandbox.stub(), + terminate: sandbox.stub(), + once: sandbox.stub(), + } + + ;(localProxy as any).ws = mockWs + ;(localProxy as any).closeWebSocket() + + assert(mockWs.removeAllListeners.called, 'Should remove all listeners') + assert(mockWs.close.calledWith(1000, 'Normal Closure'), 'Should close with normal closure code') + }) + + it('should terminate WebSocket if not open', () => { + const mockWs = { + readyState: WebSocket.CONNECTING, + removeAllListeners: sandbox.stub(), + close: sandbox.stub(), + terminate: sandbox.stub(), + } + + ;(localProxy as any).ws = mockWs + ;(localProxy as any).closeWebSocket() + + assert(mockWs.terminate.calledOnce, 'Should terminate WebSocket if not open') + }) + }) + + describe('Ping/Pong Management', () => { + it('should start ping interval', () => { + const setIntervalStub = sandbox.stub(global, 'setInterval').returns({} as any) + + ;(localProxy as any).startPingInterval() + + assert(setIntervalStub.calledOnce, 'Should start ping interval') + assert.strictEqual(setIntervalStub.getCall(0).args[1], 30000, 'Should ping every 30 seconds') + }) + + it('should stop ping interval', () => { + const clearIntervalStub = sandbox.stub(global, 'clearInterval') + const mockInterval = {} as any + ;(localProxy as any).pingInterval = mockInterval + ;(localProxy as any).stopPingInterval() + + assert(clearIntervalStub.calledWith(mockInterval), 'Should clear ping interval') + assert.strictEqual((localProxy as any).pingInterval, undefined, 'Should clear interval reference') + }) + + it('should send ping when WebSocket is open', () => { + const mockWs = { + readyState: WebSocket.OPEN, + ping: sandbox.stub(), + } + + ;(localProxy as any).ws = mockWs + + // Simulate ping interval callback + const setIntervalStub = sandbox.stub(global, 'setInterval') + ;(localProxy as any).startPingInterval() + + const pingCallback = setIntervalStub.getCall(0).args[0] + pingCallback() + + assert(mockWs.ping.calledOnce, 'Should send ping') + }) + }) + + describe('Message Processing', () => { + beforeEach(async () => { + // Load protobuf definition + await (localProxy as any).loadProtobufDefinition() + }) + + it('should process binary WebSocket messages', () => { + const processMessageStub = sandbox.stub(localProxy as any, 'processMessage') + + // Create a mock message buffer with length prefix + const messageData = Buffer.from('test message') + const buffer = Buffer.alloc(2 + messageData.length) + buffer.writeUInt16BE(messageData.length, 0) + messageData.copy(buffer, 2) + ;(localProxy as any).handleWebSocketMessage(buffer) + + assert(processMessageStub.calledOnce, 'Should process message') + assert(processMessageStub.calledWith(messageData), 'Should pass correct message data') + }) + + it('should handle incomplete message data', () => { + const processMessageStub = sandbox.stub(localProxy as any, 'processMessage') + + // Create incomplete buffer (only length prefix) + const buffer = Buffer.alloc(2) + buffer.writeUInt16BE(100, 0) // Claims 100 bytes but buffer is only 2 + ;(localProxy as any).handleWebSocketMessage(buffer) + + assert(processMessageStub.notCalled, 'Should not process incomplete message') + }) + + it('should handle non-buffer WebSocket messages', () => { + const processMessageStub = sandbox.stub(localProxy as any, 'processMessage') + + ;(localProxy as any).handleWebSocketMessage('string message') + + assert(processMessageStub.notCalled, 'Should not process non-buffer messages') + }) + }) + + describe('TCP Connection Handling', () => { + beforeEach(() => { + ;(localProxy as any).isConnected = true + ;(localProxy as any).isDisposed = false + }) + + it('should handle new TCP connections when connected', () => { + const mockSocket = { + on: sandbox.stub(), + destroy: sandbox.stub(), + once: sandbox.stub(), + } + + const sendStreamStartStub = sandbox.stub(localProxy as any, 'sendStreamStart') + + ;(localProxy as any).handleNewTcpConnection(mockSocket) + + assert(mockSocket.on.calledWith('data'), 'Should listen for data events') + assert(mockSocket.on.calledWith('error'), 'Should listen for error events') + assert(mockSocket.on.calledWith('close'), 'Should listen for close events') + assert(sendStreamStartStub.calledOnce, 'Should send stream start for first connection') + }) + + it('should reject TCP connections when not connected', () => { + ;(localProxy as any).isConnected = false + + const mockSocket = { + destroy: sandbox.stub(), + } + + ;(localProxy as any).handleNewTcpConnection(mockSocket) + + assert(mockSocket.destroy.calledOnce, 'Should destroy socket when not connected') + }) + + it('should reject TCP connections when disposed', () => { + ;(localProxy as any).isDisposed = true + + const mockSocket = { + destroy: sandbox.stub(), + } + + ;(localProxy as any).handleNewTcpConnection(mockSocket) + + assert(mockSocket.destroy.calledOnce, 'Should destroy socket when disposed') + }) + + it('should send connection start for subsequent connections', () => { + ;(localProxy as any).nextConnectionId = 2 // Second connection + + const mockSocket = { + on: sandbox.stub(), + destroy: sandbox.stub(), + once: sandbox.stub(), + } + + const sendConnectionStartStub = sandbox.stub(localProxy as any, 'sendConnectionStart') + + ;(localProxy as any).handleNewTcpConnection(mockSocket) + + assert(sendConnectionStartStub.calledOnce, 'Should send connection start for subsequent connections') + }) + }) + + describe('Lifecycle Management', () => { + it('should start proxy successfully', async () => { + const startTcpServerStub = sandbox.stub(localProxy as any, 'startTcpServer').resolves(9229) + const connectWebSocketStub = sandbox.stub(localProxy as any, 'connectWebSocket').resolves() + + const port = await localProxy.start('us-east-1', 'source-token', 9229) + + assert.strictEqual(port, 9229, 'Should return assigned port') + assert(startTcpServerStub.calledWith(9229), 'Should start TCP server') + assert(connectWebSocketStub.calledOnce, 'Should connect WebSocket') + assert.strictEqual((localProxy as any).region, 'us-east-1', 'Should store region') + assert.strictEqual((localProxy as any).accessToken, 'source-token', 'Should store access token') + }) + + it('should handle start errors and cleanup', async () => { + sandbox.stub(localProxy as any, 'startTcpServer').resolves(9229) + sandbox.stub(localProxy as any, 'connectWebSocket').rejects(new Error('WebSocket failed')) + const stopStub = sandbox.stub(localProxy, 'stop') + + await assert.rejects( + async () => await localProxy.start('us-east-1', 'source-token', 9229), + /WebSocket failed/, + 'Should throw error on start failure' + ) + + assert(stopStub.calledOnce, 'Should cleanup on start failure') + }) + + it('should stop proxy and cleanup resources', () => { + const stopPingIntervalStub = sandbox.stub(localProxy as any, 'stopPingInterval') + const closeWebSocketStub = sandbox.stub(localProxy as any, 'closeWebSocket') + const closeTcpServerStub = sandbox.stub(localProxy as any, 'closeTcpServer') + + // Set up some state + ;(localProxy as any).isConnected = true + ;(localProxy as any).reconnectAttempts = 5 + ;(localProxy as any).clientToken = 'test-token' + + localProxy.stop() + + assert(stopPingIntervalStub.calledOnce, 'Should stop ping interval') + assert(closeWebSocketStub.calledOnce, 'Should close WebSocket') + assert(closeTcpServerStub.calledOnce, 'Should close TCP server') + assert.strictEqual((localProxy as any).isConnected, false, 'Should reset connection state') + assert.strictEqual((localProxy as any).reconnectAttempts, 0, 'Should reset reconnect attempts') + assert.strictEqual((localProxy as any).clientToken, '', 'Should clear client token') + assert.strictEqual((localProxy as any).isDisposed, true, 'Should mark as disposed') + }) + + it('should handle duplicate stop calls gracefully', () => { + const stopPingIntervalStub = sandbox.stub(localProxy as any, 'stopPingInterval') + + localProxy.stop() + localProxy.stop() // Second call + + // Should not throw error and should handle gracefully + assert(stopPingIntervalStub.calledOnce, 'Should only stop once') + }) + }) + + describe('Message Sending', () => { + beforeEach(async () => { + await (localProxy as any).loadProtobufDefinition() + }) + + it('should send messages when WebSocket is open', () => { + const mockWs = { + readyState: WebSocket.OPEN, + send: sandbox.stub(), + } + + ;(localProxy as any).ws = mockWs + ;(localProxy as any).serviceId = 'WSS' + ;(localProxy as any).sendMessage(1, 1, 1, Buffer.from('test')) + + assert(mockWs.send.calledOnce, 'Should send message') + const sentData = mockWs.send.getCall(0).args[0] + assert(Buffer.isBuffer(sentData), 'Should send buffer data') + assert(sentData.length > 2, 'Should include length prefix') + }) + + it('should not send messages when WebSocket is not open', () => { + const mockWs = { + readyState: WebSocket.CONNECTING, + send: sandbox.stub(), + } + + ;(localProxy as any).ws = mockWs + ;(localProxy as any).sendMessage(1, 1, 1, Buffer.from('test')) + + assert(mockWs.send.notCalled, 'Should not send when WebSocket is not open') + }) + + it('should split large data into chunks', () => { + const mockWs = { + readyState: WebSocket.OPEN, + send: sandbox.stub(), + } + + ;(localProxy as any).ws = mockWs + + // Create data larger than max chunk size (63KB) + const largeData = Buffer.alloc(70 * 1024, 'a') + + ;(localProxy as any).sendData(1, 1, largeData) + + assert(mockWs.send.calledTwice, 'Should split large data into chunks') + }) + }) +}) diff --git a/packages/core/src/test/lambda/remoteDebugging/testUtils.ts b/packages/core/src/test/lambda/remoteDebugging/testUtils.ts new file mode 100644 index 00000000000..67a53b15d61 --- /dev/null +++ b/packages/core/src/test/lambda/remoteDebugging/testUtils.ts @@ -0,0 +1,177 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import sinon from 'sinon' +import { Lambda } from 'aws-sdk' +import { LambdaFunctionNode } from '../../../lambda/explorer/lambdaFunctionNode' +import { InitialData } from '../../../lambda/vue/remoteInvoke/invokeLambda' +import { DebugConfig } from '../../../lambda/remoteDebugging/ldkController' + +/** + * Creates a mock Lambda function configuration for testing + */ +export function createMockFunctionConfig( + overrides: Partial = {} +): Lambda.FunctionConfiguration { + return { + FunctionName: 'testFunction', + FunctionArn: 'arn:aws:lambda:us-west-2:123456789012:function:testFunction', + Runtime: 'nodejs18.x', + Handler: 'index.handler', + Timeout: 30, + Layers: [], + Environment: { Variables: {} }, + Architectures: ['x86_64'], + SnapStart: { ApplyOn: 'None' }, + ...overrides, + } +} + +/** + * Creates a mock Lambda function node for testing + */ +export function createMockFunctionNode(overrides: Partial = {}): LambdaFunctionNode { + const config = createMockFunctionConfig() + return { + configuration: config, + regionCode: 'us-west-2', + localDir: '/local/path', + ...overrides, + } as LambdaFunctionNode +} + +/** + * Creates mock initial data for RemoteInvokeWebview testing + */ +export function createMockInitialData(overrides: Partial = {}): InitialData { + const mockFunctionNode = createMockFunctionNode() + return { + FunctionName: 'testFunction', + FunctionArn: 'arn:aws:lambda:us-west-2:123456789012:function:testFunction', + FunctionRegion: 'us-west-2', + InputSamples: [], + Runtime: 'nodejs18.x', + LocalRootPath: '/local/path', + LambdaFunctionNode: mockFunctionNode, + supportCodeDownload: true, + runtimeSupportsRemoteDebug: true, + regionSupportsRemoteDebug: true, + ...overrides, + } as InitialData +} + +/** + * Creates a mock debug configuration for testing + */ +export function createMockDebugConfig(overrides: Partial = {}): DebugConfig { + return { + functionArn: 'arn:aws:lambda:us-west-2:123456789012:function:testFunction', + functionName: 'testFunction', + port: 9229, + localRoot: '/local/path', + remoteRoot: '/var/task', + skipFiles: [], + shouldPublishVersion: false, + lambdaTimeout: 900, + layerArn: 'arn:aws:lambda:us-west-2:123456789012:layer:LDKLayerX86:6', + ...overrides, + } +} + +/** + * Creates a mock global state for testing + */ +export function createMockGlobalState(): any { + const stateStorage = new Map() + return { + get: (key: string) => stateStorage.get(key), + tryGet: (key: string, type?: any, defaultValue?: any) => { + const value = stateStorage.get(key) + return value !== undefined ? value : defaultValue + }, + update: async (key: string, value: any) => { + stateStorage.set(key, value) + return Promise.resolve() + }, + } +} + +/** + * Sets up common mocks for VSCode APIs + */ +export function setupVSCodeMocks(sandbox: sinon.SinonSandbox) { + return { + startDebugging: sandbox.stub(), + executeCommand: sandbox.stub(), + onDidTerminateDebugSession: sandbox.stub().returns({ dispose: sandbox.stub() }), + } +} + +/** + * Creates a mock progress reporter for testing + */ +export function createMockProgress(): any { + return { + report: sinon.stub(), + } +} + +/** + * Sets up common debugging state for stop debugging tests + */ +export function setupDebuggingState(controller: any, mockGlobalState: any, qualifier: string = 'v1') { + controller.isDebugging = true + controller.qualifier = qualifier + ;(controller as any).lastDebugStartTime = Date.now() - 5000 // 5 seconds ago + + const mockFunctionConfig = { + FunctionName: 'testFunction', + FunctionArn: 'arn:aws:lambda:us-west-2:123456789012:function:testFunction', + } + + return mockGlobalState.update('aws.lambda.remoteDebugSnapshot', mockFunctionConfig) +} + +/** + * Sets up common mock operations for successful cleanup + */ +export function setupMockCleanupOperations(mockLdkClient: any) { + mockLdkClient.stopProxy.resolves(true) + mockLdkClient.removeDebugDeployment.resolves(true) + mockLdkClient.deleteDebugVersion.resolves(true) +} + +/** + * Sets up common mock operations for LdkClient testing + */ +export function setupMockLdkClientOperations(mockLdkClient: any, mockFunctionConfig: any) { + mockLdkClient.getFunctionDetail.resolves(mockFunctionConfig) + mockLdkClient.createOrReuseTunnel.resolves({ + tunnelID: 'tunnel-123', + sourceToken: 'source-token', + destinationToken: 'dest-token', + }) + mockLdkClient.createDebugDeployment.resolves('$LATEST') + mockLdkClient.startProxy.resolves(true) + mockLdkClient.stopProxy.resolves(true) + mockLdkClient.removeDebugDeployment.resolves(true) + mockLdkClient.deleteDebugVersion.resolves(true) +} + +/** + * Sets up common VSCode debug API mocks + */ +export function setupMockVSCodeDebugAPIs(sandbox: sinon.SinonSandbox) { + sandbox.stub(require('vscode').debug, 'startDebugging').resolves(true) + sandbox.stub(require('vscode').commands, 'executeCommand').resolves() + sandbox.stub(require('vscode').debug, 'onDidTerminateDebugSession').returns({ dispose: sandbox.stub() }) +} + +/** + * Sets up mock for revertExistingConfig function + */ +export function setupMockRevertExistingConfig(sandbox: sinon.SinonSandbox) { + return sandbox.stub(require('../../../lambda/remoteDebugging/ldkController'), 'revertExistingConfig').resolves(true) +} diff --git a/packages/core/src/test/lambda/uriHandlers.test.ts b/packages/core/src/test/lambda/uriHandlers.test.ts new file mode 100644 index 00000000000..f3e8ae7c368 --- /dev/null +++ b/packages/core/src/test/lambda/uriHandlers.test.ts @@ -0,0 +1,36 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import assert from 'assert' +import { SearchParams } from '../../shared/vscode/uriHandler' +import { parseOpenParams } from '../../lambda/uriHandlers' +import { globals } from '../../shared' + +describe('Lambda URI Handler', function () { + describe('load-function', function () { + it('registers for "/lambda/load-function"', function () { + assert.throws(() => globals.uriHandler.onPath('/lambda/load-function', () => {})) + }) + + it('parses parameters', function () { + let query = new SearchParams({ + functionName: 'example', + }) + assert.throws(() => parseOpenParams(query), /A region must be provided/) + query = new SearchParams({ + region: 'example', + }) + assert.throws(() => parseOpenParams(query), /A function name must be provided/) + + const valid = { + functionName: 'example', + region: 'example', + isCfn: 'false', + } + query = new SearchParams(valid) + assert.deepEqual(parseOpenParams(query), valid) + }) + }) +}) diff --git a/packages/core/src/test/lambda/utils.test.ts b/packages/core/src/test/lambda/utils.test.ts index b7c1edb0aa4..a3eebe043a7 100644 --- a/packages/core/src/test/lambda/utils.test.ts +++ b/packages/core/src/test/lambda/utils.test.ts @@ -4,9 +4,27 @@ */ import assert from 'assert' -import { getLambdaDetails } from '../../lambda/utils' +import * as sinon from 'sinon' +import { + getLambdaDetails, + getTempLocation, + getTempRegionLocation, + getFunctionInfo, + setFunctionInfo, + compareCodeSha, +} from '../../lambda/utils' +import { LambdaFunction } from '../../lambda/commands/uploadLambda' +import { DefaultLambdaClient } from '../../shared/clients/lambdaClient' +import { fs } from '../../shared/fs/fs' +import { tempDirPath } from '../../shared/filesystemUtilities' +import path from 'path' -describe('lambda utils', async function () { +describe('lambda utils', function () { + const mockLambda = { + name: 'test-function', + region: 'us-east-1', + configuration: { FunctionName: 'test-function' }, + } describe('getLambdaDetails', function () { it('returns valid filenames and function names', function () { const jsNonNestedParsedName = getLambdaDetails({ @@ -52,4 +70,123 @@ describe('lambda utils', async function () { assert.throws(() => getLambdaDetails({ Runtime: 'COBOL-60', Handler: 'asdf.asdf' })) }) }) + + describe('getTempLocation', function () { + it('returns correct temp location path', function () { + const result = getTempLocation('test-function', 'us-east-1') + const expected = path.join(tempDirPath, 'lambda', 'us-east-1', 'test-function') + assert.strictEqual(result, expected) + }) + }) + + describe('getTempRegionLocation', function () { + it('returns correct temp region path', function () { + const result = getTempRegionLocation('us-west-2') + const expected = path.join(tempDirPath, 'lambda', 'us-west-2') + assert.strictEqual(result, expected) + }) + }) + + describe('getFunctionInfo', function () { + afterEach(function () { + sinon.restore() + }) + + it('returns parsed data when file exists', async function () { + const mockData = { lastDeployed: 123456, undeployed: false, sha: 'test-sha' } + sinon.stub(fs, 'readFileText').resolves(JSON.stringify(mockData)) + + const result = await getFunctionInfo(mockLambda) + assert.deepStrictEqual(result, mockData) + }) + + it('returns specific field when requested', async function () { + const mockData = { lastDeployed: 123456, undeployed: false, sha: 'test-sha' } + sinon.stub(fs, 'readFileText').resolves(JSON.stringify(mockData)) + + const result = await getFunctionInfo(mockLambda, 'sha') + assert.strictEqual(result, 'test-sha') + }) + + it('returns empty object when file does not exist', async function () { + sinon.stub(fs, 'readFileText').rejects(new Error('File not found')) + + const result = await getFunctionInfo(mockLambda) + assert.deepStrictEqual(result, {}) + }) + }) + + describe('setFunctionInfo', function () { + let mockLambda: LambdaFunction + + // jscpd:ignore-start + beforeEach(function () { + mockLambda = { + name: 'test-function', + region: 'us-east-1', + configuration: { FunctionName: 'test-function' }, + } + }) + + afterEach(function () { + sinon.restore() + }) + // jscpd:ignore-end + + it('merges with existing data', async function () { + const existingData = { lastDeployed: 123456, undeployed: true, sha: 'old-sha', handlerFile: 'index.js' } + sinon.stub(fs, 'readFileText').resolves(JSON.stringify(existingData)) + const writeStub = sinon.stub(fs, 'writeFile').resolves() + sinon.stub(DefaultLambdaClient.prototype, 'getFunction').resolves({ + Configuration: { CodeSha256: 'new-sha' }, + } as any) + + await setFunctionInfo(mockLambda, { undeployed: false }) + + assert(writeStub.calledOnce) + const writtenData = JSON.parse(writeStub.firstCall.args[1] as string) + assert.strictEqual(writtenData.lastDeployed, 123456) + assert.strictEqual(writtenData.undeployed, false) + assert.strictEqual(writtenData.sha, 'new-sha') + assert.strictEqual(writtenData.handlerFile, 'index.js') + }) + }) + + describe('compareCodeSha', function () { + let mockLambda: LambdaFunction + + // jscpd:ignore-start + beforeEach(function () { + mockLambda = { + name: 'test-function', + region: 'us-east-1', + configuration: { FunctionName: 'test-function' }, + } + }) + + afterEach(function () { + sinon.restore() + }) + // jscpd:ignore-end + + it('returns true when local and remote SHA match', async function () { + sinon.stub(fs, 'readFileText').resolves(JSON.stringify({ sha: 'same-sha' })) + sinon.stub(DefaultLambdaClient.prototype, 'getFunction').resolves({ + Configuration: { CodeSha256: 'same-sha' }, + } as any) + + const result = await compareCodeSha(mockLambda) + assert.strictEqual(result, true) + }) + + it('returns false when local and remote SHA differ', async function () { + sinon.stub(fs, 'readFileText').resolves(JSON.stringify({ sha: 'local-sha' })) + sinon.stub(DefaultLambdaClient.prototype, 'getFunction').resolves({ + Configuration: { CodeSha256: 'remote-sha' }, + } as any) + + const result = await compareCodeSha(mockLambda) + assert.strictEqual(result, false) + }) + }) }) diff --git a/packages/core/src/test/lambda/vue/remoteInvoke/invokeLambda.test.ts b/packages/core/src/test/lambda/vue/remoteInvoke/invokeLambda.test.ts index 2a0fcaa0e0d..1b9f4bfde8e 100644 --- a/packages/core/src/test/lambda/vue/remoteInvoke/invokeLambda.test.ts +++ b/packages/core/src/test/lambda/vue/remoteInvoke/invokeLambda.test.ts @@ -471,7 +471,8 @@ describe('RemoteInvokeWebview', () => { createWebviewPanelArgs[1], `Invoke Lambda ${mockFunctionNode.configuration.FunctionName}` ) - assert.deepStrictEqual(createWebviewPanelArgs[2], { viewColumn: -1 }) + // opens in side panel + assert.deepStrictEqual(createWebviewPanelArgs[2], { viewColumn: vscode.ViewColumn.Beside }) }) }) }) diff --git a/packages/core/src/test/lambda/vue/remoteInvoke/invokeLambdaDebugging.test.ts b/packages/core/src/test/lambda/vue/remoteInvoke/invokeLambdaDebugging.test.ts new file mode 100644 index 00000000000..04cce5f9cef --- /dev/null +++ b/packages/core/src/test/lambda/vue/remoteInvoke/invokeLambdaDebugging.test.ts @@ -0,0 +1,595 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import assert from 'assert' +import { RemoteInvokeWebview, InitialData } from '../../../../lambda/vue/remoteInvoke/invokeLambda' +import { LambdaClient, DefaultLambdaClient } from '../../../../shared/clients/lambdaClient' +import * as vscode from 'vscode' +import sinon, { SinonStubbedInstance, createStubInstance } from 'sinon' +import { RemoteDebugController, DebugConfig } from '../../../../lambda/remoteDebugging/ldkController' +import { getTestWindow } from '../../../shared/vscode/window' +import { LambdaFunctionNode } from '../../../../lambda/explorer/lambdaFunctionNode' +import * as downloadLambda from '../../../../lambda/commands/downloadLambda' +import * as uploadLambda from '../../../../lambda/commands/uploadLambda' +import * as appBuilderUtils from '../../../../awsService/appBuilder/utils' +import * as messages from '../../../../shared/utilities/messages' +import globals from '../../../../shared/extensionGlobals' +import fs from '../../../../shared/fs/fs' +import { ToolkitError } from '../../../../shared' +import { createMockDebugConfig } from '../../remoteDebugging/testUtils' + +describe('RemoteInvokeWebview - Debugging Functionality', () => { + let outputChannel: vscode.OutputChannel + let client: SinonStubbedInstance + let remoteInvokeWebview: RemoteInvokeWebview + let data: InitialData + let sandbox: sinon.SinonSandbox + let mockDebugController: SinonStubbedInstance + let mockFunctionNode: LambdaFunctionNode + + beforeEach(() => { + sandbox = sinon.createSandbox() + client = createStubInstance(DefaultLambdaClient) + outputChannel = { + appendLine: sandbox.stub(), + show: sandbox.stub(), + } as unknown as vscode.OutputChannel + + mockFunctionNode = { + configuration: { + FunctionName: 'testFunction', + FunctionArn: 'arn:aws:lambda:us-west-2:123456789012:function:testFunction', + Handler: 'index.handler', + Runtime: 'nodejs18.x', + SnapStart: { ApplyOn: 'None' }, + }, + regionCode: 'us-west-2', + localDir: '/local/path', + } as LambdaFunctionNode + + data = { + FunctionName: 'testFunction', + FunctionArn: 'arn:aws:lambda:us-west-2:123456789012:function:testFunction', + FunctionRegion: 'us-west-2', + InputSamples: [], + Runtime: 'nodejs18.x', + LocalRootPath: '/local/path', + LambdaFunctionNode: mockFunctionNode, + supportCodeDownload: true, + runtimeSupportsRemoteDebug: true, + regionSupportsRemoteDebug: true, + } as InitialData + + remoteInvokeWebview = new RemoteInvokeWebview(outputChannel, client, data) + + // Mock RemoteDebugController + mockDebugController = createStubInstance(RemoteDebugController) + sandbox.stub(RemoteDebugController, 'instance').get(() => mockDebugController) + + // Set handler file as available by default to avoid timeout issues + ;(remoteInvokeWebview as any).handlerFileAvailable = true + }) + + afterEach(() => { + sandbox.restore() + }) + + describe('Debug Timer Management', () => { + it('should start debug timer and count down', async () => { + remoteInvokeWebview.startDebugTimer() + + // Check initial state + assert.strictEqual(remoteInvokeWebview.getDebugTimeRemaining(), 60) + + // Wait a bit and check if timer is counting down + await new Promise((resolve) => { + setTimeout(() => { + const timeRemaining = remoteInvokeWebview.getDebugTimeRemaining() + assert(timeRemaining < 60 && timeRemaining > 0, 'Timer should be counting down') + remoteInvokeWebview.stopDebugTimer() + resolve() + }, 1100) // Wait slightly more than 1 second + }) + }) + + it('should stop debug timer', () => { + remoteInvokeWebview.startDebugTimer() + assert(remoteInvokeWebview.getDebugTimeRemaining() > 0) + + remoteInvokeWebview.stopDebugTimer() + assert.strictEqual(remoteInvokeWebview.getDebugTimeRemaining(), 0) + }) + + it('should handle timer expiration by stopping debugging', async () => { + const stopDebuggingStub = sandbox.stub(remoteInvokeWebview, 'stopDebugging').resolves(true) + + // Mock a very short timer for testing + sandbox.stub(remoteInvokeWebview, 'startDebugTimer').callsFake(() => { + // Simulate immediate timer expiration + setTimeout(async () => { + await (remoteInvokeWebview as any).handleTimerExpired() + }, 10) + }) + + remoteInvokeWebview.startDebugTimer() + + // Wait for timer to expire + await new Promise((resolve) => setTimeout(resolve, 50)) + + assert(stopDebuggingStub.calledOnce, 'stopDebugging should be called when timer expires') + }) + }) + + describe('Debug State Management', () => { + it('should reset server state correctly', () => { + // Set up some state + remoteInvokeWebview.startDebugTimer() + + // Mock the debugging state + mockDebugController.isDebugging = true + + remoteInvokeWebview.resetServerState() + + assert.strictEqual(remoteInvokeWebview.getDebugTimeRemaining(), 0) + assert.strictEqual(remoteInvokeWebview.isWebViewDebugging(), false) + }) + + it('should check if ready to invoke when not invoking', () => { + const result = remoteInvokeWebview.checkReadyToInvoke() + assert.strictEqual(result, true) + }) + + it('should show warning when invoke is in progress', () => { + // Mock the window.showWarningMessage through getTestWindow + getTestWindow().onDidShowMessage(() => { + // Message handler for warning + }) + + // Set invoking state + ;(remoteInvokeWebview as any).isInvoking = true + + const result = remoteInvokeWebview.checkReadyToInvoke() + + assert.strictEqual(result, false) + // The warning should be shown but we can't easily verify it in this test setup + }) + + it('should return correct debugging states', () => { + mockDebugController.isDebugging = true + assert.strictEqual(remoteInvokeWebview.isLDKDebugging(), true) + + mockDebugController.isDebugging = false + assert.strictEqual(remoteInvokeWebview.isLDKDebugging(), false) + }) + }) + + describe('Debug Configuration and Validation', () => { + let mockConfig: DebugConfig + + beforeEach(() => { + mockConfig = createMockDebugConfig({ + functionArn: data.FunctionArn, + functionName: data.FunctionName, + }) + }) + + it('should check ready to debug with valid config', async () => { + // Ensure handler file is available to avoid confirmation dialog + ;(remoteInvokeWebview as any).handlerFileAvailable = true + + const result = await remoteInvokeWebview.checkReadyToDebug(mockConfig) + assert.strictEqual(result, true) + }) + + it('should return false when LambdaFunctionNode is undefined', async () => { + remoteInvokeWebview = new RemoteInvokeWebview(outputChannel, client, { + ...data, + LambdaFunctionNode: undefined, + }) + + const result = await remoteInvokeWebview.checkReadyToDebug(mockConfig) + assert.strictEqual(result, false) + }) + + it('should show warning when handler file is not available', async () => { + const showConfirmationStub = sandbox.stub(messages, 'showConfirmationMessage').resolves(false) + + // Set handler file as not available + ;(remoteInvokeWebview as any).handlerFileAvailable = false + + const result = await remoteInvokeWebview.checkReadyToDebug(mockConfig) + + assert.strictEqual(result, false) + assert(showConfirmationStub.calledOnce) + }) + + it('should show snapstart warning when publishing version with snapstart enabled', async () => { + const showConfirmationStub = sandbox.stub(messages, 'showConfirmationMessage').resolves(false) + + mockConfig.shouldPublishVersion = true + data.LambdaFunctionNode!.configuration.SnapStart = { ApplyOn: 'PublishedVersions' } + + const result = await remoteInvokeWebview.checkReadyToDebug(mockConfig) + + assert.strictEqual(result, false) + assert(showConfirmationStub.calledOnce) + }) + }) + + describe('Debug Session Management', () => { + let mockConfig: DebugConfig + + beforeEach(() => { + mockConfig = createMockDebugConfig({ + functionArn: data.FunctionArn, + functionName: data.FunctionName, + }) + }) + + it('should start debugging successfully', async () => { + // Ensure handler file is available to avoid confirmation dialog + ;(remoteInvokeWebview as any).handlerFileAvailable = true + + mockDebugController.startDebugging.resolves() + mockDebugController.isDebugging = true + + const result = await remoteInvokeWebview.startDebugging(mockConfig) + + assert.strictEqual(result, true) + assert(mockDebugController.startDebugging.calledOnce) + }) + + it('should call stop debugging', async () => { + mockDebugController.isDebugging = true + mockDebugController.stopDebugging.resolves() + + await remoteInvokeWebview.stopDebugging() + + // The method doesn't return a boolean, it returns void + assert(mockDebugController.stopDebugging.calledOnce) + }) + + it('should handle debug pre-check with existing session', async () => { + const showConfirmationStub = sandbox.stub(messages, 'showConfirmationMessage').resolves(true) + const stopDebuggingStub = sandbox.stub(remoteInvokeWebview, 'stopDebugging').resolves(false) + mockDebugController.isDebugging = true + mockDebugController.installDebugExtension.resolves(true) + + // Mock revertExistingConfig - need to import it properly + const ldkController = require('../../../../lambda/remoteDebugging/ldkController') + const revertStub = sandbox.stub(ldkController, 'revertExistingConfig').resolves(true) + + await remoteInvokeWebview.debugPreCheck() + + assert(showConfirmationStub.calledOnce) + assert(stopDebuggingStub.calledOnce) + assert(mockDebugController.installDebugExtension.calledOnce) + assert(revertStub.calledOnce) + }) + }) + + describe('File Operations and Code Management', () => { + it('should prompt for folder selection', async () => { + const mockUri = vscode.Uri.file('/selected/folder') + getTestWindow().onDidShowDialog((d) => d.selectItem(mockUri)) + + const result = await remoteInvokeWebview.promptFolder() + + assert.strictEqual(result, mockUri.fsPath) + assert.strictEqual(remoteInvokeWebview.getLocalPath(), mockUri.fsPath) + }) + + it('should return undefined when no folder is selected', async () => { + getTestWindow().onDidShowDialog((d) => d.close()) + + const result = await remoteInvokeWebview.promptFolder() + + assert.strictEqual(result, undefined) + }) + + it('should try to open handler file successfully', async () => { + const mockHandlerUri = vscode.Uri.file('/local/path/index.js') + sandbox.stub(appBuilderUtils, 'getLambdaHandlerFile').resolves(mockHandlerUri) + sandbox.stub(fs, 'exists').resolves(true) + sandbox.stub(downloadLambda, 'openLambdaFile').resolves() + + const result = await remoteInvokeWebview.tryOpenHandlerFile('/local/path') + + assert.strictEqual(result, true) + assert.strictEqual(remoteInvokeWebview.getHandlerAvailable(), true) + }) + + it('should handle handler file not found', async () => { + sandbox.stub(appBuilderUtils, 'getLambdaHandlerFile').resolves(undefined) + + // Mock the warning message through getTestWindow + getTestWindow().onDidShowMessage(() => { + // Message handler for warning + }) + + const result = await remoteInvokeWebview.tryOpenHandlerFile('/local/path') + + assert.strictEqual(result, false) + assert.strictEqual(remoteInvokeWebview.getHandlerAvailable(), false) + }) + + it('should download remote code successfully', async () => { + const mockUri = vscode.Uri.file('/downloaded/path') + sandbox.stub(downloadLambda, 'runDownloadLambda').resolves(mockUri) + + // Mock workspace state operations + const mockWorkspaceState = { + get: sandbox.stub().returns({}), + update: sandbox.stub().resolves(), + } + sandbox.stub(globals, 'context').value({ + workspaceState: mockWorkspaceState, + }) + + const result = await remoteInvokeWebview.downloadRemoteCode() + + assert.strictEqual(result, mockUri.fsPath) + assert.strictEqual(data.LocalRootPath, mockUri.fsPath) + }) + + it('should handle download failure', async () => { + sandbox.stub(downloadLambda, 'runDownloadLambda').rejects(new Error('Download failed')) + + await assert.rejects( + async () => await remoteInvokeWebview.downloadRemoteCode(), + /Failed to download remote code/ + ) + }) + }) + + describe('File Watching and Code Synchronization', () => { + it('should setup file watcher when local root path exists', () => { + const createFileSystemWatcherStub = sandbox.stub(vscode.workspace, 'createFileSystemWatcher') + const mockWatcher = { + onDidChange: sandbox.stub(), + onDidCreate: sandbox.stub(), + onDidDelete: sandbox.stub(), + } + createFileSystemWatcherStub.returns(mockWatcher as any) + + // Call the private method through reflection + ;(remoteInvokeWebview as any).setupFileWatcher() + + assert(createFileSystemWatcherStub.calledOnce) + assert(mockWatcher.onDidChange.calledOnce) + assert(mockWatcher.onDidCreate.calledOnce) + assert(mockWatcher.onDidDelete.calledOnce) + }) + + it('should handle file changes and prompt for upload', async () => { + const showConfirmationStub = sandbox.stub(messages, 'showMessage').resolves('Yes') + const runUploadDirectoryStub = sandbox.stub(uploadLambda, 'runUploadDirectory').resolves() + + // Mock file watcher setup + let changeHandler: () => Promise + const mockWatcher = { + onDidChange: (handler: () => Promise) => { + changeHandler = handler + }, + onDidCreate: sandbox.stub(), + onDidDelete: sandbox.stub(), + } + sandbox.stub(vscode.workspace, 'createFileSystemWatcher').returns(mockWatcher as any) + + // Setup file watcher + ;(remoteInvokeWebview as any).setupFileWatcher() + + // Trigger file change + await changeHandler!() + + assert(showConfirmationStub.calledOnce) + assert(runUploadDirectoryStub.calledOnce) + }) + }) + + describe('Lambda Invocation with Debugging', () => { + it('should invoke lambda with remote debugging enabled', async () => { + const mockResponse = { + LogResult: Buffer.from('Debug log').toString('base64'), + Payload: '{"result": "debug success"}', + } + client.invoke.resolves(mockResponse) + mockDebugController.isDebugging = true + mockDebugController.qualifier = 'v1' + + const focusStub = sandbox.stub(vscode.commands, 'executeCommand').resolves() + + await remoteInvokeWebview.invokeLambda('{"test": "input"}', 'test', true) + + assert(client.invoke.calledWith(data.FunctionArn, '{"test": "input"}', 'v1')) + assert(focusStub.calledWith('workbench.action.focusFirstEditorGroup')) + }) + + it('should handle timer management during debugging invocation', async () => { + const mockResponse = { + LogResult: Buffer.from('Debug log').toString('base64'), + Payload: '{"result": "debug success"}', + } + client.invoke.resolves(mockResponse) + mockDebugController.isDebugging = true + + const stopTimerStub = sandbox.stub(remoteInvokeWebview, 'stopDebugTimer') + const startTimerStub = sandbox.stub(remoteInvokeWebview, 'startDebugTimer') + + await remoteInvokeWebview.invokeLambda('{"test": "input"}', 'test', true) + + // Timer should be stopped at least once during invoke + assert(stopTimerStub.calledOnce) + assert(startTimerStub.calledOnce) // Called after invoke + }) + }) + + describe('Dispose and Cleanup', () => { + it('should dispose server and clean up resources', async () => { + // Set up debugging state and disposables + ;(remoteInvokeWebview as any).debugging = true + mockDebugController.isDebugging = true + + // Mock disposables + const mockDisposable = { dispose: sandbox.stub() } + ;(remoteInvokeWebview as any).watcherDisposable = mockDisposable + ;(remoteInvokeWebview as any).fileWatcherDisposable = mockDisposable + + await remoteInvokeWebview.disposeServer() + + assert(mockDisposable.dispose.calledTwice) + assert(mockDebugController.stopDebugging.calledOnce) + }) + + it('should handle dispose when not debugging', async () => { + mockDebugController.isDebugging = false + + const mockDisposable = { dispose: sandbox.stub() } + ;(remoteInvokeWebview as any).watcherDisposable = mockDisposable + + await remoteInvokeWebview.disposeServer() + + assert(mockDisposable.dispose.calledOnce) + }) + }) + + describe('Debug Session Event Handling', () => { + it('should handle debug session termination', async () => { + const resetStateStub = sandbox.stub(remoteInvokeWebview, 'resetServerState') + + // Mock debug session termination event + let terminationHandler: (session: vscode.DebugSession) => Promise + sandbox.stub(vscode.debug, 'onDidTerminateDebugSession').callsFake((handler) => { + terminationHandler = handler + return { dispose: sandbox.stub() } + }) + + // Initialize the webview to set up event handlers + remoteInvokeWebview.init() + + // Simulate debug session termination + const mockSession = { name: 'test-session' } as vscode.DebugSession + await terminationHandler!(mockSession) + + assert(resetStateStub.calledOnce) + }) + }) + + describe('Debugging Flow', () => { + let mockConfig: DebugConfig + + beforeEach(() => { + mockConfig = createMockDebugConfig({ + functionArn: data.FunctionArn, + functionName: data.FunctionName, + }) + + // Mock telemetry to avoid issues + sandbox.stub(require('../../../../shared/telemetry/telemetry'), 'telemetry').value({ + lambda_invokeRemote: { + emit: sandbox.stub(), + }, + }) + }) + + it('should handle complete debugging workflow', async () => { + // Setup mocks for successful debugging + mockDebugController.startDebugging.resolves() + mockDebugController.stopDebugging.resolves() + mockDebugController.isDebugging = false + + // Mock the debugging state change after startDebugging is called + mockDebugController.startDebugging.callsFake(async () => { + mockDebugController.isDebugging = true + return Promise.resolve() + }) + + // 1. Start debugging + const startResult = await remoteInvokeWebview.startDebugging(mockConfig) + assert.strictEqual(startResult, true, 'Debug session should start successfully') + + // Set qualifier for invocation + mockDebugController.qualifier = '$LATEST' + + // 2. Test lambda invocation during debugging + const mockResponse = { + LogResult: Buffer.from('Debug invocation log').toString('base64'), + Payload: '{"debugResult": "success"}', + } + client.invoke.resolves(mockResponse) + + await remoteInvokeWebview.invokeLambda('{"debugInput": "test"}', 'integration-test', true) + + // Verify invocation was called with correct parameters + assert(client.invoke.calledWith(data.FunctionArn, '{"debugInput": "test"}', '$LATEST')) + + // 3. Stop debugging + await remoteInvokeWebview.stopDebugging() + + // Verify cleanup operations were called + assert(mockDebugController.stopDebugging.calledOnce, 'Should stop debugging') + }) + + it('should handle debugging failure gracefully', async () => { + // Setup mock for debugging failure + mockDebugController.startDebugging.rejects(new Error('Debug start failed')) + mockDebugController.isDebugging = false + + // Attempt to start debugging - should throw error + try { + await remoteInvokeWebview.startDebugging(mockConfig) + assert.fail('Expected error to be thrown') + } catch (error) { + assert(error instanceof ToolkitError) + assert(error.message.includes('Failed to start debugging')) + assert(error.cause?.message.includes('Debug start failed')) + } + + assert.strictEqual( + remoteInvokeWebview.isWebViewDebugging(), + false, + 'Webview should not be in debugging state' + ) + }) + + it('should handle version publishing workflow', async () => { + // Setup config for version publishing + const versionConfig = { ...mockConfig, shouldPublishVersion: true } + + // Setup mocks for version publishing + mockDebugController.startDebugging.resolves() + mockDebugController.stopDebugging.resolves() + mockDebugController.isDebugging = false + + // Mock the debugging state change after startDebugging is called + mockDebugController.startDebugging.callsFake(async () => { + mockDebugController.isDebugging = true + mockDebugController.qualifier = 'v1' + return Promise.resolve() + }) + + // Start debugging with version publishing + const startResult = await remoteInvokeWebview.startDebugging(versionConfig) + assert.strictEqual(startResult, true, 'Debug session should start successfully') + + // Test invocation with version qualifier + const mockResponse = { + LogResult: Buffer.from('Version debug log').toString('base64'), + Payload: '{"versionResult": "success"}', + } + client.invoke.resolves(mockResponse) + + await remoteInvokeWebview.invokeLambda('{"versionInput": "test"}', 'version-test', true) + + // Should invoke with version qualifier + assert(client.invoke.calledWith(data.FunctionArn, '{"versionInput": "test"}', 'v1')) + + // Stop debugging + await remoteInvokeWebview.stopDebugging() + + assert(mockDebugController.stopDebugging.calledOnce, 'Should stop debugging') + }) + }) +}) diff --git a/packages/core/src/test/shared/applicationBuilder/explorer/nodes/deployedNode.test.ts b/packages/core/src/test/shared/applicationBuilder/explorer/nodes/deployedNode.test.ts index afe8fb54dda..d8c0178593f 100644 --- a/packages/core/src/test/shared/applicationBuilder/explorer/nodes/deployedNode.test.ts +++ b/packages/core/src/test/shared/applicationBuilder/explorer/nodes/deployedNode.test.ts @@ -147,6 +147,7 @@ describe('generateDeployedNode', () => { regionCode: expectedRegionCode, stackName: expectedStackName, resourceTreeEntity: { + Id: 'MyLambdaFunction', Type: 'AWS::Serverless::Function', }, } @@ -237,6 +238,7 @@ describe('generateDeployedNode', () => { regionCode: expectedRegionCode, stackName: expectedStackName, resourceTreeEntity: { + Id: 'my-project-source-bucket-physical-id', Type: 'AWS::S3::Bucket', }, } @@ -284,6 +286,7 @@ describe('generateDeployedNode', () => { regionCode: expectedRegionCode, stackName: expectedStackName, resourceTreeEntity: { + Id: 'my-project-apigw-physical-id', Type: 'AWS::Serverless::Api', }, } @@ -356,6 +359,7 @@ describe('generateDeployedNode', () => { regionCode: expectedRegionCode, stackName: expectedStackName, resourceTreeEntity: { + Id: 'my-unsupported-resource-physical-id', Type: 'AWS::Serverless::UnsupportType', }, } diff --git a/packages/core/src/test/shared/clients/sagemakerClient.test.ts b/packages/core/src/test/shared/clients/sagemakerClient.test.ts new file mode 100644 index 00000000000..888d2222692 --- /dev/null +++ b/packages/core/src/test/shared/clients/sagemakerClient.test.ts @@ -0,0 +1,224 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as sinon from 'sinon' +import * as assert from 'assert' +import { SagemakerClient } from '../../../shared/clients/sagemaker' +import { AppDetails, SpaceDetails, DescribeDomainCommandOutput } from '@aws-sdk/client-sagemaker' +import { DescribeDomainResponse } from '@amzn/sagemaker-client' +import { intoCollection } from '../../../shared/utilities/collectionUtils' + +describe('SagemakerClient.fetchSpaceAppsAndDomains', function () { + const region = 'test-region' + let client: SagemakerClient + let listAppsStub: sinon.SinonStub + + const appDetails: AppDetails[] = [ + { AppName: 'app1', DomainId: 'domain1', SpaceName: 'space1', AppType: 'CodeEditor' }, + { AppName: 'app2', DomainId: 'domain2', SpaceName: 'space2', AppType: 'CodeEditor' }, + { AppName: 'app3', DomainId: 'domain2', SpaceName: 'space3', AppType: 'JupyterLab' }, + ] + + const spaceDetails: SpaceDetails[] = [ + { SpaceName: 'space1', DomainId: 'domain1' }, + { SpaceName: 'space2', DomainId: 'domain2' }, + { SpaceName: 'space3', DomainId: 'domain2' }, + { SpaceName: 'space4', DomainId: 'domain3' }, + ] + + const domain1: DescribeDomainResponse = { DomainId: 'domain1', DomainName: 'domainName1' } + const domain2: DescribeDomainResponse = { DomainId: 'domain2', DomainName: 'domainName2' } + const domain3: DescribeDomainResponse = { + DomainId: 'domain3', + DomainName: 'domainName3', + DomainSettings: { UnifiedStudioSettings: { DomainId: 'unifiedStudioDomain1' } }, + } + + beforeEach(function () { + client = new SagemakerClient(region) + + listAppsStub = sinon.stub(client, 'listApps').returns(intoCollection([appDetails])) + sinon.stub(client, 'listSpaces').returns(intoCollection([spaceDetails])) + sinon.stub(client, 'describeDomain').callsFake(async ({ DomainId }) => { + switch (DomainId) { + case 'domain1': + return domain1 as DescribeDomainCommandOutput + case 'domain2': + return domain2 as DescribeDomainCommandOutput + case 'domain3': + return domain3 as DescribeDomainCommandOutput + default: + return {} as DescribeDomainCommandOutput + } + }) + }) + + afterEach(function () { + sinon.restore() + }) + + it('returns a map of space details with corresponding app details', async function () { + const [spaceApps, domains] = await client.fetchSpaceAppsAndDomains() + + assert.strictEqual(spaceApps.size, 3) + assert.strictEqual(domains.size, 3) + + const spaceAppKey1 = 'domain1__space1' + const spaceAppKey2 = 'domain2__space2' + const spaceAppKey3 = 'domain2__space3' + + assert.ok(spaceApps.has(spaceAppKey1), 'Expected spaceApps to have key for domain1__space1') + assert.ok(spaceApps.has(spaceAppKey2), 'Expected spaceApps to have key for domain2__space2') + assert.ok(spaceApps.has(spaceAppKey3), 'Expected spaceApps to have key for domain2__space3') + + assert.deepStrictEqual(spaceApps.get(spaceAppKey1)?.App?.AppName, 'app1') + assert.deepStrictEqual(spaceApps.get(spaceAppKey2)?.App?.AppName, 'app2') + assert.deepStrictEqual(spaceApps.get(spaceAppKey3)?.App?.AppName, 'app3') + + const domainKey1 = 'domain1' + const domainKey2 = 'domain2' + + assert.ok(domains.has(domainKey1), 'Expected domains to have key for domain1') + assert.ok(domains.has(domainKey2), 'Expected domains to have key for domain2') + + assert.deepStrictEqual(domains.get(domainKey1)?.DomainName, 'domainName1') + assert.deepStrictEqual(domains.get(domainKey2)?.DomainName, 'domainName2') + }) + + it('returns map even if some spaces have no matching apps', async function () { + listAppsStub.returns(intoCollection([{ AppName: 'app1', DomainId: 'domain1', SpaceName: 'space1' }])) + + const [spaceApps] = await client.fetchSpaceAppsAndDomains() + for (const space of spaceApps) { + console.log(space[0]) + console.log(space[1]) + } + + const spaceAppKey2 = 'domain2__space2' + const spaceAppKey3 = 'domain2__space3' + + assert.strictEqual(spaceApps.size, 3) + assert.strictEqual(spaceApps.get(spaceAppKey2)?.App, undefined) + assert.strictEqual(spaceApps.get(spaceAppKey3)?.App, undefined) + }) + + describe('SagemakerClient.startSpace', function () { + const region = 'test-region' + let client: SagemakerClient + let describeSpaceStub: sinon.SinonStub + let updateSpaceStub: sinon.SinonStub + let waitForSpaceStub: sinon.SinonStub + let createAppStub: sinon.SinonStub + + beforeEach(function () { + client = new SagemakerClient(region) + describeSpaceStub = sinon.stub(client, 'describeSpace') + updateSpaceStub = sinon.stub(client, 'updateSpace') + waitForSpaceStub = sinon.stub(client as any, 'waitForSpaceInService') + createAppStub = sinon.stub(client, 'createApp') + }) + + afterEach(function () { + sinon.restore() + }) + + it('enables remote access and starts the app', async function () { + describeSpaceStub.resolves({ + SpaceSettings: { + RemoteAccess: 'DISABLED', + AppType: 'CodeEditor', + CodeEditorAppSettings: { + DefaultResourceSpec: { + InstanceType: 'ml.t3.large', + SageMakerImageArn: 'arn:aws:sagemaker:us-west-2:img', + SageMakerImageVersionAlias: '1.0.0', + }, + }, + }, + }) + + updateSpaceStub.resolves({}) + waitForSpaceStub.resolves() + createAppStub.resolves({}) + + await client.startSpace('my-space', 'my-domain') + + sinon.assert.calledOnce(updateSpaceStub) + sinon.assert.calledOnce(waitForSpaceStub) + sinon.assert.calledOnce(createAppStub) + }) + + it('skips enabling remote access if already enabled', async function () { + describeSpaceStub.resolves({ + SpaceSettings: { + RemoteAccess: 'ENABLED', + AppType: 'CodeEditor', + CodeEditorAppSettings: { + DefaultResourceSpec: { + InstanceType: 'ml.t3.large', + SageMakerImageArn: 'arn:aws:sagemaker:us-west-2:img', + SageMakerImageVersionAlias: '1.0.0', + }, + }, + }, + }) + + createAppStub.resolves({}) + + await client.startSpace('my-space', 'my-domain') + + sinon.assert.notCalled(updateSpaceStub) + sinon.assert.notCalled(waitForSpaceStub) + sinon.assert.calledOnce(createAppStub) + }) + + it('throws error on unsupported app type', async function () { + describeSpaceStub.resolves({ + SpaceSettings: { + RemoteAccess: 'ENABLED', + AppType: 'Studio', + }, + }) + + await assert.rejects(client.startSpace('my-space', 'my-domain'), /Unsupported AppType "Studio"/) + }) + + it('uses fallback resource spec when none provided', async function () { + describeSpaceStub.resolves({ + SpaceSettings: { + RemoteAccess: 'ENABLED', + AppType: 'JupyterLab', + JupyterLabAppSettings: { + DefaultResourceSpec: { + InstanceType: 'ml.t3.large', + }, + }, + }, + }) + + createAppStub.resolves({}) + + await client.startSpace('my-space', 'my-domain') + + sinon.assert.calledOnceWithExactly( + createAppStub, + sinon.match.hasNested('ResourceSpec', { + InstanceType: 'ml.t3.large', + SageMakerImageArn: 'arn:aws:sagemaker:us-west-2:542918446943:image/sagemaker-distribution-cpu', + SageMakerImageVersionAlias: '3.2.0', + }) + ) + }) + + it('handles AccessDeniedException gracefully', async function () { + describeSpaceStub.rejects({ name: 'AccessDeniedException', message: 'no access' }) + + await assert.rejects( + client.startSpace('my-space', 'my-domain'), + /You do not have permission to start spaces/ + ) + }) + }) +}) diff --git a/packages/core/src/test/shared/extensionUtilities.test.ts b/packages/core/src/test/shared/extensionUtilities.test.ts index 0fc846f54ab..16d3792c63b 100644 --- a/packages/core/src/test/shared/extensionUtilities.test.ts +++ b/packages/core/src/test/shared/extensionUtilities.test.ts @@ -9,7 +9,7 @@ import { AWSError } from 'aws-sdk' import * as sinon from 'sinon' import { DefaultEc2MetadataClient } from '../../shared/clients/ec2MetadataClient' import * as vscode from 'vscode' -import { UserActivity, getComputeRegion, initializeComputeRegion } from '../../shared/extensionUtilities' +import { UserActivity, getComputeRegion, initializeComputeRegion, isCn } from '../../shared/extensionUtilities' import { isDifferentVersion, setMostRecentVersion } from '../../shared/extensionUtilities' import { InstanceIdentity } from '../../shared/clients/ec2MetadataClient' import { extensionVersion } from '../../shared/vscode/env' @@ -18,6 +18,8 @@ import globals from '../../shared/extensionGlobals' import { maybeShowMinVscodeWarning } from '../../shared/extensionStartup' import { getTestWindow } from './vscode/window' import { assertTelemetry } from '../testUtil' +import { isSageMaker } from '../../shared/extensionUtilities' +import { hasSageMakerEnvVars } from '../../shared/vscode/env' describe('extensionUtilities', function () { it('maybeShowMinVscodeWarning', async () => { @@ -135,6 +137,73 @@ describe('initializeComputeRegion, getComputeRegion', async function () { }) }) +describe('isCn', function () { + let sandbox: sinon.SinonSandbox + const metadataService = new DefaultEc2MetadataClient() + + beforeEach(function () { + sandbox = sinon.createSandbox() + }) + + afterEach(function () { + sandbox.restore() + }) + + it('returns false when compute region is not defined', async function () { + // Reset the compute region to undefined first + const utils = require('../../shared/extensionUtilities') + Object.defineProperty(utils, 'computeRegion', { + value: undefined, + configurable: true, + }) + + const result = isCn() + + assert.strictEqual(result, false, 'isCn() should return false when compute region is undefined') + }) + + it('returns false when compute region is not initialized', async function () { + // Set the compute region to "notInitialized" + const utils = require('../../shared/extensionUtilities') + Object.defineProperty(utils, 'computeRegion', { + value: 'notInitialized', + configurable: true, + }) + + const result = isCn() + + assert.strictEqual(result, false, 'isCn() should return false when compute region is notInitialized') + }) + + it('returns true for CN regions', async function () { + sandbox.stub(metadataService, 'getInstanceIdentity').resolves({ region: 'cn-north-1' }) + await initializeComputeRegion(metadataService, false, true) + + const result = isCn() + + assert.strictEqual(result, true, 'isCn() should return true for China regions') + }) + + it('returns false for non-CN regions', async function () { + sandbox.stub(metadataService, 'getInstanceIdentity').resolves({ region: 'us-east-1' }) + await initializeComputeRegion(metadataService, false, true) + + const result = isCn() + + assert.strictEqual(result, false, 'isCn() should return false for non-China regions') + }) + + it('returns false when an error occurs', async function () { + const utils = require('../../shared/extensionUtilities') + + sandbox.stub(utils, 'getComputeRegion').throws(new Error('Test error')) + + const result = isCn() + + assert.strictEqual(result, false, 'isCn() should return false when an error occurs') + }) +}) + describe('UserActivity', function () { let count: number let sandbox: sinon.SinonSandbox @@ -294,3 +363,143 @@ describe('UserActivity', function () { return event.event } }) + +describe('isSageMaker', function () { + let sandbox: sinon.SinonSandbox + const env = require('../../shared/vscode/env') + const utils = require('../../shared/extensionUtilities') + + beforeEach(function () { + sandbox = sinon.createSandbox() + utils.resetSageMakerState() + }) + + afterEach(function () { + sandbox.restore() + }) + + describe('SMAI detection', function () { + it('returns true when both app name and env vars match', function () { + sandbox.stub(vscode.env, 'appName').value('SageMaker Code Editor') + sandbox.stub(env, 'hasSageMakerEnvVars').returns(true) + + assert.strictEqual(isSageMaker('SMAI'), true) + }) + + it('returns false when app name is different', function () { + sandbox.stub(vscode.env, 'appName').value('Visual Studio Code') + sandbox.stub(env, 'hasSageMakerEnvVars').returns(true) + + assert.strictEqual(isSageMaker('SMAI'), false) + }) + + it('returns false when env vars are missing', function () { + sandbox.stub(vscode.env, 'appName').value('SageMaker Code Editor') + sandbox.stub(env, 'hasSageMakerEnvVars').returns(false) + + assert.strictEqual(isSageMaker('SMAI'), false) + }) + + it('defaults to SMAI when no parameter provided', function () { + sandbox.stub(vscode.env, 'appName').value('SageMaker Code Editor') + sandbox.stub(env, 'hasSageMakerEnvVars').returns(true) + + assert.strictEqual(isSageMaker(), true) + }) + }) + + describe('SMUS detection', function () { + it('returns true when all conditions are met', function () { + sandbox.stub(vscode.env, 'appName').value('SageMaker Code Editor') + sandbox.stub(env, 'hasSageMakerEnvVars').returns(true) + sandbox.stub(process, 'env').value({ SERVICE_NAME: 'SageMakerUnifiedStudio' }) + utils.resetSageMakerState() + + assert.strictEqual(isSageMaker('SMUS'), true) + }) + + it('returns false when unified studio is missing', function () { + sandbox.stub(vscode.env, 'appName').value('SageMaker Code Editor') + sandbox.stub(env, 'hasSageMakerEnvVars').returns(true) + sandbox.stub(process, 'env').value({ SERVICE_NAME: 'SomeOtherService' }) + utils.resetSageMakerState() + + assert.strictEqual(isSageMaker('SMUS'), false) + }) + + it('returns false when env vars are missing', function () { + sandbox.stub(vscode.env, 'appName').value('SageMaker Code Editor') + sandbox.stub(env, 'hasSageMakerEnvVars').returns(false) + sandbox.stub(process, 'env').value({ SERVICE_NAME: 'SageMakerUnifiedStudio' }) + utils.resetSageMakerState() + + assert.strictEqual(isSageMaker('SMUS'), false) + }) + + it('returns false when app name is different', function () { + sandbox.stub(vscode.env, 'appName').value('Visual Studio Code') + sandbox.stub(env, 'hasSageMakerEnvVars').returns(true) + sandbox.stub(process, 'env').value({ SERVICE_NAME: 'SageMakerUnifiedStudio' }) + utils.resetSageMakerState() + + assert.strictEqual(isSageMaker('SMUS'), false) + }) + }) + + it('returns false for invalid appName parameter', function () { + sandbox.stub(vscode.env, 'appName').value('SageMaker Code Editor') + sandbox.stub(env, 'hasSageMakerEnvVars').returns(true) + + // @ts-ignore - Testing invalid input + assert.strictEqual(isSageMaker('INVALID'), false) + }) +}) + +describe('hasSageMakerEnvVars', function () { + let sandbox: sinon.SinonSandbox + + beforeEach(function () { + sandbox = sinon.createSandbox() + }) + + afterEach(function () { + sandbox.restore() + }) + + it('detects SageMaker environment variables', function () { + // Test SAGEMAKER_ prefix + sandbox.stub(process, 'env').value({ SAGEMAKER_APP_TYPE: 'JupyterServer' }) + assert.strictEqual(hasSageMakerEnvVars(), true) + + // Test SM_ prefix + sandbox.stub(process, 'env').value({ SM_APP_TYPE: 'CodeEditor' }) + assert.strictEqual(hasSageMakerEnvVars(), true) + + // Test SERVICE_NAME with correct value + sandbox.stub(process, 'env').value({ SERVICE_NAME: 'SageMakerUnifiedStudio' }) + assert.strictEqual(hasSageMakerEnvVars(), true) + + // Test STUDIO_LOGGING_DIR with correct path + sandbox.stub(process, 'env').value({ STUDIO_LOGGING_DIR: '/var/log/studio/app.log' }) + assert.strictEqual(hasSageMakerEnvVars(), true) + + // Test invalid SERVICE_NAME + sandbox.stub(process, 'env').value({ SERVICE_NAME: 'SomeOtherService' }) + assert.strictEqual(hasSageMakerEnvVars(), false) + + // Test invalid STUDIO_LOGGING_DIR + sandbox.stub(process, 'env').value({ STUDIO_LOGGING_DIR: '/var/log/other/app.log' }) + assert.strictEqual(hasSageMakerEnvVars(), false) + + // Test multiple env vars + sandbox.stub(process, 'env').value({ + SAGEMAKER_APP_TYPE: 'JupyterServer', + SM_APP_TYPE: 'CodeEditor', + }) + assert.strictEqual(hasSageMakerEnvVars(), true) + + // Test no env vars + sandbox.stub(process, 'env').value({}) + assert.strictEqual(hasSageMakerEnvVars(), false) + }) +}) diff --git a/packages/core/src/test/shared/lsp/utils/platform.test.ts b/packages/core/src/test/shared/lsp/utils/platform.test.ts new file mode 100644 index 00000000000..862bd06f990 --- /dev/null +++ b/packages/core/src/test/shared/lsp/utils/platform.test.ts @@ -0,0 +1,209 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import assert from 'assert' +import * as sinon from 'sinon' +import * as vscode from 'vscode' +import { createServerOptions } from '../../../../shared/lsp/utils/platform' +import * as extensionUtilities from '../../../../shared/extensionUtilities' +import * as env from '../../../../shared/vscode/env' +import { ChildProcess } from '../../../../shared/utilities/processUtils' + +describe('createServerOptions - SageMaker Authentication', function () { + let sandbox: sinon.SinonSandbox + let isSageMakerStub: sinon.SinonStub + let isRemoteWorkspaceStub: sinon.SinonStub + let executeCommandStub: sinon.SinonStub + + beforeEach(function () { + sandbox = sinon.createSandbox() + + isSageMakerStub = sandbox.stub(extensionUtilities, 'isSageMaker') + isRemoteWorkspaceStub = sandbox.stub(env, 'isRemoteWorkspace') + sandbox.stub(env, 'isDebugInstance').returns(false) + executeCommandStub = sandbox.stub(vscode.commands, 'executeCommand') + + sandbox.stub(ChildProcess.prototype, 'run').resolves() + sandbox.stub(ChildProcess.prototype, 'send').resolves() + sandbox.stub(ChildProcess.prototype, 'proc').returns({} as any) + }) + + afterEach(function () { + sandbox.restore() + }) + + // jscpd:ignore-start + it('sets USE_IAM_AUTH=true when authMode is Iam', async function () { + isSageMakerStub.returns(true) + executeCommandStub.withArgs('sagemaker.parseCookies').resolves({ authMode: 'Iam' }) + + // Capture constructor arguments using sinon stub + let capturedOptions: any = undefined + const childProcessConstructorSpy = sandbox.stub().callsFake((command: string, args: string[], options: any) => { + capturedOptions = options + // Create a fake instance with the methods we need + const fakeInstance = { + run: sandbox.stub().resolves(), + send: sandbox.stub().resolves(), + proc: sandbox.stub().returns({}), + pid: sandbox.stub().returns(12345), + stop: sandbox.stub(), + stopped: false, + } + return fakeInstance + }) + + // Replace ChildProcess constructor + sandbox.replace( + require('../../../../shared/utilities/processUtils'), + 'ChildProcess', + childProcessConstructorSpy + ) + + const serverOptions = createServerOptions({ + encryptionKey: Buffer.from('test-key'), + executable: ['node'], + serverModule: 'test-module.js', + execArgv: ['--stdio'], + }) + + await serverOptions() + + assert(capturedOptions, 'ChildProcess constructor should have been called') + assert(capturedOptions.spawnOptions, 'spawnOptions should be defined') + assert(capturedOptions.spawnOptions.env, 'spawnOptions.env should be defined') + assert.equal(capturedOptions.spawnOptions.env.USE_IAM_AUTH, 'true') + }) + + it('does not set USE_IAM_AUTH when authMode is Sso', async function () { + isSageMakerStub.returns(true) + executeCommandStub.withArgs('sagemaker.parseCookies').resolves({ authMode: 'Sso' }) + + // Capture constructor arguments using sinon stub + let capturedOptions: any = undefined + const childProcessConstructorSpy = sandbox.stub().callsFake((command: string, args: string[], options: any) => { + capturedOptions = options + // Create a fake instance with the methods we need + const fakeInstance = { + run: sandbox.stub().resolves(), + send: sandbox.stub().resolves(), + proc: sandbox.stub().returns({}), + pid: sandbox.stub().returns(12345), + stop: sandbox.stub(), + stopped: false, + } + return fakeInstance + }) + + // Replace ChildProcess constructor + sandbox.replace( + require('../../../../shared/utilities/processUtils'), + 'ChildProcess', + childProcessConstructorSpy + ) + + const serverOptions = createServerOptions({ + encryptionKey: Buffer.from('test-key'), + executable: ['node'], + serverModule: 'test-module.js', + execArgv: ['--stdio'], + }) + + await serverOptions() + + assert(capturedOptions, 'ChildProcess constructor should have been called') + assert(capturedOptions.spawnOptions, 'spawnOptions should be defined') + assert(capturedOptions.spawnOptions.env, 'spawnOptions.env should be defined') + assert.equal(capturedOptions.spawnOptions.env.USE_IAM_AUTH, undefined) + }) + + it('defaults to IAM auth when parseCookies fails', async function () { + isSageMakerStub.returns(true) + isRemoteWorkspaceStub.returns(false) + executeCommandStub.withArgs('sagemaker.parseCookies').rejects(new Error('Command failed')) + + // Capture constructor arguments using sinon stub + let capturedOptions: any = undefined + const childProcessConstructorSpy = sandbox.stub().callsFake((command: string, args: string[], options: any) => { + capturedOptions = options + // Create a fake instance with the methods we need + const fakeInstance = { + run: sandbox.stub().resolves(), + send: sandbox.stub().resolves(), + proc: sandbox.stub().returns({}), + pid: sandbox.stub().returns(12345), + stop: sandbox.stub(), + stopped: false, + } + return fakeInstance + }) + + // Replace ChildProcess constructor + sandbox.replace( + require('../../../../shared/utilities/processUtils'), + 'ChildProcess', + childProcessConstructorSpy + ) + + const serverOptions = createServerOptions({ + encryptionKey: Buffer.from('test-key'), + executable: ['node'], + serverModule: 'test-module.js', + execArgv: ['--stdio'], + }) + + await serverOptions() + + assert(capturedOptions, 'ChildProcess constructor should have been called') + assert(capturedOptions.spawnOptions, 'spawnOptions should be defined') + assert(capturedOptions.spawnOptions.env, 'spawnOptions.env should be defined') + assert.equal(capturedOptions.spawnOptions.env.USE_IAM_AUTH, 'true') + }) + + it('does not default to IAM in remote workspace without SMUS', async function () { + isSageMakerStub.returns(true) + isRemoteWorkspaceStub.returns(true) + process.env.SERVICE_NAME = 'OtherService' + executeCommandStub.withArgs('sagemaker.parseCookies').rejects(new Error('Command failed')) + + // Capture constructor arguments using sinon stub + let capturedOptions: any = undefined + const childProcessConstructorSpy = sandbox.stub().callsFake((command: string, args: string[], options: any) => { + capturedOptions = options + // Create a fake instance with the methods we need + const fakeInstance = { + run: sandbox.stub().resolves(), + send: sandbox.stub().resolves(), + proc: sandbox.stub().returns({}), + pid: sandbox.stub().returns(12345), + stop: sandbox.stub(), + stopped: false, + } + return fakeInstance + }) + + // Replace ChildProcess constructor + sandbox.replace( + require('../../../../shared/utilities/processUtils'), + 'ChildProcess', + childProcessConstructorSpy + ) + + const serverOptions = createServerOptions({ + encryptionKey: Buffer.from('test-key'), + executable: ['node'], + serverModule: 'test-module.js', + execArgv: ['--stdio'], + }) + + await serverOptions() + + assert(capturedOptions, 'ChildProcess constructor should have been called') + assert(capturedOptions.spawnOptions, 'spawnOptions should be defined') + assert(capturedOptions.spawnOptions.env, 'spawnOptions.env should be defined') + assert.equal(capturedOptions.spawnOptions.env.USE_IAM_AUTH, undefined) + }) + // jscpd:ignore-end +}) diff --git a/packages/core/src/test/shared/sshConfig.test.ts b/packages/core/src/test/shared/sshConfig.test.ts index 96ca450ae14..03841644e24 100644 --- a/packages/core/src/test/shared/sshConfig.test.ts +++ b/packages/core/src/test/shared/sshConfig.test.ts @@ -82,6 +82,16 @@ describe('VscodeRemoteSshConfig', async function () { const command = result.unwrap() assert.strictEqual(command, testProxyCommand) }) + + it('uses %n token for sagemaker_connect to preserve hostname case', async function () { + const sagemakerConfig = new MockSshConfig('sshPath', 'testHostNamePrefix', 'sagemaker_connect') + sagemakerConfig.testIsWin = false + + const result = await sagemakerConfig.getProxyCommandWrapper('sagemaker_connect') + assert.ok(result.isOk()) + const command = result.unwrap() + assert.strictEqual(command, `'sagemaker_connect' '%n'`) + }) }) describe('matchSshSection', async function () { diff --git a/packages/core/src/test/shared/telemetry/util.test.ts b/packages/core/src/test/shared/telemetry/util.test.ts index 8d6f3ddc53f..059d86a891e 100644 --- a/packages/core/src/test/shared/telemetry/util.test.ts +++ b/packages/core/src/test/shared/telemetry/util.test.ts @@ -24,6 +24,10 @@ import { randomUUID } from 'crypto' import { isUuid } from '../../../shared/crypto' import { MetricDatum } from '../../../shared/telemetry/clienttelemetry' import { assertLogsContain } from '../../globalSetup.test' +import { getClientName } from '../../../shared/telemetry/util' +import * as extensionUtilities from '../../../shared/extensionUtilities' +import * as sinon from 'sinon' +import * as vscode from 'vscode' describe('TelemetryConfig', function () { const settingKey = 'aws.telemetry' @@ -391,3 +395,70 @@ describe('validateMetricEvent', function () { assertLogsContain('invalid Metric', false, 'warn') }) }) + +describe('getClientName', function () { + let sandbox: sinon.SinonSandbox + let isSageMakerStub: sinon.SinonStub + + beforeEach(function () { + sandbox = sinon.createSandbox() + isSageMakerStub = sandbox.stub(extensionUtilities, 'isSageMaker') + }) + + afterEach(function () { + sandbox.restore() + }) + + it('returns "AmazonQ-For-SMUS-CE" when in SMUS environment', function () { + isSageMakerStub.withArgs('SMUS').returns(true) + sandbox.stub(vscode.env, 'appName').value('SageMaker Code Editor') + + const result = getClientName() + + assert.strictEqual(result, 'AmazonQ-For-SMUS-CE') + assert.ok(isSageMakerStub.calledOnceWith('SMUS')) + }) + + it('returns "AmazonQ-For-SMAI-CE" when in SMAI environment', function () { + isSageMakerStub.withArgs('SMUS').returns(false) + isSageMakerStub.withArgs('SMAI').returns(true) + sandbox.stub(vscode.env, 'appName').value('SageMaker Code Editor') + + const result = getClientName() + + assert.strictEqual(result, 'AmazonQ-For-SMAI-CE') + assert.ok(isSageMakerStub.calledWith('SMUS')) + assert.ok(isSageMakerStub.calledWith('SMAI')) + }) + + it('returns vscode app name when not in SMUS environment', function () { + const mockAppName = 'Visual Studio Code' + isSageMakerStub.withArgs('SMUS').returns(false) + isSageMakerStub.withArgs('SMAI').returns(false) + sandbox.stub(vscode.env, 'appName').value(mockAppName) + + const result = getClientName() + + assert.strictEqual(result, mockAppName) + assert.ok(isSageMakerStub.calledWith('SMUS')) + assert.ok(isSageMakerStub.calledWith('SMAI')) + }) + + it('handles undefined app name gracefully', function () { + isSageMakerStub.withArgs('SMUS').returns(false) + sandbox.stub(vscode.env, 'appName').value(undefined) + + const result = getClientName() + + assert.strictEqual(result, undefined) + }) + + it('prioritizes SMUS detection over app name', function () { + isSageMakerStub.withArgs('SMUS').returns(true) + sandbox.stub(vscode.env, 'appName').value('SageMaker Code Editor') + + const result = getClientName() + + assert.strictEqual(result, 'AmazonQ-For-SMUS-CE') + }) +}) diff --git a/packages/core/src/test/stepFunctions/explorer/stepFunctionNodes.test.ts b/packages/core/src/test/stepFunctions/explorer/stepFunctionNodes.test.ts index 0f6df30e3e7..61b4f2b1813 100644 --- a/packages/core/src/test/stepFunctions/explorer/stepFunctionNodes.test.ts +++ b/packages/core/src/test/stepFunctions/explorer/stepFunctionNodes.test.ts @@ -15,14 +15,14 @@ import { } from '../../utilities/explorerNodeAssertions' import { asyncGenerator } from '../../../shared/utilities/collectionUtils' import globals from '../../../shared/extensionGlobals' -import { DefaultStepFunctionsClient } from '../../../shared/clients/stepFunctionsClient' +import { StepFunctionsClient } from '../../../shared/clients/stepFunctions' import { stub } from '../../utilities/stubber' const regionCode = 'someregioncode' describe('StepFunctionsNode', function () { function createStatesClient(...stateMachineNames: string[]) { - const client = stub(DefaultStepFunctionsClient, { regionCode }) + const client = stub(StepFunctionsClient, { regionCode }) client.listStateMachines.returns( asyncGenerator( stateMachineNames.map((name) => { diff --git a/packages/core/src/test/stepFunctions/workflowStudio/workflowStudioApiHandler.test.ts b/packages/core/src/test/stepFunctions/workflowStudio/workflowStudioApiHandler.test.ts index 32c9160c1c1..c16534abc4d 100644 --- a/packages/core/src/test/stepFunctions/workflowStudio/workflowStudioApiHandler.test.ts +++ b/packages/core/src/test/stepFunctions/workflowStudio/workflowStudioApiHandler.test.ts @@ -16,7 +16,7 @@ import { } from '../../../stepFunctions/workflowStudio/types' import * as vscode from 'vscode' import { assertTelemetry } from '../../testUtil' -import { DefaultStepFunctionsClient } from '../../../shared/clients/stepFunctionsClient' +import { StepFunctionsClient } from '../../../shared/clients/stepFunctions' import { IamClient } from '../../../shared/clients/iam' describe('WorkflowStudioApiHandler', function () { @@ -64,7 +64,7 @@ describe('WorkflowStudioApiHandler', function () { fileId: '', } - const sfnClient = new DefaultStepFunctionsClient('us-east-1') + const sfnClient = new StepFunctionsClient('us-east-1') apiHandler = new WorkflowStudioApiHandler('us-east-1', context, { sfn: sfnClient, iam: new IamClient('us-east-1'), diff --git a/packages/core/src/testInteg/perf/prepareRepoData.test.ts b/packages/core/src/testInteg/perf/prepareRepoData.test.ts deleted file mode 100644 index c1ba1df1223..00000000000 --- a/packages/core/src/testInteg/perf/prepareRepoData.test.ts +++ /dev/null @@ -1,84 +0,0 @@ -/*! - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ -import assert from 'assert' -import * as sinon from 'sinon' -import { WorkspaceFolder } from 'vscode' -import { getEqualOSTestOptions, performanceTest } from '../../shared/performance/performance' -import { createTestWorkspace } from '../../test/testUtil' -import { prepareRepoData, TelemetryHelper } from '../../amazonqFeatureDev' -import { AmazonqCreateUpload, fs, getRandomString } from '../../shared' -import { Span } from '../../shared/telemetry' -import { FileSystem } from '../../shared/fs/fs' -import { getFsCallsUpperBound } from './utilities' - -type resultType = { - zipFileBuffer: Buffer - zipFileChecksum: string -} - -type setupResult = { - workspace: WorkspaceFolder - fsSpy: sinon.SinonSpiedInstance - numFiles: number - fileSize: number -} - -function performanceTestWrapper(numFiles: number, fileSize: number) { - return performanceTest( - getEqualOSTestOptions({ - userCpuUsage: 200, - systemCpuUsage: 35, - heapTotal: 20, - }), - `handles ${numFiles} files of size ${fileSize} bytes`, - function () { - const telemetry = new TelemetryHelper() - return { - setup: async () => { - const fsSpy = sinon.spy(fs) - const workspace = await createTestWorkspace(numFiles, { - fileNamePrefix: 'file', - fileContent: getRandomString(fileSize), - fileNameSuffix: '.md', - }) - return { workspace, fsSpy, numFiles, fileSize } - }, - execute: async (setup: setupResult) => { - return await prepareRepoData( - [setup.workspace.uri.fsPath], - [setup.workspace], - { - record: () => {}, - } as unknown as Span, - { telemetry } - ) - }, - verify: async (setup: setupResult, result: resultType) => { - verifyResult(setup, result, telemetry, numFiles * fileSize) - }, - } - } - ) -} - -function verifyResult(setup: setupResult, result: resultType, telemetry: TelemetryHelper, expectedSize: number): void { - assert.ok(result) - assert.strictEqual(Buffer.isBuffer(result.zipFileBuffer), true) - assert.strictEqual(telemetry.repositorySize, expectedSize) - assert.strictEqual(result.zipFileChecksum.length, 44) - assert.ok(getFsCallsUpperBound(setup.fsSpy) <= setup.numFiles * 8, 'total system calls should be under 8 per file') -} - -describe('prepareRepoData', function () { - describe('Performance Tests', function () { - afterEach(function () { - sinon.restore() - }) - performanceTestWrapper(10, 1000) - performanceTestWrapper(50, 500) - performanceTestWrapper(100, 100) - performanceTestWrapper(250, 10) - }) -}) diff --git a/packages/core/src/testInteg/perf/registerNewFiles.test.ts b/packages/core/src/testInteg/perf/registerNewFiles.test.ts deleted file mode 100644 index 716e79d4e48..00000000000 --- a/packages/core/src/testInteg/perf/registerNewFiles.test.ts +++ /dev/null @@ -1,89 +0,0 @@ -/*! - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ -import assert from 'assert' -import sinon from 'sinon' -import * as vscode from 'vscode' -import { featureDevScheme } from '../../amazonqFeatureDev' -import { getEqualOSTestOptions, performanceTest } from '../../shared/performance/performance' -import { getTestWorkspaceFolder } from '../integrationTestsUtilities' -import { VirtualFileSystem } from '../../shared' -import { registerNewFiles } from '../../amazonq/util/files' -import { NewFileInfo, NewFileZipContents } from '../../amazonq' - -interface SetupResult { - workspace: vscode.WorkspaceFolder - fileContents: NewFileZipContents[] - vfsSpy: sinon.SinonSpiedInstance - vfs: VirtualFileSystem -} - -function getFileContents(numFiles: number, fileSize: number): NewFileZipContents[] { - return Array.from({ length: numFiles }, (_, i) => { - return { - zipFilePath: `test-path-${i}`, - fileContent: 'x'.repeat(fileSize), - } - }) -} - -function performanceTestWrapper(label: string, numFiles: number, fileSize: number) { - const conversationId = 'test-conversation' - return performanceTest( - getEqualOSTestOptions({ - userCpuUsage: 300, - systemCpuUsage: 35, - heapTotal: 20, - }), - label, - function () { - return { - setup: async () => { - const testWorkspaceUri = vscode.Uri.file(getTestWorkspaceFolder()) - const fileContents = getFileContents(numFiles, fileSize) - const vfs = new VirtualFileSystem() - const vfsSpy = sinon.spy(vfs) - - return { - workspace: { - uri: testWorkspaceUri, - name: 'test-workspace', - index: 0, - }, - fileContents: fileContents, - vfsSpy: vfsSpy, - vfs: vfs, - } - }, - execute: async (setup: SetupResult) => { - return registerNewFiles( - setup.vfs, - setup.fileContents, - 'test-upload-id', - [setup.workspace], - conversationId, - featureDevScheme - ) - }, - verify: async (setup: SetupResult, result: NewFileInfo[]) => { - assert.strictEqual(result.length, numFiles) - assert.ok( - setup.vfsSpy.registerProvider.callCount <= numFiles, - 'only register each file once in vfs' - ) - }, - } - } - ) -} - -describe('registerNewFiles', function () { - describe('performance tests', function () { - performanceTestWrapper('1x10MB', 1, 10000) - performanceTestWrapper('10x1000B', 10, 1000) - performanceTestWrapper('100x100B', 100, 100) - performanceTestWrapper('1000x10B', 1000, 10) - performanceTestWrapper('10000x1B', 10000, 1) - }) -}) diff --git a/packages/core/src/testInteg/perf/zipcode.test.ts b/packages/core/src/testInteg/perf/zipcode.test.ts index f5e81086152..71303e493c9 100644 --- a/packages/core/src/testInteg/perf/zipcode.test.ts +++ b/packages/core/src/testInteg/perf/zipcode.test.ts @@ -54,7 +54,6 @@ function performanceTestWrapper(numberOfFiles: number, fileSize: number) { path: setup.tempDir, name: setup.tempFileName, }, - humanInTheLoopFlag: false, projectPath: setup.tempDir, zipManifest: setup.transformQManifest, }) diff --git a/packages/core/src/testLint/eslint.test.ts b/packages/core/src/testLint/eslint.test.ts index ccf670a1cee..fc3607008bb 100644 --- a/packages/core/src/testLint/eslint.test.ts +++ b/packages/core/src/testLint/eslint.test.ts @@ -12,6 +12,8 @@ describe('eslint', function () { it('passes eslint', function () { const result = runCmd( [ + 'node', + '--max-old-space-size=8192', '../../node_modules/.bin/eslint', '-c', '../../.eslintrc.js', diff --git a/packages/core/src/testLint/gitSecrets.test.ts b/packages/core/src/testLint/gitSecrets.test.ts index fce29585d1c..49091665ea1 100644 --- a/packages/core/src/testLint/gitSecrets.test.ts +++ b/packages/core/src/testLint/gitSecrets.test.ts @@ -23,7 +23,12 @@ describe('git-secrets', function () { /** git-secrets patterns that will not cause a failure during the scan */ function setAllowListPatterns(gitSecrets: string) { - const allowListPatterns: string[] = ['"accountId": "123456789012"'] + const allowListPatterns: string[] = [ + '"accountId": "123456789012"', + "'accountId': '123456789012'", + "Account: '123456789012'", + "accountId: '123456789012'", + ] for (const pattern of allowListPatterns) { // Returns non-zero exit code if pattern already exists diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index 3baba69a575..702a86ee8e6 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -7,5 +7,6 @@ "declaration": true, "declarationMap": true }, - "exclude": ["node_modules", ".vscode-test", "src/testFixtures", "dist"] + "exclude": ["node_modules", ".vscode-test", "src/testFixtures", "dist"], + "noEmitOnError": false // allow emitting even with type errors } diff --git a/packages/core/webpack.config.js b/packages/core/webpack.config.js index fba19d133b2..b58c990704a 100644 --- a/packages/core/webpack.config.js +++ b/packages/core/webpack.config.js @@ -23,6 +23,7 @@ module.exports = (env, argv) => { ...baseConfig, entry: { 'src/stepFunctions/asl/aslServer': './src/stepFunctions/asl/aslServer.ts', + 'src/awsService/sagemaker/detached-server/server': './src/awsService/sagemaker/detached-server/server.ts', }, } diff --git a/packages/toolkit/.changes/3.67.0.json b/packages/toolkit/.changes/3.67.0.json new file mode 100644 index 00000000000..21522dc5d87 --- /dev/null +++ b/packages/toolkit/.changes/3.67.0.json @@ -0,0 +1,18 @@ +{ + "date": "2025-06-25", + "version": "3.67.0", + "entries": [ + { + "type": "Bug Fix", + "description": "State Machine deployments can now be initiated directly from Workflow Studio without closing the editor" + }, + { + "type": "Bug Fix", + "description": "Step Function performance metrics now accurately reflect only Workflow Studio document activity" + }, + { + "type": "Feature", + "description": "AccessAnalyzer: CheckNoPublicAccess custom policy check supports additional resource types." + } + ] +} \ No newline at end of file diff --git a/packages/toolkit/.changes/3.68.0.json b/packages/toolkit/.changes/3.68.0.json new file mode 100644 index 00000000000..2c650f157ad --- /dev/null +++ b/packages/toolkit/.changes/3.68.0.json @@ -0,0 +1,18 @@ +{ + "date": "2025-07-03", + "version": "3.68.0", + "entries": [ + { + "type": "Bug Fix", + "description": "[StepFunctions]: Cannot call TestState with variables in Workflow Studio" + }, + { + "type": "Feature", + "description": "Lambda to SAM Transformation: AWS Toolkit Explorer now can convert existing Lambda functions into SAM (Serverless Application Model) projects. This conversion creates a project structure that's ready for local development and can be managed using Application Builder" + }, + { + "type": "Feature", + "description": "Lambda Quick Edit: AWS Toolkit Explorer now offers a streamlined editing experience for Lambda functions. Download a function's code with double-click, make local modifications, and easily synchronize changes back to the cloud." + } + ] +} \ No newline at end of file diff --git a/packages/toolkit/.changes/3.69.0.json b/packages/toolkit/.changes/3.69.0.json new file mode 100644 index 00000000000..dc2d04d1582 --- /dev/null +++ b/packages/toolkit/.changes/3.69.0.json @@ -0,0 +1,46 @@ +{ + "date": "2025-07-16", + "version": "3.69.0", + "entries": [ + { + "type": "Bug Fix", + "description": "SageMaker: Enable per-region manual filtering of Spaces" + }, + { + "type": "Bug Fix", + "description": "SageMaker: Show error message when connecting remotely from a remote workspace" + }, + { + "type": "Bug Fix", + "description": "SageMaker: Prompt user to use upgraded instance type if the chosen one has insufficient memory" + }, + { + "type": "Bug Fix", + "description": "Lambda upload from directory doesn't allow selection of directory" + }, + { + "type": "Bug Fix", + "description": "Toolkit fails to recognize it's logged in when editing Lambda function" + }, + { + "type": "Bug Fix", + "description": "SageMaker: Resolve race condition when reconnecting from multiple remote windows." + }, + { + "type": "Bug Fix", + "description": "SageMaker: Resolve connection issues to SageMaker Spaces with capital letters in the name" + }, + { + "type": "Feature", + "description": "SageMaker: Add support for deep-linked Space reconnection" + }, + { + "type": "Feature", + "description": "Lambda Remote Debugging: Remote invoke configuration webview now supports attaching a debugger to directly debug your lambda function in the cloud." + }, + { + "type": "Feature", + "description": "SageMaker: Enable auto-shutdown support for Spaces" + } + ] +} \ No newline at end of file diff --git a/packages/toolkit/.changes/3.70.0.json b/packages/toolkit/.changes/3.70.0.json new file mode 100644 index 00000000000..a41386724ab --- /dev/null +++ b/packages/toolkit/.changes/3.70.0.json @@ -0,0 +1,10 @@ +{ + "date": "2025-07-30", + "version": "3.70.0", + "entries": [ + { + "type": "Feature", + "description": "Improved connection actions for SSO" + } + ] +} \ No newline at end of file diff --git a/packages/toolkit/.changes/3.71.0.json b/packages/toolkit/.changes/3.71.0.json new file mode 100644 index 00000000000..9d22c0cd9e7 --- /dev/null +++ b/packages/toolkit/.changes/3.71.0.json @@ -0,0 +1,5 @@ +{ + "date": "2025-08-06", + "version": "3.71.0", + "entries": [] +} \ No newline at end of file diff --git a/packages/toolkit/.changes/next-release/Feature-2fdc05d7-db85-4a4f-8af5-ec729fade8fd.json b/packages/toolkit/.changes/next-release/Feature-2fdc05d7-db85-4a4f-8af5-ec729fade8fd.json deleted file mode 100644 index 9feefa5d96f..00000000000 --- a/packages/toolkit/.changes/next-release/Feature-2fdc05d7-db85-4a4f-8af5-ec729fade8fd.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "type": "Feature", - "description": "AccessAnalyzer: CheckNoPublicAccess custom policy check supports additional resource types." -} diff --git a/packages/toolkit/CHANGELOG.md b/packages/toolkit/CHANGELOG.md index d978b0c9a82..51beb2a13e5 100644 --- a/packages/toolkit/CHANGELOG.md +++ b/packages/toolkit/CHANGELOG.md @@ -1,3 +1,36 @@ +## 3.71.0 2025-08-06 + +- Miscellaneous non-user-facing changes + +## 3.70.0 2025-07-30 + +- **Feature** Improved connection actions for SSO + +## 3.69.0 2025-07-16 + +- **Bug Fix** SageMaker: Enable per-region manual filtering of Spaces +- **Bug Fix** SageMaker: Show error message when connecting remotely from a remote workspace +- **Bug Fix** SageMaker: Prompt user to use upgraded instance type if the chosen one has insufficient memory +- **Bug Fix** Lambda upload from directory doesn't allow selection of directory +- **Bug Fix** Toolkit fails to recognize it's logged in when editing Lambda function +- **Bug Fix** SageMaker: Resolve race condition when reconnecting from multiple remote windows. +- **Bug Fix** SageMaker: Resolve connection issues to SageMaker Spaces with capital letters in the name +- **Feature** SageMaker: Add support for deep-linked Space reconnection +- **Feature** Lambda Remote Debugging: Remote invoke configuration webview now supports attaching a debugger to directly debug your lambda function in the cloud. +- **Feature** SageMaker: Enable auto-shutdown support for Spaces + +## 3.68.0 2025-07-03 + +- **Bug Fix** [StepFunctions]: Cannot call TestState with variables in Workflow Studio +- **Feature** Lambda to SAM Transformation: AWS Toolkit Explorer now can convert existing Lambda functions into SAM (Serverless Application Model) projects. This conversion creates a project structure that's ready for local development and can be managed using Application Builder +- **Feature** Lambda Quick Edit: AWS Toolkit Explorer now offers a streamlined editing experience for Lambda functions. Download a function's code with double-click, make local modifications, and easily synchronize changes back to the cloud. + +## 3.67.0 2025-06-25 + +- **Bug Fix** State Machine deployments can now be initiated directly from Workflow Studio without closing the editor +- **Bug Fix** Step Function performance metrics now accurately reflect only Workflow Studio document activity +- **Feature** AccessAnalyzer: CheckNoPublicAccess custom policy check supports additional resource types. + ## 3.66.0 2025-06-18 - Miscellaneous non-user-facing changes diff --git a/packages/toolkit/package.json b/packages/toolkit/package.json index e4a6639c3a1..9539121648e 100644 --- a/packages/toolkit/package.json +++ b/packages/toolkit/package.json @@ -2,7 +2,7 @@ "name": "aws-toolkit-vscode", "displayName": "AWS Toolkit", "description": "Including CodeCatalyst, Infrastructure Composer, and support for Lambda, S3, CloudWatch Logs, CloudFormation, and many other services.", - "version": "3.67.0-SNAPSHOT", + "version": "3.72.0-SNAPSHOT", "extensionKind": [ "workspace" ], @@ -262,6 +262,10 @@ "amazonqLSPInlineChat": { "type": "boolean", "default": false + }, + "amazonqLSPNEP": { + "type": "boolean", + "default": false } }, "additionalProperties": false @@ -295,6 +299,11 @@ "default": "", "description": "A JSON formatted file that specifies template parameter values, a stack policy, and tags. Only parameters are used from this file.", "scope": "machine-overridable" + }, + "aws.sagemaker.studio.spaces.enableIdentityFiltering": { + "type": "boolean", + "default": false, + "description": "Enable automatic filtration of spaces based on your AWS identity." } } }, @@ -822,6 +831,10 @@ "command": "aws.downloadStateMachineDefinition", "when": "false" }, + { + "command": "aws.toolkit.lambda.convertToSam", + "when": "false" + }, { "command": "aws.ecr.createRepository", "when": "false" @@ -1240,6 +1253,10 @@ { "command": "aws.newThreatComposerFile", "when": "false" + }, + { + "command": "aws.sagemaker.filterSpaceApps", + "when": "false" } ], "editor/title": [ @@ -1446,6 +1463,16 @@ } ], "view/item/context": [ + { + "command": "aws.sagemaker.stopSpace", + "group": "inline@0", + "when": "viewItem =~ /^(awsSagemakerSpaceRunningRemoteEnabledNode|awsSagemakerSpaceRunningRemoteDisabledNode)$/" + }, + { + "command": "aws.sagemaker.openRemoteConnection", + "group": "inline@1", + "when": "viewItem =~ /^(awsSagemakerSpaceRunningRemoteEnabledNode|awsSagemakerSpaceStoppedRemoteEnabledNode|awsSagemakerSpaceStoppedRemoteDisabledNode)$/" + }, { "command": "_aws.toolkit.notifications.dismiss", "when": "viewItem == toolkitNotificationStartUp", @@ -1601,6 +1628,11 @@ "when": "view == aws.explorer && viewItem == awsRegionNode", "group": "0@1" }, + { + "command": "aws.sagemaker.filterSpaceApps", + "when": "view == aws.explorer && viewItem == awsSagemakerParentNode", + "group": "inline@1" + }, { "command": "aws.toolkit.lambda.createServerlessLandProject", "when": "view == aws.explorer && viewItem == awsLambdaNode || viewItem == awsRegionNode", @@ -1661,6 +1693,16 @@ "when": "view =~ /^(aws.explorer|aws.appBuilder|aws.appBuilderForFileExplorer)$/ && viewItem =~ /^(awsRegionFunctionNode|awsRegionFunctionNodeDownloadable)$/ || viewItem == awsAppBuilderDeployedNode", "group": "0@2" }, + { + "command": "aws.lambda.openWorkspace", + "when": "view == aws.explorer && viewItem == awsRegionFunctionNodeDownloadable", + "group": "0@6" + }, + { + "command": "aws.toolkit.lambda.convertToSam", + "when": "view == aws.explorer && viewItem == awsRegionFunctionNodeDownloadable", + "group": "0@3" + }, { "command": "aws.uploadLambda", "when": "view =~ /^(aws.explorer|aws.appBuilder|aws.appBuilderForFileExplorer)$/ && viewItem =~ /^(awsRegionFunctionNode|awsRegionFunctionNodeDownloadable)$/ || viewItem == awsAppBuilderDeployedNode", @@ -1771,6 +1813,11 @@ "when": "view == aws.explorer && viewItem =~ /^awsIotCertificateNode.(Things|Policies)/", "group": "0@1" }, + { + "command": "aws.sagemaker.filterSpaceApps", + "when": "view == aws.explorer && viewItem == awsSagemakerParentNode", + "group": "0@1" + }, { "command": "aws.s3.createBucket", "when": "view == aws.explorer && viewItem == awsS3Node", @@ -2186,6 +2233,16 @@ "when": "view =~ /^(aws.explorer|aws.appBuilder|aws.appBuilderForFileExplorer)$/ && viewItem =~ /^(awsRegionFunctionNode|awsRegionFunctionNodeDownloadable|awsCloudFormationFunctionNode)$/", "group": "inline@2" }, + { + "command": "aws.quickDeployLambda", + "when": "view == aws.explorer && viewItem == awsRegionFunctionNodeDownloadable", + "group": "inline@3" + }, + { + "command": "aws.toolkit.lambda.convertToSam", + "when": "view == aws.explorer && viewItem == awsRegionFunctionNodeDownloadable", + "group": "inline@4" + }, { "command": "aws.docdb.createCluster", "when": "view == aws.explorer && viewItem == awsDocDBNode", @@ -2272,7 +2329,7 @@ }, { "command": "aws.appBuilder.tailLogs", - "when": "view =~ /^(aws.explorer|aws.appBuilder|aws.appBuilderForFileExplorer)$/ && viewItem =~ /^(awsRegionFunctionNode|awsRegionFunctionNodeDownloadable|awsCloudFormationFunctionNode)$/", + "when": "view =~ /^(aws.appBuilder|aws.appBuilderForFileExplorer)$/ && viewItem =~ /^(awsRegionFunctionNode|awsRegionFunctionNodeDownloadable|awsCloudFormationFunctionNode)$/", "group": "inline@3" } ], @@ -2561,6 +2618,42 @@ } } }, + { + "command": "aws.sagemaker.filterSpaceApps", + "title": "%AWS.command.sagemaker.filterSpaces%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(extensions-filter)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.sagemaker.openRemoteConnection", + "title": "Connect to SageMaker Space", + "icon": "$(remote-explorer)", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.sagemaker.stopSpace", + "title": "Stop SageMaker Space", + "icon": "$(debug-stop)", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, { "command": "aws.ec2.startInstance", "title": "%AWS.command.ec2.startInstance%", @@ -3000,6 +3093,17 @@ } } }, + { + "command": "aws.lambda.remoteDebugging.clearSnapshot", + "title": "%AWS.command.remoteDebugging.clearSnapshot%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, { "command": "aws.invokeLambda", "title": "%AWS.command.invokeLambda%", @@ -3013,6 +3117,21 @@ } } }, + { + "command": "aws.toolkit.lambda.convertToSam", + "title": "%AWS.command.lambda.convertToSam%", + "category": "%AWS.title%", + "enablement": "viewItem == awsRegionFunctionNodeDownloadable", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + }, + "icon": { + "light": "resources/icons/aws/lambda/create-stack.svg", + "dark": "resources/icons/aws/lambda/create-stack-light.svg" + } + }, { "command": "aws.downloadLambda", "title": "%AWS.command.downloadLambda%", @@ -3024,6 +3143,17 @@ } } }, + { + "command": "aws.lambda.openWorkspace", + "title": "%AWS.command.openLambdaWorkspace%", + "category": "%AWS.title%", + "enablement": "viewItem == awsRegionFunctionNodeDownloadable", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, { "command": "aws.uploadLambda", "title": "%AWS.command.uploadLambda%", @@ -3033,7 +3163,27 @@ "cn": { "category": "%AWS.title.cn%" } - } + }, + "icon": "$(cloud-upload)" + }, + { + "command": "aws.openLambdaFile", + "title": "%AWS.command.openLambdaFile%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(preview)" + }, + { + "command": "aws.quickDeployLambda", + "title": "%AWS.command.quickDeployLambda%", + "category": "%AWS.title%", + "enablement": "viewItem == awsRegionFunctionNodeDownloadable", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + }, + "icon": "$(cloud-upload)" }, { "command": "aws.deleteLambda", @@ -4561,110 +4711,138 @@ "fontCharacter": "\\f1d0" } }, - "aws-lambda-function": { + "aws-lambda-create-stack": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1d1" } }, - "aws-mynah-MynahIconBlack": { + "aws-lambda-create-stack-light": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1d2" } }, - "aws-mynah-MynahIconWhite": { + "aws-lambda-function": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1d3" } }, - "aws-mynah-logo": { + "aws-mynah-MynahIconBlack": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1d4" } }, - "aws-redshift-cluster": { + "aws-mynah-MynahIconWhite": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1d5" } }, - "aws-redshift-cluster-connected": { + "aws-mynah-logo": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1d6" } }, - "aws-redshift-database": { + "aws-redshift-cluster": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1d7" } }, - "aws-redshift-redshift-cluster-connected": { + "aws-redshift-cluster-connected": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1d8" } }, - "aws-redshift-schema": { + "aws-redshift-database": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1d9" } }, - "aws-redshift-table": { + "aws-redshift-redshift-cluster-connected": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1da" } }, - "aws-s3-bucket": { + "aws-redshift-schema": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1db" } }, - "aws-s3-create-bucket": { + "aws-redshift-table": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1dc" } }, - "aws-schemas-registry": { + "aws-s3-bucket": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1dd" } }, - "aws-schemas-schema": { + "aws-s3-create-bucket": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1de" } }, - "aws-stepfunctions-preview": { + "aws-sagemaker-code-editor": { "description": "AWS Contributed Icon", "default": { "fontPath": "./resources/fonts/aws-toolkit-icons.woff", "fontCharacter": "\\f1df" } + }, + "aws-sagemaker-jupyter-lab": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1e0" + } + }, + "aws-schemas-registry": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1e1" + } + }, + "aws-schemas-schema": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1e2" + } + }, + "aws-stepfunctions-preview": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1e3" + } } }, "notebooks": [ diff --git a/packages/toolkit/scripts/build/copyFiles.ts b/packages/toolkit/scripts/build/copyFiles.ts index e081a2eb9b4..782c16ddb50 100644 --- a/packages/toolkit/scripts/build/copyFiles.ts +++ b/packages/toolkit/scripts/build/copyFiles.ts @@ -29,7 +29,6 @@ const tasks: CopyTask[] = [ ...['LICENSE', 'NOTICE'].map((f) => { return { target: path.join('../../', f), destination: path.join(projectRoot, f) } }), - { target: path.join('../core', 'resources'), destination: path.join('..', 'resources') }, { target: path.join('../core/', 'package.nls.json'), @@ -69,6 +68,21 @@ const tasks: CopyTask[] = [ destination: path.join('src', 'stepFunctions', 'asl', 'aslServer.js'), }, + // Sagemaker local server + { + target: path.join( + '../../node_modules', + 'aws-core-vscode', + 'dist', + 'src', + 'awsService', + 'sagemaker', + 'detached-server', + 'server.js' + ), + destination: path.join('src', 'awsService', 'sagemaker', 'detached-server', 'server.js'), + }, + // Serverless Land { target: path.join( diff --git a/packages/toolkit/tsconfig.json b/packages/toolkit/tsconfig.json index 2ec1c0534c1..0aef63efe5a 100644 --- a/packages/toolkit/tsconfig.json +++ b/packages/toolkit/tsconfig.json @@ -5,5 +5,6 @@ "baseUrl": ".", "rootDir": "." }, - "exclude": ["node_modules", ".vscode-test", "src/testFixtures", "dist"] + "exclude": ["node_modules", ".vscode-test", "src/testFixtures", "dist"], + "noEmitOnError": false // allow emitting even with type errors } diff --git a/packages/webpack.web.config.js b/packages/webpack.web.config.js index 0f82af67389..4495088a773 100644 --- a/packages/webpack.web.config.js +++ b/packages/webpack.web.config.js @@ -50,6 +50,9 @@ module.exports = (env, argv) => { new webpack.IgnorePlugin({ resourceRegExp: /ps-list/, // matches the path in the require() statement }), + new webpack.IgnorePlugin({ + resourceRegExp: /svgdom/, // matches the path in the require() statement + }), ], resolve: { extensions: ['.ts', '.js'], diff --git a/src.gen/@amzn/sagemaker-client/1.0.0.tgz b/src.gen/@amzn/sagemaker-client/1.0.0.tgz new file mode 100644 index 00000000000..4821da0e727 Binary files /dev/null and b/src.gen/@amzn/sagemaker-client/1.0.0.tgz differ diff --git a/tsconfig.json b/tsconfig.json index b5676bad46b..c1c1b0ee221 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,7 +15,7 @@ "jsx": "preserve", "esModuleInterop": true, "incremental": true, - "noEmitOnError": true, + "noEmitOnError": false, "skipLibCheck": true } }