Skip to content

Commit f37abdd

Browse files
committed
feat(paidtier): "/manage" quickaction
1 parent 768cc78 commit f37abdd

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

server/aws-lsp-codewhisperer/src/language-server/agenticChat/agenticChatController.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2388,6 +2388,20 @@ export class AgenticChatController implements ChatHandlers {
23882388
messageId: uuid(),
23892389
body: HELP_MESSAGE,
23902390
}
2391+
2392+
// "Manage Subscription" (paid-tier user), or "Upgrade Q" (free-tier user)
2393+
case QuickAction.Manage:
2394+
this.#telemetryController.emitChatMetric({
2395+
name: ChatTelemetryEventName.RunCommand,
2396+
data: {
2397+
cwsprChatCommandType: params.quickAction,
2398+
cwsprChatCommandName: '/manage',
2399+
},
2400+
})
2401+
2402+
this.onManageSubscription(params.tabId)
2403+
2404+
return {}
23912405
default:
23922406
return {}
23932407
}

server/aws-lsp-codewhisperer/src/language-server/agenticChat/qAgenticChatServer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import { InitializeParams, Server } from '@aws/language-server-runtimes/server-interface'
77
import { AgenticChatController } from './agenticChatController'
88
import { ChatSessionManagementService } from '../chat/chatSessionManagementService'
9-
import { CLEAR_QUICK_ACTION, HELP_QUICK_ACTION } from '../chat/quickActions'
9+
import { CLEAR_QUICK_ACTION, HELP_QUICK_ACTION, MANAGE_QUICK_ACTION } from '../chat/quickActions'
1010
import { TelemetryService } from '../../shared/telemetry/telemetryService'
1111
import { makeUserContextObject } from '../../shared/telemetryUtils'
1212
import { AmazonQTokenServiceManager } from '../../shared/amazonQServiceManager/AmazonQTokenServiceManager'
@@ -35,7 +35,7 @@ export const QAgenticChatServer =
3535
quickActions: {
3636
quickActionsCommandGroups: [
3737
{
38-
commands: [HELP_QUICK_ACTION, CLEAR_QUICK_ACTION],
38+
commands: [HELP_QUICK_ACTION, CLEAR_QUICK_ACTION, MANAGE_QUICK_ACTION],
3939
},
4040
],
4141
},

server/aws-lsp-codewhisperer/src/language-server/chat/quickActions.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export enum QuickAction {
22
Clear = '/clear',
33
Help = '/help',
4+
Manage = '/manage',
45
}
56

67
export const HELP_QUICK_ACTION = {
@@ -14,3 +15,9 @@ export const CLEAR_QUICK_ACTION = {
1415
description: 'Clear this session',
1516
icon: 'trash',
1617
}
18+
19+
export const MANAGE_QUICK_ACTION = {
20+
command: QuickAction.Manage,
21+
description: 'Manage Amazon Q Subscription',
22+
icon: 'menu', // 'check-list'
23+
}

0 commit comments

Comments
 (0)