@@ -36,6 +36,9 @@ import { showReauthenticateMessage } from '../../shared/utilities/messages'
36
36
import { showAmazonQWalkthroughOnce } from '../../amazonq/onboardingPage/walkthrough'
37
37
import { setContext } from '../../shared/vscode/setContext'
38
38
import { isInDevEnv } from '../../shared/vscode/env'
39
+ import { openUrl } from '../../shared/utilities/vsCodeUtils'
40
+ import * as nls from 'vscode-nls'
41
+ const localize = nls . loadMessageBundle ( )
39
42
import { telemetry } from '../../shared/telemetry/telemetry'
40
43
41
44
/** Backwards compatibility for connections w pre-chat scopes */
@@ -345,6 +348,38 @@ export class AuthUtil {
345
348
}
346
349
}
347
350
351
+ public async notifySessionConfiguration ( ) {
352
+ const suppressId = 'amazonQSessionConfigurationMessage'
353
+ const settings = AmazonQPromptSettings . instance
354
+ const shouldShow = await settings . isPromptEnabled ( suppressId )
355
+ if ( ! shouldShow ) {
356
+ return
357
+ }
358
+
359
+ const message = localize (
360
+ 'aws.amazonq.sessionConfiguration.message' ,
361
+ 'Your maximum session length for Amazon Q can be extended to 90 days by your administrator. For more information, refer to How to extend the session duration for Amazon Q in the IDE in the IAM Identity Center User Guide.'
362
+ )
363
+
364
+ const learnMoreUrl = vscode . Uri . parse (
365
+ 'https://docs.aws.amazon.com/singlesignon/latest/userguide/configure-user-session.html#90-day-extended-session-duration'
366
+ )
367
+ await telemetry . toolkit_showNotification . run ( async ( ) => {
368
+ telemetry . record ( { id : 'sessionExtension' } )
369
+ void vscode . window . showInformationMessage ( message , localizedText . learnMore ) . then ( async ( resp ) => {
370
+ await telemetry . toolkit_invokeAction . run ( async ( ) => {
371
+ if ( resp === localizedText . learnMore ) {
372
+ telemetry . record ( { action : 'learnMore' } )
373
+ await openUrl ( learnMoreUrl )
374
+ } else {
375
+ telemetry . record ( { action : 'dismissSessionExtensionNotification' } )
376
+ }
377
+ await settings . disablePrompt ( suppressId )
378
+ } )
379
+ } )
380
+ } )
381
+ }
382
+
348
383
public async notifyReauthenticate ( isAutoTrigger ?: boolean ) {
349
384
void this . showReauthenticatePrompt ( isAutoTrigger )
350
385
await this . setVscodeContextProps ( )
0 commit comments