-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into HEAD
- Loading branch information
Showing
210 changed files
with
15,543 additions
and
1,018 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"date" : "2024-11-27", | ||
"version" : "3.42", | ||
"entries" : [ { | ||
"type" : "feature", | ||
"description" : "Amazon Q /dev: support `Dockerfile` files" | ||
}, { | ||
"type" : "feature", | ||
"description" : "Feature(Amazon Q Code Transformation): allow users to view results in 5 smaller diffs" | ||
}, { | ||
"type" : "feature", | ||
"description" : "Introduce @workspace command to enhance chat context fetching for Chat" | ||
}, { | ||
"type" : "bugfix", | ||
"description" : "Correct search text for Amazon Q inline suggestion keybindings" | ||
}, { | ||
"type" : "bugfix", | ||
"description" : "Fix(Amazon Q Code Transformation): always show user latest/correct transformation results" | ||
}, { | ||
"type" : "bugfix", | ||
"description" : "Amazon Q /dev: Fix error when accepting changes if leading slash is present." | ||
} ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"date" : "2024-12-03", | ||
"version" : "3.43", | ||
"entries" : [ { | ||
"type" : "feature", | ||
"description" : "`/review` in Q chat to scan your code for vulnerabilities and quality issues, and generate fixes" | ||
}, { | ||
"type" : "feature", | ||
"description" : "`/test` in Q chat to generate unit tests for java and python" | ||
}, { | ||
"type" : "feature", | ||
"description" : "`/doc` in Q chat to generate and update documentation for your project" | ||
}, { | ||
"type" : "feature", | ||
"description" : "Added system notifications to inform users about critical plugin updates and potential issues with available workarounds" | ||
} ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"date" : "2024-12-04", | ||
"version" : "3.44", | ||
"entries" : [ { | ||
"type" : "feature", | ||
"description" : "Amazon Q: UI improvements to chat: New splash loader animation, initial streaming card animation, improved button colours" | ||
}, { | ||
"type" : "feature", | ||
"description" : "Amazon Q: Navigate through prompt history by using the up/down arrows" | ||
}, { | ||
"type" : "bugfix", | ||
"description" : "Fix issue where Amazon Q Code Transform is unable to start" | ||
}, { | ||
"type" : "bugfix", | ||
"description" : "Fix DynamoDB viewer throwing 'ActionGroup should be registered using <group> tag' on IDE start (#5012) (#5120)" | ||
}, { | ||
"type" : "bugfix", | ||
"description" : "Amazon Q: Fix chat syntax highlighting when using several different themes" | ||
} ] | ||
} |
4 changes: 0 additions & 4 deletions
4
.changes/next-release/.changes/next-release/bugfix-21701bb3-5189-474e-868b-9ec46ecde6ee.json
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
.changes/next-release/feature-07ba60de-7043-4965-8fb5-7038c8ea6c5e.json
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
.changes/next-release/feature-b05e3cd8-abd5-47f9-bd5c-02c7b7eb378e.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,4 @@ | |
<RunAsTest>false</RunAsTest> | ||
<method v="2" /> | ||
</configuration> | ||
</component> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
153 changes: 153 additions & 0 deletions
153
...community/src/software/aws/toolkits/jetbrains/common/clients/AmazonQCodeGenerateClient.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
// Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package software.aws.toolkits.jetbrains.common.clients | ||
|
||
import com.intellij.openapi.components.Service | ||
import com.intellij.openapi.components.service | ||
import com.intellij.openapi.project.Project | ||
import com.intellij.openapi.util.SystemInfo | ||
import software.amazon.awssdk.services.codewhispererruntime.CodeWhispererRuntimeClient | ||
import software.amazon.awssdk.services.codewhispererruntime.model.ArtifactType | ||
import software.amazon.awssdk.services.codewhispererruntime.model.ContentChecksumType | ||
import software.amazon.awssdk.services.codewhispererruntime.model.CreateTaskAssistConversationRequest | ||
import software.amazon.awssdk.services.codewhispererruntime.model.CreateTaskAssistConversationResponse | ||
import software.amazon.awssdk.services.codewhispererruntime.model.CreateUploadUrlResponse | ||
import software.amazon.awssdk.services.codewhispererruntime.model.DocGenerationEvent | ||
import software.amazon.awssdk.services.codewhispererruntime.model.GetTaskAssistCodeGenerationResponse | ||
import software.amazon.awssdk.services.codewhispererruntime.model.IdeCategory | ||
import software.amazon.awssdk.services.codewhispererruntime.model.OperatingSystem | ||
import software.amazon.awssdk.services.codewhispererruntime.model.OptOutPreference | ||
import software.amazon.awssdk.services.codewhispererruntime.model.SendTelemetryEventResponse | ||
import software.amazon.awssdk.services.codewhispererruntime.model.StartTaskAssistCodeGenerationResponse | ||
import software.amazon.awssdk.services.codewhispererruntime.model.TaskAssistPlanningUploadContext | ||
import software.amazon.awssdk.services.codewhispererruntime.model.UploadContext | ||
import software.amazon.awssdk.services.codewhispererruntime.model.UploadIntent | ||
import software.amazon.awssdk.services.codewhispererruntime.model.UserContext | ||
import software.amazon.awssdk.services.codewhispererstreaming.model.ExportIntent | ||
import software.aws.toolkits.core.utils.error | ||
import software.aws.toolkits.core.utils.getLogger | ||
import software.aws.toolkits.core.utils.info | ||
import software.aws.toolkits.jetbrains.common.session.Intent | ||
import software.aws.toolkits.jetbrains.core.awsClient | ||
import software.aws.toolkits.jetbrains.core.credentials.ToolkitConnectionManager | ||
import software.aws.toolkits.jetbrains.core.credentials.pinning.QConnection | ||
import software.aws.toolkits.jetbrains.services.amazonq.clients.AmazonQStreamingClient | ||
import software.aws.toolkits.jetbrains.services.amazonqDoc.FEATURE_EVALUATION_PRODUCT_NAME | ||
import software.aws.toolkits.jetbrains.services.codemodernizer.utils.calculateTotalLatency | ||
import software.aws.toolkits.jetbrains.services.telemetry.ClientMetadata | ||
import software.aws.toolkits.jetbrains.settings.AwsSettings | ||
import java.time.Instant | ||
import software.amazon.awssdk.services.codewhispererruntime.model.ChatTriggerType as SyncChatTriggerType | ||
|
||
@Service(Service.Level.PROJECT) | ||
class AmazonQCodeGenerateClient(private val project: Project) { | ||
private fun getTelemetryOptOutPreference() = | ||
if (AwsSettings.getInstance().isTelemetryEnabled) { | ||
OptOutPreference.OPTIN | ||
} else { | ||
OptOutPreference.OPTOUT | ||
} | ||
|
||
private val docGenerationUserContext = ClientMetadata.getDefault().let { | ||
val osForFeatureDev: OperatingSystem = | ||
when { | ||
SystemInfo.isWindows -> OperatingSystem.WINDOWS | ||
SystemInfo.isMac -> OperatingSystem.MAC | ||
// For now, categorize everything else as "Linux" (Linux/FreeBSD/Solaris/etc.) | ||
else -> OperatingSystem.LINUX | ||
} | ||
|
||
UserContext.builder() | ||
.ideCategory(IdeCategory.JETBRAINS) | ||
.operatingSystem(osForFeatureDev) | ||
.product(FEATURE_EVALUATION_PRODUCT_NAME) | ||
.clientId(it.clientId) | ||
.ideVersion(it.awsVersion) | ||
.build() | ||
} | ||
|
||
fun connection() = ToolkitConnectionManager.getInstance(project).activeConnectionForFeature(QConnection.getInstance()) | ||
?: error("Attempted to use connection while one does not exist") | ||
|
||
fun bearerClient() = connection().getConnectionSettings().awsClient<CodeWhispererRuntimeClient>() | ||
Check notice on line 73 in plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/common/clients/AmazonQCodeGenerateClient.kt GitHub Actions / Qodana Community for JVMClass member can have 'private' visibility
Check notice Code scanning / QDJVMC Class member can have 'private' visibility Note
Function 'bearerClient' could be private
|
||
|
||
private val amazonQStreamingClient | ||
get() = AmazonQStreamingClient.getInstance(project) | ||
|
||
fun sendDocGenerationTelemetryEvent( | ||
docGenerationEvent: DocGenerationEvent, | ||
): SendTelemetryEventResponse = | ||
bearerClient().sendTelemetryEvent { requestBuilder -> | ||
requestBuilder.telemetryEvent { telemetryEventBuilder -> | ||
telemetryEventBuilder.docGenerationEvent(docGenerationEvent) | ||
} | ||
requestBuilder.optOutPreference(getTelemetryOptOutPreference()) | ||
requestBuilder.userContext(docGenerationUserContext) | ||
} | ||
|
||
fun createTaskAssistConversation(): CreateTaskAssistConversationResponse = bearerClient().createTaskAssistConversation( | ||
CreateTaskAssistConversationRequest.builder().build() | ||
) | ||
|
||
fun createTaskAssistUploadUrl(conversationId: String, contentChecksumSha256: String, contentLength: Long): CreateUploadUrlResponse = | ||
bearerClient().createUploadUrl { | ||
it.contentChecksumType(ContentChecksumType.SHA_256) | ||
.contentChecksum(contentChecksumSha256) | ||
.contentLength(contentLength) | ||
.artifactType(ArtifactType.SOURCE_CODE) | ||
.uploadIntent(UploadIntent.TASK_ASSIST_PLANNING) | ||
.uploadContext( | ||
UploadContext.builder() | ||
.taskAssistPlanningUploadContext( | ||
TaskAssistPlanningUploadContext.builder() | ||
.conversationId(conversationId) | ||
.build() | ||
) | ||
.build() | ||
) | ||
} | ||
|
||
fun startTaskAssistCodeGeneration(conversationId: String, uploadId: String, userMessage: String, intent: Intent): StartTaskAssistCodeGenerationResponse = | ||
bearerClient() | ||
.startTaskAssistCodeGeneration { request -> | ||
request | ||
.conversationState { | ||
it | ||
.conversationId(conversationId) | ||
.chatTriggerType(SyncChatTriggerType.MANUAL) | ||
.currentMessage { cm -> cm.userInputMessage { um -> um.content(userMessage) } } | ||
} | ||
.workspaceState { | ||
it | ||
.programmingLanguage { pl -> pl.languageName("javascript") } | ||
.uploadId(uploadId) | ||
} | ||
.intent(intent.name) | ||
} | ||
|
||
fun getTaskAssistCodeGeneration(conversationId: String, codeGenerationId: String): GetTaskAssistCodeGenerationResponse = bearerClient() | ||
.getTaskAssistCodeGeneration { | ||
it | ||
.conversationId(conversationId) | ||
.codeGenerationId(codeGenerationId) | ||
} | ||
|
||
suspend fun exportTaskAssistResultArchive(conversationId: String): MutableList<ByteArray> = amazonQStreamingClient.exportResultArchive( | ||
conversationId, | ||
ExportIntent.TASK_ASSIST, | ||
null, | ||
{ e -> | ||
LOG.error(e) { "TaskAssist - ExportResultArchive stream exportId=$conversationId exportIntent=${ExportIntent.TASK_ASSIST} Failed: ${e.message} " } | ||
}, | ||
{ startTime -> | ||
LOG.info { "TaskAssist - ExportResultArchive latency: ${calculateTotalLatency(startTime, Instant.now())}" } | ||
} | ||
) | ||
|
||
companion object { | ||
private val LOG = getLogger<AmazonQCodeGenerateClient>() | ||
|
||
fun getInstance(project: Project) = project.service<AmazonQCodeGenerateClient>() | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...mmunity/src/software/aws/toolkits/jetbrains/common/session/ConversationNotStartedState.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package software.aws.toolkits.jetbrains.common.session | ||
|
||
import software.aws.toolkits.jetbrains.services.amazonqDoc.session.SessionStateInteraction | ||
import software.aws.toolkits.jetbrains.services.amazonqFeatureDev.session.SessionStateAction | ||
import software.aws.toolkits.jetbrains.services.amazonqFeatureDev.session.SessionStatePhase | ||
import software.aws.toolkits.jetbrains.services.amazonqFeatureDev.util.CancellationTokenSource | ||
|
||
class ConversationNotStartedState( | ||
override var approach: String, | ||
override val tabID: String, | ||
override var token: CancellationTokenSource?, | ||
) : SessionState { | ||
override val phase = SessionStatePhase.INIT | ||
|
||
override suspend fun interact(action: SessionStateAction): SessionStateInteraction<SessionState> { | ||
error("Illegal transition between states, restart the conversation") | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...at/jetbrains-community/src/software/aws/toolkits/jetbrains/common/session/SessionState.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package software.aws.toolkits.jetbrains.common.session | ||
|
||
import software.aws.toolkits.jetbrains.services.amazonqDoc.session.SessionStateInteraction | ||
import software.aws.toolkits.jetbrains.services.amazonqFeatureDev.session.SessionStateAction | ||
import software.aws.toolkits.jetbrains.services.amazonqFeatureDev.session.SessionStatePhase | ||
import software.aws.toolkits.jetbrains.services.amazonqFeatureDev.util.CancellationTokenSource | ||
|
||
interface SessionState { | ||
val tabID: String | ||
val phase: SessionStatePhase? | ||
var token: CancellationTokenSource? | ||
var approach: String | ||
suspend fun interact(action: SessionStateAction): SessionStateInteraction<SessionState> | ||
} |
Oops, something went wrong.