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
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions packages/amazonq/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@
"amazonQChatDisclaimer": {
"type": "boolean",
"default": false
},
"amazonQChatPairProgramming": {
"type": "boolean",
"default": false
}
},
"additionalProperties": false
Expand Down
11 changes: 11 additions & 0 deletions packages/amazonq/src/lsp/chat/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {
AuthFollowUpType,
DISCLAIMER_ACKNOWLEDGED,
UiMessageResultParams,
CHAT_PROMPT_OPTION_ACKNOWLEDGED,
ChatPromptOptionAcknowledgedMessage,
} from '@aws/chat-client-ui-types'
import {
ChatResult,
Expand Down Expand Up @@ -146,6 +148,15 @@ export function registerMessageListeners(
void AmazonQPromptSettings.instance.update('amazonQChatDisclaimer', true)
break
}
case CHAT_PROMPT_OPTION_ACKNOWLEDGED: {
const acknowledgedMessage = message as ChatPromptOptionAcknowledgedMessage
switch (acknowledgedMessage.params.messageId) {
case 'programmerModeCardId': {
void AmazonQPromptSettings.instance.disablePrompt('amazonQChatPairProgramming')
}
}
break
}
case chatRequestType.method: {
const partialResultToken = uuidv4()
const chatDisposable = languageClient.onProgress(chatRequestType, partialResultToken, (partialResult) =>
Expand Down
4 changes: 3 additions & 1 deletion packages/amazonq/src/lsp/chat/webviewProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ export class AmazonQChatViewProvider implements WebviewViewProvider {
const isSMUS = isSageMaker('SMUS')
const disabledCommands = isSM ? `['/dev', '/transform', '/test', '/review', '/doc']` : '[]'
const disclaimerAcknowledged = !AmazonQPromptSettings.instance.isPromptEnabled('amazonQChatDisclaimer')
const pairProgrammingAcknowledged =
!AmazonQPromptSettings.instance.isPromptEnabled('amazonQChatPairProgramming')
const welcomeCount = globals.globalState.tryGet('aws.amazonq.welcomeChatShowCount', Number, 0)

// only show profile card when the two conditions
Expand Down Expand Up @@ -144,7 +146,7 @@ export class AmazonQChatViewProvider implements WebviewViewProvider {
const vscodeApi = acquireVsCodeApi()
const hybridChatConnector = new HybridChatAdapter(${(await AuthUtil.instance.getChatAuthState()).amazonQ === 'connected'},${featureConfigData},${welcomeCount},${disclaimerAcknowledged},${regionProfileString},${disabledCommands},${isSMUS},${isSM},vscodeApi.postMessage)
const commands = [hybridChatConnector.initialQuickActions[0]]
amazonQChat.createChat(vscodeApi, {disclaimerAcknowledged: ${disclaimerAcknowledged}, quickActionCommands: commands}, hybridChatConnector);
amazonQChat.createChat(vscodeApi, {disclaimerAcknowledged: ${disclaimerAcknowledged}, pairProgrammingAcknowledged: ${pairProgrammingAcknowledged}, quickActionCommands: commands}, hybridChatConnector);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this line temporary for hybrid chat. Just wondering about scalability as we add more props to it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
</script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@
"devDependencies": {
"@aws-sdk/types": "^3.13.1",
"@aws/chat-client": "^0.1.4",
"@aws/chat-client-ui-types": "^0.1.12",
"@aws/chat-client-ui-types": "^0.1.22",
"@aws/language-server-runtimes": "^0.2.58",
"@aws/language-server-runtimes-types": "^0.1.13",
"@cspotcode/source-map-support": "^0.8.1",
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/shared/settings-amazonq.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export const amazonqSettings = {
"ssoCacheError": {},
"amazonQLspManifestMessage": {},
"amazonQWorkspaceLspManifestMessage": {},
"amazonQChatDisclaimer": {}
"amazonQChatDisclaimer": {},
"amazonQChatPairProgramming": {}
},
"amazonQ.showCodeWithReferences": {},
"amazonQ.allowFeatureDevelopmentToRunCodeAndTests": {},
Expand Down