Skip to content

Commit 8ae27cb

Browse files
Merge master into feature/amazonqLSP-auth
2 parents cc6a05f + 413ce4b commit 8ae27cb

File tree

21 files changed

+67
-54
lines changed

21 files changed

+67
-54
lines changed

package-lock.json

Lines changed: 8 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Bug Fix",
3+
"description": "Amazon Q Chat: Set owner-only permissions for chat history and saved prompt files"
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Feature",
3+
"description": "Amazon Q chat: Click export icon to save chat transcript in Markdown or HTML"
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Feature",
3+
"description": "Amazon Q Chat: Add @Code context for PHP, Ruby, Scala, Shell, and Swift projects"
4+
}

packages/amazonq/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@
127127
"amazonQWorkspaceLspManifestMessage": {
128128
"type": "boolean",
129129
"default": false
130+
},
131+
"amazonQChatDisclaimer": {
132+
"type": "boolean",
133+
"default": false
130134
}
131135
},
132136
"additionalProperties": false

packages/amazonq/src/app/inline/sessionManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { InlineCompletionItemWithReferences } from '@aws/language-server-runtimes-types/inlineCompletionWithReferences'
6+
import { InlineCompletionItemWithReferences } from '@aws/language-server-runtimes-types'
77

88
// TODO: add more needed data to the session interface
99
interface CodeWhispererSession {

packages/amazonq/src/lsp/chat/messages.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
CHAT_OPTIONS,
1111
COPY_TO_CLIPBOARD,
1212
AuthFollowUpType,
13+
DISCLAIMER_ACKNOWLEDGED,
1314
} from '@aws/chat-client-ui-types'
1415
import {
1516
ChatResult,
@@ -27,6 +28,7 @@ import { Disposable, LanguageClient, Position, State, TextDocumentIdentifier } f
2728
import * as jose from 'jose'
2829
import { AmazonQChatViewProvider } from './webviewProvider'
2930
import { AuthUtil } from 'aws-core-vscode/codewhisperer'
31+
import { AmazonQPromptSettings } from 'aws-core-vscode/shared'
3032

3133
export function registerLanguageServerEventListener(languageClient: LanguageClient, provider: AmazonQChatViewProvider) {
3234
languageClient.onDidChangeState(({ oldState, newState }) => {
@@ -106,6 +108,10 @@ export function registerMessageListeners(
106108
}
107109
break
108110
}
111+
case DISCLAIMER_ACKNOWLEDGED: {
112+
void AmazonQPromptSettings.instance.disablePrompt('amazonQChatDisclaimer')
113+
break
114+
}
109115
case chatRequestType.method: {
110116
const partialResultToken = uuidv4()
111117
const chatDisposable = languageClient.onProgress(chatRequestType, partialResultToken, (partialResult) =>

packages/amazonq/src/lsp/chat/webviewProvider.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import {
1212
WebviewViewResolveContext,
1313
Uri,
1414
} from 'vscode'
15-
import { LanguageServerResolver } from 'aws-core-vscode/shared'
1615
import { QuickActionCommandGroup } from '@aws/mynah-ui'
1716
import * as path from 'path'
17+
import { AmazonQPromptSettings, LanguageServerResolver } from 'aws-core-vscode/shared'
1818

1919
export class AmazonQChatViewProvider implements WebviewViewProvider {
2020
public static readonly viewType = 'aws.amazonq.AmazonQChatView'
@@ -43,7 +43,11 @@ export class AmazonQChatViewProvider implements WebviewViewProvider {
4343

4444
constructor(private readonly mynahUIPath: string) {}
4545

46-
public resolveWebviewView(webviewView: WebviewView, context: WebviewViewResolveContext, _token: CancellationToken) {
46+
public async resolveWebviewView(
47+
webviewView: WebviewView,
48+
context: WebviewViewResolveContext,
49+
_token: CancellationToken
50+
) {
4751
this.webview = webviewView.webview
4852

4953
const lspDir = Uri.parse(LanguageServerResolver.defaultDir)
@@ -54,12 +58,13 @@ export class AmazonQChatViewProvider implements WebviewViewProvider {
5458
}
5559

5660
const uiPath = webviewView.webview.asWebviewUri(Uri.parse(this.mynahUIPath)).toString()
57-
webviewView.webview.html = this.getWebviewContent(uiPath)
61+
webviewView.webview.html = await this.getWebviewContent(uiPath)
5862

5963
this.onDidResolveWebviewEmitter.fire()
6064
}
6165

62-
private getWebviewContent(mynahUIPath: string) {
66+
private async getWebviewContent(mynahUIPath: string) {
67+
const disclaimerAcknowledged = AmazonQPromptSettings.instance.isPromptEnabled('amazonQChatDisclaimer')
6368
return `
6469
<!DOCTYPE html>
6570
<html lang="en">
@@ -84,7 +89,7 @@ export class AmazonQChatViewProvider implements WebviewViewProvider {
8489
<script type="text/javascript" src="${mynahUIPath.toString()}" defer onload="init()"></script>
8590
<script type="text/javascript">
8691
const init = () => {
87-
amazonQChat.createChat(acquireVsCodeApi(), { disclaimerAcknowledged: false, quickActionCommands: ${JSON.stringify(this.quickActionCommands)}});
92+
amazonQChat.createChat(acquireVsCodeApi(), { disclaimerAcknowledged: ${disclaimerAcknowledged}, quickActionCommands: ${JSON.stringify(this.quickActionCommands)}});
8893
}
8994
</script>
9095
</body>

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@
440440
},
441441
"devDependencies": {
442442
"@aws-sdk/types": "^3.13.1",
443-
"@aws/chat-client-ui-types": "^0.0.8",
443+
"@aws/chat-client-ui-types": "^0.1.12",
444444
"@aws/language-server-runtimes": "^0.2.49",
445445
"@aws/language-server-runtimes-types": "^0.1.10",
446446
"@cspotcode/source-map-support": "^0.8.1",

packages/core/src/amazonq/lsp/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export interface LspConfig {
1616

1717
export const defaultAmazonQWorkspaceLspConfig: LspConfig = {
1818
manifestUrl: 'https://aws-toolkit-language-servers.amazonaws.com/q-context/manifest.json',
19-
supportedVersions: '0.1.46',
19+
supportedVersions: '0.1.47',
2020
id: 'AmazonQ-Workspace', // used across IDEs for identifying global storage/local disk locations. Do not change.
2121
suppressPromptPrefix: 'amazonQWorkspace',
2222
path: undefined,

0 commit comments

Comments
 (0)