Skip to content

Commit c0ed9b5

Browse files
committed
quickaction
1 parent abf4e15 commit c0ed9b5

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2346,6 +2346,19 @@ export class AgenticChatController implements ChatHandlers {
23462346
messageId: uuid(),
23472347
body: HELP_MESSAGE,
23482348
}
2349+
2350+
// "Manage Subscription" (paid-tier user), or "Upgrade Q" (free-tier user)
2351+
case QuickAction.Manage:
2352+
this.#telemetryController.emitChatMetric({
2353+
name: ChatTelemetryEventName.RunCommand,
2354+
data: {
2355+
cwsprChatCommandType: params.quickAction,
2356+
},
2357+
})
2358+
return {
2359+
messageId: 'manage-q-subscription',
2360+
body: 'Foo bar',
2361+
}
23492362
default:
23502363
return {}
23512364
}

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)