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
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ class BrowserConnector(
chatPrompt,
textDocumentIdentifier,
cursorState,
context = requestFromUi.params.context
)

val tabId = requestFromUi.params.tabId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package software.aws.toolkits.jetbrains.services.amazonq.lsp.flareChat
import com.intellij.openapi.components.Service
import com.intellij.openapi.components.service
import com.intellij.openapi.project.Project
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.chat.IconType

@Service(Service.Level.PROJECT)
class AwsServerCapabilitiesProvider {
Expand All @@ -25,8 +26,8 @@ class AwsServerCapabilitiesProvider {
listOf(
QuickActionsCommandGroups(
listOf(
Command("/help", "Learn more about Amazon Q then"),
Command("/clear", "Clear this session")
QuickActionCommand("/help", "Learn more about Amazon Q then"),
QuickActionCommand("/clear", "Clear this session")
)
)
)
Expand All @@ -52,10 +53,33 @@ data class QuickActions(
)

data class QuickActionsCommandGroups(
val commands: List<Command>,
val commands: List<QuickActionCommand>,
)

data class Command(
val command: String,
val description: String?,
open class QuickActionCommand(
open val command: String,
open val description: String?,
open val placeholder: String? = null,
open val icon: IconType? = null,
)

data class ContextCommand(
val id: String?,
val route: List<String>?,
val label: String?,
val children: ContextCommandGroup?,
override val command: String,
override val description: String?,
override val placeholder: String? = null,
override val icon: IconType? = null,
) : QuickActionCommand(
command = command,
description = description,
placeholder = placeholder,
icon = icon
)

data class ContextCommandGroup(
val groupName: String?,
val commands: List<ContextCommand>,
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
package software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.chat

import com.fasterxml.jackson.annotation.JsonProperty
import software.aws.toolkits.jetbrains.services.amazonq.lsp.flareChat.Command
import software.aws.toolkits.jetbrains.services.amazonq.lsp.flareChat.ContextCommand

data class ChatPrompt(
val prompt: String,
Expand All @@ -20,13 +20,13 @@ data class SendChatPromptRequest(
data class MidChatPrompt(
val prompt: InnerChatPrompt,
val tabId: String,
val context: List<Command>?,
val context: List<ContextCommand>?,
)

data class InnerChatPrompt(
val prompt: String,
val escapedPrompt: String,
val context: List<Command>? = null,
val context: List<ContextCommand>? = null,
val options: InnerChatOptions?,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
package software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.chat

import org.eclipse.lsp4j.TextDocumentIdentifier
import software.aws.toolkits.jetbrains.services.amazonq.lsp.flareChat.ContextCommand

data class ChatParams(
val tabId: String,
val prompt: ChatPrompt,
val textDocument: TextDocumentIdentifier,
val cursorState: CursorState,
val context: List<ContextCommand>?,
)

data class EncryptedChatParams(
Expand Down
Loading