Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
df3f0a6
Merge master into feature/hybridChat
aws-toolkit-automation Apr 14, 2025
cee5b62
Merge master into feature/hybridChat
aws-toolkit-automation Apr 15, 2025
f79d193
Merge master into feature/hybridChat
aws-toolkit-automation Apr 15, 2025
e827c74
Merge master into feature/hybridChat
aws-toolkit-automation Apr 15, 2025
af581ba
Merge master into feature/hybridChat
aws-toolkit-automation Apr 16, 2025
726ccd8
feat(amazonq): Add hybrid chat (#7032)
jpinkney-aws Apr 16, 2025
b127942
fix(amazonq): quick action handler should add to tab storage (#7070)
jpinkney-aws Apr 16, 2025
05cf555
fix(amazonq): use alpha manifest
jpinkney-aws Apr 16, 2025
772b35f
fix(amazonq): improve lsp cleanup logic (#7075)
jpinkney-aws Apr 16, 2025
938bb37
feat(amazonq): enable amazon q lsp + chat experiment by default
jpinkney-aws Apr 16, 2025
756c286
feat(amazonq): use qAgenticChatServer alpha manifest
jpinkney-aws Apr 16, 2025
d206d3b
fix(amazonq): set amazonq lsp experiment as true by default
jpinkney-aws Apr 17, 2025
721522a
fix(amazonq): duplicate quick actions
jpinkney-aws Apr 17, 2025
e0dbbac
fix(amazonq): acknowledgement is not adding to suppressPrompts when p…
jpinkney-aws Apr 17, 2025
49aa5c7
Merge 'public/master' into feature/hybridChat
justinmk3 Apr 17, 2025
91cd6e3
Merge master into feature/hybridChat
justinmk3 Apr 17, 2025
ebe7b8c
feat(amazonq): sync developer profiles to flare chat panel (#7072)
jpinkney-aws Apr 17, 2025
76b61df
Merge master into feature/hybridChat
aws-toolkit-automation Apr 17, 2025
44b6933
docs(amazonq): update instructions for enabling the chat client frin …
jpinkney-aws Apr 18, 2025
2358ce1
fix(amazonq): duplicate messages in flare chat (#7097)
jpinkney-aws Apr 18, 2025
6b15e9e
docs(amazonq): Add trace server instructions
jpinkney-aws Apr 18, 2025
1b20a6c
Merge remote-tracking branch 'origin/master' into HEAD
jpinkney-aws Apr 19, 2025
f1ced5a
fix(amazonq): de-dup developerProfiles conflict
jpinkney-aws Apr 19, 2025
0bbefa4
Merge pull request #7092 from aws/autoMerge/feature/hybridChat
jpinkney-aws Apr 19, 2025
168806e
fix(amazonq): enable local workspace server through flare (#7089)
jpinkney-aws Apr 20, 2025
50c0363
Update lsp.md (#7111)
aditya169 Apr 20, 2025
2e8d4c7
Merge master into feature/hybridChat
aws-toolkit-automation Apr 20, 2025
3954302
fix(amazonq): send proper cursor position to lsp (#7113)
Hweinstock Apr 20, 2025
c89997e
fix(amazonq): Sync client settings to language server (#7114)
nkomonen-amazon Apr 20, 2025
a7aa25c
feat(amazonq): add pair programming card (#7115)
jpinkney-aws Apr 21, 2025
e1242e8
Merge master into feature/hybridChat
aws-toolkit-automation Apr 21, 2025
893175e
Merge master into feature/hybridChat
aws-toolkit-automation Apr 21, 2025
e544eb0
fix(amazonq): temporarily disable q developer profiles (#7118)
jpinkney-aws Apr 21, 2025
1e48e36
feat(amazonq): handle link clicks in /help (#7120)
jpinkney-aws Apr 21, 2025
7bb66e1
feat(amazonq): Port in chat message error handling (#7121)
nkomonen-amazon Apr 21, 2025
ccbdf48
feat(lsp): add handler for openFileDiff notification (#7119)
ctlai95 Apr 22, 2025
3b619b0
feat(amazonq): handle stop response (#7122)
jpinkney-aws Apr 22, 2025
2055bbf
feat(amazonq): option to show diff in reverse order (#7126)
ctlai95 Apr 22, 2025
52cc07f
fix(amazonq): increase polling frequency for bearer token. (#7123)
Hweinstock Apr 22, 2025
1b107ab
feat(amazonq): add handling for button clicks (#7125)
Hweinstock Apr 22, 2025
61805b7
feat(amazonq): emit flare telemetry events (#7124)
jpinkney-aws Apr 22, 2025
6782509
fix(amazonq): diff not appearing for new files (#7127)
ctlai95 Apr 22, 2025
009258c
fix(amazonq): show empty response when token was cancelled (#7128)
jpinkney-aws Apr 22, 2025
69f6d01
fix(amazonq): add highlight feature config to context commands (#7131)
jpinkney-aws Apr 22, 2025
905d80c
Merge master into feature/hybridChat
aws-toolkit-automation Apr 22, 2025
8da7910
fix(amazonq): forward chat update notification (#7136)
ctlai95 Apr 22, 2025
8b1cca5
Merge master into feature/hybridChat
aws-toolkit-automation Apr 22, 2025
57940ed
Merge master into feature/hybridChat
aws-toolkit-automation Apr 22, 2025
cda61ec
fix(amazonq): simulate refresh of chat (#7142)
jpinkney-aws Apr 23, 2025
7291993
Revert "fix(amazonq): temporarily disable q developer profiles" (#7138)
jpinkney-aws Apr 23, 2025
7cf7897
fix(amazonq): deny restoreTabMessage/contextCommandData messages from…
jpinkney-aws Apr 23, 2025
1b7a86c
fix(amazonq): Add clarifying comment to telemetry pass through mechan…
opieter-aws Apr 23, 2025
4ba5251
fix(amazonq): developer profile api requests are still throttling
jpinkney-aws Apr 23, 2025
0bd3e12
fix(lsp): LSP download timeout message disappears too early (#7145)
nkomonen-amazon Apr 23, 2025
e39a32b
telemetry(amazonq): bump aws-toolkit-common version to 1.0.316 (#7147)
chungjac Apr 23, 2025
c9eb334
fix(amazonq): send sso startUrl on token update (#7148)
jpinkney-aws Apr 23, 2025
dc849e7
feat(amazonq): update mynah version with no style loading option (#7154)
dogusata Apr 24, 2025
d2f6b9a
fix(chat): Resend auth token on server restart (#7156)
nkomonen-amazon Apr 24, 2025
42636aa
telemetry(amazonq): bump aws-toolkit-common #7157
chungjac Apr 24, 2025
d856334
feat(amazonq): Add project context to LSP client
opieter-aws Apr 24, 2025
eb6c9c9
fix(amazonq): accept empty body partial result. (#7158)
Hweinstock Apr 24, 2025
879584e
Revert "feat(amazonq): Add project context to LSP client"
opieter-aws Apr 24, 2025
dd9ad62
feat(amazonq): Pass project configuration to LSP client (#7162)
opieter-aws Apr 25, 2025
1e45112
fix(amazonq): handle response errors from lsp (#7161)
Hweinstock Apr 25, 2025
6db5eda
fix(amazonq): 401 errors on windows (#7168)
avi-alpert Apr 25, 2025
be976e1
Merge master into feature/hybridChat (#7166)
aws-toolkit-automation Apr 25, 2025
4ceed6e
fix(amazonq): handle explain, refactor, fix, optimize, sendToPrompt (…
jpinkney-aws Apr 25, 2025
07a70bc
Merge branch 'feature/hybridChat' into autoMerge/feature/hybridChat
justinmk3 Apr 25, 2025
b23cfdd
Merge master into feature/hybridChat
justinmk3 Apr 25, 2025
59fc729
Merge master into feature/hybridChat
aws-toolkit-automation Apr 25, 2025
3beb8b2
fix(amazonq): enable local context for falcon (#7176)
zixlin7 Apr 26, 2025
947c471
feat(amazonq): support multiple uri in a single diff scheme (#7167)
ctlai95 Apr 26, 2025
dfd9406
Merge master into feature/hybridChat
aws-toolkit-automation Apr 28, 2025
2f103ff
fix(amazonq): Remove the 'Cancel' button on LSP download (#7184)
nkomonen-amazon Apr 28, 2025
c6afcb6
refactor(amazonq): Change Q LSP downloading message text (#7185)
nkomonen-amazon Apr 28, 2025
db673c9
feat(amazonq): sync lsp logging with local configuration. (#7186)
Hweinstock Apr 28, 2025
6dbb21e
fix(amazonq): fix extension name in lsp initialization (#7189)
zixlin7 Apr 29, 2025
8f3fb44
fix(amazonq): type error for workspaceIndexCacheDirPath (#7191)
zixlin7 Apr 29, 2025
b60036b
fix(amazonq): retry LSP token refresh on recoverable errors only. (#…
Hweinstock Apr 29, 2025
f1ede42
fix(amazonq): open review tab for generate tests (#7195)
jpinkney-aws Apr 29, 2025
907c784
fix(amazonq): explain issue fails (#7194)
jpinkney-aws Apr 29, 2025
35e1686
feat(amazonq): Log attribution notice when downloading language serve…
nkomonen-amazon Apr 29, 2025
7fd3bf2
fix(amazonq): stop workspace indexing in extension (#7197)
zixlin7 Apr 29, 2025
bf63747
fix(amazonq): add event publisher for generateUnitTests (#7198)
jpinkney-aws Apr 29, 2025
574990e
fix(amazonq): re-enable developer profile fetching in flare (#7190)
nkomonen-amazon Apr 29, 2025
f07432b
fix(amazonq): tie enableLocalIndex back to user setting (#7200)
zixlin7 Apr 29, 2025
00974f3
feat(amazonq): add reference log for chat messages (#7206)
jpinkney-aws Apr 30, 2025
c71c619
Merge master into feature/hybridChat
aws-toolkit-automation Apr 30, 2025
d3db47a
fix(amazonq): enable agentic mode (#7199)
jpinkney-aws Apr 30, 2025
e08a3bd
fix(amazonq): full project scan command not working (#7207)
jpinkney-aws Apr 30, 2025
0157f7e
Merge master into feature/hybridChat
aws-toolkit-automation Apr 30, 2025
db976c9
fix(amazonq): duplicate code reference in reference log (#7208)
jpinkney-aws Apr 30, 2025
8b7106b
Merge master into feature/hybridChat
aws-toolkit-automation Apr 30, 2025
1dff099
feat(agentic chat): Add changelog (#7211)
opieter-aws May 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/lsp.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ sequenceDiagram

## Language Server Debugging

1. Clone https://github.com/aws/language-servers.git and set it up in the same workspace as this project
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.

e.g.


```
/aws-toolkit-vscode
Expand All @@ -53,9 +53,9 @@ sequenceDiagram
"amazonqLSPChat": true // optional: enables chat from flare
}
```
4. Uncomment the `__AMAZONQLSP_PATH` variable in `amazonq/.vscode/launch.json` Extension configuration
1. Uncomment the `__AMAZONQLSP_UI` variable in `amazonq/.vscode/launch.json` Extension configuration if you want to debug the flare chat-client as well
4. Uncomment the `__AMAZONQLSP_PATH` and `__AMAZONQLSP_UI` variables in the `amazonq/.vscode/launch.json` extension configuration
5. Use the `Launch LSP with Debugging` configuration and set breakpoints in VSCode or the language server
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

## Amazon Q Inline Activation

Expand Down
1,520 changes: 510 additions & 1,010 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"skippedTestReport": "ts-node ./scripts/skippedTestReport.ts ./packages/amazonq/test/e2e/"
},
"devDependencies": {
"@aws-toolkits/telemetry": "^1.0.312",
"@aws-toolkits/telemetry": "^1.0.317",
"@playwright/browser-chromium": "^1.43.1",
"@stylistic/eslint-plugin": "^2.11.0",
"@types/he": "^1.2.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "Feature",
"description": "Agentic coding experience: Amazon Q can now write code and run shell commands on your behalf"
}
3 changes: 2 additions & 1 deletion packages/amazonq/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"env": {
"SSMDOCUMENT_LANGUAGESERVER_PORT": "6010",
"WEBPACK_DEVELOPER_SERVER": "http://localhost:8080"
// "__AMAZONQLSP_PATH": "${workspaceFolder}/../../../language-servers/app/aws-lsp-codewhisperer-runtimes/out/token-standalone.js",
// Below allows for overrides used during development
// "__AMAZONQLSP_PATH": "${workspaceFolder}/../../../language-servers/app/aws-lsp-codewhisperer-runtimes/out/agent-standalone.js",
// "__AMAZONQLSP_UI": "${workspaceFolder}/../../../language-servers/chat-client/build/amazonq-ui.js"
},
"envFile": "${workspaceFolder}/.local.env",
Expand Down
24 changes: 23 additions & 1 deletion packages/amazonq/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@
"type": "boolean",
"default": false
},
"amazonQChatPairProgramming": {
"type": "boolean",
"default": false
},
"amazonQSelectDeveloperProfile": {
"type": "boolean",
"default": false
Expand Down Expand Up @@ -181,7 +185,25 @@
"amazonQ.workspaceIndexMaxSize": {
"type": "number",
"markdownDescription": "%AWS.configuration.description.amazonq.workspaceIndexMaxSize%",
"default": 250,
"default": 2048,
"scope": "application"
},
"amazonQ.workspaceIndexMaxFileSize": {
"type": "number",
"markdownDescription": "%AWS.configuration.description.amazonq.workspaceIndexMaxFileSize%",
"default": 10,
"scope": "application"
},
"amazonQ.workspaceIndexCacheDirPath": {
"type": "string",
"markdownDescription": "%AWS.configuration.description.amazonq.workspaceIndexCacheDirPath%",
"default": null,
"scope": "application"
},
"amazonQ.workspaceIndexIgnoreFilePatterns": {
"type": "array",
"markdownDescription": "%AWS.configuration.description.amazonq.workspaceIndexIgnoreFilePatterns%",
"default": [],
"scope": "application"
},
"amazonQ.ignoredSecurityIssues": {
Expand Down
38 changes: 3 additions & 35 deletions packages/amazonq/src/app/chat/activation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,33 @@
*/

import * as vscode from 'vscode'
import { ExtensionContext, window } from 'vscode'
import { ExtensionContext } from 'vscode'
import { telemetry } from 'aws-core-vscode/telemetry'
import { AuthUtil, CodeWhispererSettings } from 'aws-core-vscode/codewhisperer'
import { Commands, placeholder, funcUtil } from 'aws-core-vscode/shared'
import * as amazonq from 'aws-core-vscode/amazonq'
import { scanChatAppInit } from '../amazonqScan'

export async function activate(context: ExtensionContext) {
const appInitContext = amazonq.DefaultAmazonQAppInitContext.instance

registerApps(appInitContext, context)

const provider = new amazonq.AmazonQChatViewProvider(
context,
appInitContext.getWebViewToAppsMessagePublishers(),
appInitContext.getAppsToWebViewMessageListener(),
appInitContext.onDidChangeAmazonQVisibility
)

await amazonq.TryChatCodeLensProvider.register(appInitContext.onDidChangeAmazonQVisibility.event)

const setupLsp = funcUtil.debounce(async () => {
void amazonq.LspController.instance.trySetupLsp(context, {
startUrl: AuthUtil.instance.startUrl,
maxIndexSize: CodeWhispererSettings.instance.getMaxIndexSize(),
isVectorIndexEnabled: CodeWhispererSettings.instance.isLocalIndexEnabled(),
isVectorIndexEnabled: false,
})
}, 5000)

context.subscriptions.push(
window.registerWebviewViewProvider(amazonq.AmazonQChatViewProvider.viewType, provider, {
webviewOptions: {
retainContextWhenHidden: true,
},
}),
amazonq.focusAmazonQChatWalkthrough.register(),
amazonq.walkthroughInlineSuggestionsExample.register(),
amazonq.walkthroughSecurityScanExample.register(),
amazonq.openAmazonQWalkthrough.register(),
amazonq.listCodeWhispererCommandsWalkthrough.register(),
amazonq.focusAmazonQPanel.register(),
amazonq.focusAmazonQPanelKeybinding.register(),
amazonq.tryChatCodeLensCommand.register(),
vscode.workspace.onDidChangeConfiguration(async (configurationChangeEvent) => {
if (configurationChangeEvent.affectsConfiguration('amazonQ.workspaceIndex')) {
if (CodeWhispererSettings.instance.isLocalIndexEnabled()) {
void setupLsp()
}
}
})
amazonq.tryChatCodeLensCommand.register()
)

Commands.register('aws.amazonq.learnMore', () => {
Expand All @@ -64,15 +41,6 @@ export async function activate(context: ExtensionContext) {
void setupAuthNotification()
}

function registerApps(appInitContext: amazonq.AmazonQAppInitContext, context: ExtensionContext) {
amazonq.cwChatAppInit(appInitContext)
amazonq.featureDevChatAppInit(appInitContext)
amazonq.gumbyChatAppInit(appInitContext)
amazonq.testChatAppInit(appInitContext)
scanChatAppInit(appInitContext)
amazonq.docChatAppInit(appInitContext)
}

/**
* Display a notification to user for Log In.
*
Expand Down
19 changes: 19 additions & 0 deletions packages/amazonq/src/app/chat/node/activateAgents.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*!
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

import * as amazonqNode from 'aws-core-vscode/amazonq/node'
import { scanChatAppInit } from '../../amazonqScan'
import { DefaultAmazonQAppInitContext } from 'aws-core-vscode/amazonq'

export function activateAgents() {
const appInitContext = DefaultAmazonQAppInitContext.instance

amazonqNode.cwChatAppInit(appInitContext)
amazonqNode.featureDevChatAppInit(appInitContext)
amazonqNode.gumbyChatAppInit(appInitContext)
amazonqNode.testChatAppInit(appInitContext)
amazonqNode.docChatAppInit(appInitContext)
scanChatAppInit(appInitContext)
}
2 changes: 1 addition & 1 deletion packages/amazonq/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export async function activateAmazonQCommon(context: vscode.ExtensionContext, is
// This contains every lsp agnostic things (auth, security scan, code scan)
await activateCodeWhisperer(extContext as ExtContext)
if (
(Experiments.instance.get('amazonqLSP', false) || Auth.instance.isInternalAmazonUser()) &&
(Experiments.instance.get('amazonqLSP', true) || Auth.instance.isInternalAmazonUser()) &&
!isAmazonInternalOs()
) {
// start the Amazon Q LSP for internal users first
Expand Down
25 changes: 21 additions & 4 deletions packages/amazonq/src/extensionNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

import * as vscode from 'vscode'
import { activateAmazonQCommon, amazonQContextPrefix, deactivateCommon } from './extension'
import { DefaultAmazonQAppInitContext } from 'aws-core-vscode/amazonq'
import { activate as activateQGumby } from 'aws-core-vscode/amazonqGumby'
import { DefaultAmazonQAppInitContext, AmazonQChatViewProvider } from 'aws-core-vscode/amazonq'
import { activate as activateTransformationHub } from 'aws-core-vscode/amazonqGumby'
import {
ExtContext,
globals,
Expand All @@ -30,6 +30,7 @@ import { beta } from 'aws-core-vscode/dev'
import { activate as activateNotifications, NotificationsController } from 'aws-core-vscode/notifications'
import { AuthState, AuthUtil } from 'aws-core-vscode/codewhisperer'
import { telemetry, AuthUserState } from 'aws-core-vscode/telemetry'
import { activateAgents } from './app/chat/node/activateAgents'

export async function activate(context: vscode.ExtensionContext) {
// IMPORTANT: No other code should be added to this function. Place it in one of the following 2 functions where appropriate.
Expand All @@ -52,10 +53,26 @@ async function activateAmazonQNode(context: vscode.ExtensionContext) {
extensionContext: context,
}

if (!Experiments.instance.get('amazonqChatLSP', false)) {
if (!Experiments.instance.get('amazonqChatLSP', true)) {
const appInitContext = DefaultAmazonQAppInitContext.instance
const provider = new AmazonQChatViewProvider(
context,
appInitContext.getWebViewToAppsMessagePublishers(),
appInitContext.getAppsToWebViewMessageListener(),
appInitContext.onDidChangeAmazonQVisibility
)
context.subscriptions.push(
vscode.window.registerWebviewViewProvider(AmazonQChatViewProvider.viewType, provider, {
webviewOptions: {
retainContextWhenHidden: true,
},
})
)
// this is registered inside of lsp/chat/activation.ts when the chat experiment is enabled
await activateCWChat(context)
await activateQGumby(extContext as ExtContext)
}
activateAgents()
await activateTransformationHub(extContext as ExtContext)
activateInlineChat(context)

const authProvider = new CommonAuthViewProvider(
Expand Down
42 changes: 29 additions & 13 deletions packages/amazonq/src/lsp/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
*/

import {
bearerCredentialsUpdateRequestType,
ConnectionMetadata,
NotificationType,
RequestType,
ResponseMessage,
UpdateCredentialsParams,
} from '@aws/language-server-runtimes/protocol'
import * as jose from 'jose'
import * as crypto from 'crypto'
Expand Down Expand Up @@ -64,39 +66,48 @@ export const notificationTypes = {
* Facade over our VSCode Auth that does crud operations on the language server auth
*/
export class AmazonQLspAuth {
constructor(private readonly client: LanguageClient) {}
#logErrorIfChanged = onceChanged((s) => getLogger('amazonqLsp').error(s))
constructor(
private readonly client: LanguageClient,
private readonly authUtil: AuthUtil = AuthUtil.instance
) {}

async refreshConnection() {
const activeConnection = AuthUtil.instance.auth.activeConnection
if (activeConnection?.type === 'sso') {
/**
* @param force bypass memoization, and forcefully update the bearer token
*/
async refreshConnection(force: boolean = false) {
const activeConnection = this.authUtil.auth.activeConnection
if (activeConnection?.state === 'valid' && activeConnection?.type === 'sso') {
// send the token to the language server
const token = await AuthUtil.instance.getBearerToken()
await this.updateBearerToken(token)
const token = await this.authUtil.getBearerToken()
await (force ? this._updateBearerToken(token) : this.updateBearerToken(token))
}
}

async logRefreshError(e: unknown) {
const err = e as Error
this.#logErrorIfChanged(`Unable to update bearer token: ${err.name}:${err.message}`)
}

public updateBearerToken = onceChanged(this._updateBearerToken.bind(this))
private async _updateBearerToken(token: string) {
const request = await this.createUpdateCredentialsRequest({
token,
})

await this.client.sendRequest(notificationTypes.updateBearerToken.method, request)
await this.client.sendRequest(bearerCredentialsUpdateRequestType.method, request)

this.client.info(`UpdateBearerToken: ${JSON.stringify(request)}`)
}

public startTokenRefreshInterval(pollingTime: number = oneMinute) {
public startTokenRefreshInterval(pollingTime: number = oneMinute / 2) {
const interval = setInterval(async () => {
await this.refreshConnection().catch((e) => {
getLogger('amazonqLsp').error('Unable to update bearer token: %s', (e as Error).message)
clearInterval(interval)
})
await this.refreshConnection().catch((e) => this.logRefreshError(e))
}, pollingTime)
return interval
}

private async createUpdateCredentialsRequest(data: any) {
private async createUpdateCredentialsRequest(data: any): Promise<UpdateCredentialsParams> {
const payload = new TextEncoder().encode(JSON.stringify({ data }))

const jwt = await new jose.CompactEncrypt(payload)
Expand All @@ -105,6 +116,11 @@ export class AmazonQLspAuth {

return {
data: jwt,
metadata: {
sso: {
startUrl: AuthUtil.instance.auth.startUrl,
},
},
encrypted: true,
}
}
Expand Down
Loading
Loading