Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "Feature",
"description": "Add MCP Server Support"
}
22 changes: 17 additions & 5 deletions packages/amazonq/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,16 +387,21 @@
"when": "view == aws.amazonq.AmazonQChatView",
"group": "0_topAmazonQ@1"
},
{
"command": "aws.amazonq.learnMore",
"when": "view =~ /^aws\\.amazonq/",
"group": "1_amazonQ@1"
},
{
"command": "aws.amazonq.selectRegionProfile",
"when": "view == aws.amazonq.AmazonQChatView && aws.amazonq.connectedSsoIdc == true",
"group": "1_amazonQ@1"
},
{
"command": "aws.amazonq.manageSubscription",
"when": "(view == aws.amazonq.AmazonQChatView) && aws.codewhisperer.connected",
"group": "1_amazonQ@2"
},
{
"command": "aws.amazonq.learnMore",
"when": "view =~ /^aws\\.amazonq/",
"group": "1_amazonQ@3"
},
{
"command": "aws.amazonq.signout",
"when": "(view == aws.amazonq.AmazonQChatView) && aws.codewhisperer.connected && !aws.isSageMakerUnifiedStudio",
Expand Down Expand Up @@ -678,6 +683,13 @@
"category": "%AWS.amazonq.title%",
"icon": "$(question)"
},
{
"command": "aws.amazonq.manageSubscription",
"title": "%AWS.command.manageSubscription%",
"category": "%AWS.amazonq.title%",
"icon": "$(gear)",
"enablement": "aws.codewhisperer.connected && !aws.amazonq.connectedSsoIdc"
},
{
"command": "aws.amazonq.signout",
"title": "%AWS.command.codewhisperer.signout%",
Expand Down
14 changes: 13 additions & 1 deletion packages/amazonq/src/lsp/chat/activation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { window } from 'vscode'
import { LanguageClient } from 'vscode-languageclient'
import { AmazonQChatViewProvider } from './webviewProvider'
import { registerCommands } from './commands'
import { focusAmazonQPanel, registerCommands } from './commands'
import { registerLanguageServerEventListener, registerMessageListeners } from './messages'
import { Commands, getLogger, globals, undefinedIfEmpty } from 'aws-core-vscode/shared'
import { activate as registerLegacyChatListeners } from '../../app/chat/activation'
Expand Down Expand Up @@ -78,6 +78,18 @@ export async function activate(languageClient: LanguageClient, encryptionKey: Bu
Commands.register('aws.amazonq.updateCustomizations', () => {
pushCustomizationToServer(languageClient)
}),
Commands.register('aws.amazonq.manageSubscription', () => {
focusAmazonQPanel().catch((e) => languageClient.error(`[VSCode Client] focusAmazonQPanel() failed`))

languageClient
.sendRequest('workspace/executeCommand', {
command: 'aws/chat/manageSubscription',
// arguments: [],
})
.catch((e) => {
getLogger('amazonqLsp').error('failed request: aws/chat/manageSubscription: %O', e)
})
}),
globals.logOutputChannel.onDidChangeLogLevel((logLevel) => {
getLogger('amazonqLsp').info(`Local log level changed to ${logLevel}, notifying LSP`)
void pushConfigUpdate(languageClient, {
Expand Down
2 changes: 1 addition & 1 deletion packages/amazonq/src/lsp/chat/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function registerGenericCommand(commandName: string, genericCommand: string, pro
*
* Instead, we just create our own as a temporary solution
*/
async function focusAmazonQPanel() {
export async function focusAmazonQPanel() {
await Commands.tryExecute('aws.amazonq.AmazonQChatView.focus')
await Commands.tryExecute('aws.amazonq.AmazonCommonAuth.focus')
}
2 changes: 1 addition & 1 deletion packages/amazonq/src/lsp/chat/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ export function registerMessageListeners(
)
if (!buttonResult.success) {
languageClient.error(
`[VSCode Client] Failed to execute action associated with button with reason: ${buttonResult.failureReason}`
`[VSCode Client] Failed to execute button action: ${buttonResult.failureReason}`
)
}
break
Expand Down
1 change: 1 addition & 0 deletions packages/amazonq/src/lsp/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export async function startLanguageServer(
awsClientCapabilities: {
q: {
developerProfiles: true,
mcp: true,
},
window: {
notifications: true,
Expand Down
1 change: 1 addition & 0 deletions packages/core/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
"AWS.command.codecatalyst.login": "Connect to CodeCatalyst",
"AWS.command.codecatalyst.logout": "Sign out of CodeCatalyst",
"AWS.command.codecatalyst.signout": "Sign Out",
"AWS.command.manageSubscription": "Manage Q Developer Pro Subscription",
"AWS.command.amazonq.explainCode": "Explain",
"AWS.command.amazonq.refactorCode": "Refactor",
"AWS.command.amazonq.fixCode": "Fix",
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ export * as cache from './sso/cache'
export * as authUtils from './utils'
export * as auth2 from './auth2'
export * as SsoAccessTokenProvider from './sso/ssoAccessTokenProvider'
export * as AuthUtils from './utils'
export * as credentialsValidation from './credentials/validation'
12 changes: 12 additions & 0 deletions packages/core/src/codewhisperer/ui/codeWhispererNodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,18 @@ export function createGettingStarted(): DataQuickPickItem<'gettingStarted'> {
} as DataQuickPickItem<'gettingStarted'>
}

export function createManageSubscription(): DataQuickPickItem<'manageSubscription'> {
const label = localize('AWS.command.manageSubscription', 'Manage Q Developer Pro Subscription')
// const kind = AuthUtil.instance.isBuilderIdInUse() ? 'AWS Builder ID' : 'IAM Identity Center'

return {
data: 'manageSubscription',
label: label,
iconPath: getIcon('vscode-link-external'),
onClick: () => Commands.tryExecute('aws.amazonq.manageSubscription'),
} as DataQuickPickItem<'manageSubscription'>
}

export function createSignout(): DataQuickPickItem<'signout'> {
const label = localize('AWS.codewhisperer.signoutNode.label', 'Sign Out')
const icon = getIcon('vscode-export')
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/codewhisperer/ui/statusBarMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
createSelectCustomization,
createReconnect,
createGettingStarted,
createManageSubscription,
createSignout,
createSeparator,
createSettingsNode,
Expand Down Expand Up @@ -106,7 +107,7 @@ export function getQuickPickItems(): DataQuickPickItem<string>[] {
createSettingsNode(),
...(AuthUtil.instance.isIdcConnection() && regionProfile ? [createSelectRegionProfileNode(regionProfile)] : []),
...(AuthUtil.instance.isConnected() && !hasVendedIamCredentials() && !hasVendedCredentialsFromMetadata()
? [createSignout()]
? [createManageSubscription(), createSignout()]
: []),
]

Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/login/webview/vue/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
@toggle="toggleItemSelection"
:isSelected="selectedLoginOption === LoginOption.BUILDER_ID"
:itemId="LoginOption.BUILDER_ID"
:itemText="'with Builder ID, a personal profile from AWS'"
:itemTitle="'Use for Free'"
:itemText="'Free to start with a Builder ID.'"
:itemTitle="'Personal account'"
:itemType="LoginOption.BUILDER_ID"
class="selectable-item bottomMargin"
></SelectableItem>
Expand All @@ -118,8 +118,8 @@
@toggle="toggleItemSelection"
:isSelected="selectedLoginOption === LoginOption.ENTERPRISE_SSO"
:itemId="LoginOption.ENTERPRISE_SSO"
:itemText="''"
:itemTitle="'Use with Pro license'"
:itemText="'Best for individual teams or organizations.'"
:itemTitle="'Company account'"
:itemType="LoginOption.ENTERPRISE_SSO"
class="selectable-item bottomMargin"
></SelectableItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import {
createGettingStarted,
createGitHubNode,
createLearnMore,
createManageSubscription,
createOpenReferenceLog,
createReconnect,
createSecurityScan,
Expand Down Expand Up @@ -445,7 +446,13 @@ describe('CodeWhisperer-basicCommands', function () {
sinon.stub(AuthUtil.instance, 'isConnected').returns(true)

getTestWindow().onDidShowQuickPick((e) => {
e.assertContainsItems(createReconnect(), createLearnMore(), ...genericItems(), createSignout())
e.assertContainsItems(
createReconnect(),
createLearnMore(),
...genericItems(),
createManageSubscription(),
createSignout()
)
e.dispose() // skip needing to select an item to continue
})

Expand All @@ -465,6 +472,7 @@ describe('CodeWhisperer-basicCommands', function () {
switchToAmazonQNode(),
...genericItems(),
createSettingsNode(),
createManageSubscription(),
createSignout()
)
e.dispose() // skip needing to select an item to continue
Expand All @@ -490,6 +498,7 @@ describe('CodeWhisperer-basicCommands', function () {
switchToAmazonQNode(),
...genericItems(),
createSettingsNode(),
createManageSubscription(),
createSignout()
)
e.dispose() // skip needing to select an item to continue
Expand All @@ -516,6 +525,7 @@ describe('CodeWhisperer-basicCommands', function () {
...genericItems(),
createSeparator(),
createSettingsNode(),
createManageSubscription(),
createSignout(),
])
e.dispose() // skip needing to select an item to continue
Expand All @@ -538,6 +548,7 @@ describe('CodeWhisperer-basicCommands', function () {
switchToAmazonQNode(),
...genericItems(),
createSettingsNode(),
createManageSubscription(),
createSignout()
)
e.dispose()
Expand Down
Loading