Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
4 changes: 2 additions & 2 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"chat-client": "0.1.50",
"chat-client": "0.1.51",
"core/aws-lsp-core": "0.0.21",
"server/aws-lsp-antlr4": "0.1.25",
"server/aws-lsp-codewhisperer": "0.0.110",
"server/aws-lsp-codewhisperer": "0.0.114",
"server/aws-lsp-json": "0.1.26",
"server/aws-lsp-partiql": "0.0.23",
"server/aws-lsp-yaml": "0.1.26"
Expand Down
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
2 changes: 1 addition & 1 deletion app/aws-lsp-codewhisperer-runtimes/src/version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"agenticChat": "1.62.0"
"agenticChat": "1.66.0"
}
7 changes: 7 additions & 0 deletions chat-client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [0.1.51](https://github.com/aws/language-servers/compare/chat-client/v0.1.50...chat-client/v0.1.51) (2026-04-07)


### Performance Improvements

* **amazonq:** context command performance ([#2682](https://github.com/aws/language-servers/issues/2682)) ([f8dec9a](https://github.com/aws/language-servers/commit/f8dec9a65b7e72e78e5e16cbbfd470b2d69e75b0))

## [0.1.50](https://github.com/aws/language-servers/compare/chat-client/v0.1.49...chat-client/v0.1.50) (2026-03-10)


Expand Down
8 changes: 4 additions & 4 deletions chat-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws/chat-client",
"version": "0.1.50",
"version": "0.1.51",
"description": "AWS Chat Client",
"main": "out/index.js",
"repository": {
Expand All @@ -25,9 +25,9 @@
},
"dependencies": {
"@aws/chat-client-ui-types": "0.1.68",
"@aws/language-server-runtimes": "^0.3.14",
"@aws/language-server-runtimes-types": "^0.1.63",
"@aws/mynah-ui": "^4.39.2"
"@aws/language-server-runtimes": "^0.3.17",
"@aws/language-server-runtimes-types": "^0.1.64",
"@aws/mynah-ui": "^4.40.1"
},
"devDependencies": {
"@types/jsdom": "^21.1.6",
Expand Down
9 changes: 9 additions & 0 deletions chat-client/src/client/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ import {
OPEN_FILE_DIALOG_METHOD,
OpenFileDialogResult,
EXECUTE_SHELL_COMMAND_SHORTCUT_METHOD,
FILTER_CONTEXT_COMMANDS_REQUEST_METHOD,
FilterContextCommandsParams,
FilterContextCommandsResult,
} from '@aws/language-server-runtimes-types'
import { ConfigTexts, MynahUIDataModel, MynahUITabStoreModel } from '@aws/mynah-ui'
import { ServerMessage, TELEMETRY, TelemetryParams } from '../contracts/serverContracts'
Expand Down Expand Up @@ -215,6 +218,9 @@ export const createChat = (
case CONTEXT_COMMAND_NOTIFICATION_METHOD:
mynahApi.sendContextCommands(message.params as ContextCommandParams)
break
case FILTER_CONTEXT_COMMANDS_REQUEST_METHOD:
mynahApi.filterContextCommandsResponse(message.params as FilterContextCommandsResult)
break
case PINNED_CONTEXT_NOTIFICATION_METHOD:
mynahApi.sendPinnedContext(message.params as PinnedContextParams)
break
Expand Down Expand Up @@ -512,6 +518,9 @@ export const createChat = (
onFilesDropped: (params: { tabId: string; files: FileList; insertPosition: number }) => {
sendMessageToClient({ command: FILES_DROPPED, params: params })
},
filterContextCommands: (params: FilterContextCommandsParams) => {
sendMessageToClient({ command: FILTER_CONTEXT_COMMANDS_REQUEST_METHOD, params })
},
}

const messager = new Messager(chatApi)
Expand Down
6 changes: 6 additions & 0 deletions chat-client/src/client/messager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
CreatePromptParams,
FeedbackParams,
FileClickParams,
FilterContextCommandsParams,
FilterValue,
FollowUpClickParams,
GetSerializedChatResult,
Expand Down Expand Up @@ -112,6 +113,7 @@ export interface OutboundChatApi {
onListAvailableModels(params: ListAvailableModelsParams): void
onOpenFileDialogClick(params: OpenFileDialogParams): void
onFilesDropped(params: { tabId: string; files: FileList; insertPosition: number }): void
filterContextCommands(params: FilterContextCommandsParams): void
}

export class Messager {
Expand Down Expand Up @@ -297,4 +299,8 @@ export class Messager {
onFilesDropped = (params: { tabId: string; files: FileList; insertPosition: number }): void => {
this.chatApi.onFilesDropped(params)
}

onFilterContextCommands = (params: FilterContextCommandsParams): void => {
this.chatApi.filterContextCommands(params)
}
}
1 change: 1 addition & 0 deletions chat-client/src/client/mynahUi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ describe('MynahUI', () => {
onListAvailableModels: sinon.stub(),
onOpenFileDialogClick: sinon.stub(),
onFilesDropped: sinon.stub(),
filterContextCommands: sinon.stub(),
}

messager = new Messager(outboundChatApi)
Expand Down
59 changes: 48 additions & 11 deletions chat-client/src/client/mynahUi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
RuleClickResult,
SourceLinkClickParams,
ListAvailableModelsResult,
FilterContextCommandsResult,
ExecuteShellCommandParams,
} from '@aws/language-server-runtimes-types'
import {
Expand Down Expand Up @@ -100,6 +101,7 @@ export interface InboundChatApi {
addSelectedFilesToContext(params: OpenFileDialogParams): void
sendPinnedContext(params: PinnedContextParams): void
listAvailableModels(params: ListAvailableModelsResult): void
filterContextCommandsResponse(params: FilterContextCommandsResult): void
}

type ContextCommandGroups = MynahUIDataModel['contextCommands']
Expand Down Expand Up @@ -321,6 +323,7 @@ export const createMynahUi = (
let disclaimerCardActive = !disclaimerAcknowledged
let programmingModeCardActive = !pairProgrammingCardAcknowledged
let contextCommandGroups: ContextCommandGroups | undefined
let lastFilterTabId: string | undefined

let chatEventHandlers: ChatEventHandler = {
onCodeInsertToCursorPosition(
Expand Down Expand Up @@ -809,6 +812,14 @@ export const createMynahUi = (
defaults: {
store: tabFactory.createTab(false),
},
onContextCommandFilter: (tabId, searchTerm) => {
// Always forward to the server. Server pulls fresh items from
// the indexer on every request (no client-side cache), so the
// empty-term case (@ press) returns a fresh capped list and
// non-empty terms return the scored top matches.
lastFilterTabId = tabId
messager.onFilterContextCommands({ tabId, searchTerm: searchTerm ?? '' })
},
config: {
maxTabs: 10,
test: true,
Expand Down Expand Up @@ -1432,23 +1443,48 @@ ${params.message}`,
commands: toContextCommands(group.commands),
}))

const commandsWithHighlight = [
...(contextCommandGroups || []),
...(featureConfig?.get('highlightCommand')
? [
{
groupName: 'Additional commands',
commands: [toMynahContextCommand(featureConfig.get('highlightCommand'))],
},
]
: []),
]

Object.keys(mynahUi.getAllTabs()).forEach(tabId => {
mynahUi.updateStore(tabId, {
contextCommands: [
...(contextCommandGroups || []),
...(featureConfig?.get('highlightCommand')
? [
{
groupName: 'Additional commands',
commands: [toMynahContextCommand(featureConfig.get('highlightCommand'))],
},
]
: []),
],
contextCommands: commandsWithHighlight,
})
})
}

const filterContextCommandsResponse = (params: FilterContextCommandsResult) => {
if (!lastFilterTabId) return

const filtered = params.contextCommandGroups.map(group => ({
...group,
commands: toContextCommands(group.commands),
}))

mynahUi.updateStore(lastFilterTabId, {
contextCommands: [
...filtered,
...(featureConfig?.get('highlightCommand')
? [
{
groupName: 'Additional commands',
commands: [toMynahContextCommand(featureConfig.get('highlightCommand'))],
},
]
: []),
],
})
}

const addSelectedFilesToContext = (params: OpenFileDialogResult) => {
if (params.errorMessage) {
mynahUi.notify({
Expand Down Expand Up @@ -1605,6 +1641,7 @@ ${params.message}`,
ruleClicked: ruleClicked,
listAvailableModels: listAvailableModels,
addSelectedFilesToContext: addSelectedFilesToContext,
filterContextCommandsResponse: filterContextCommandsResponse,
}

return [mynahUi, api]
Expand Down
4 changes: 4 additions & 0 deletions chat-client/src/contracts/serverContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ import {
PINNED_CONTEXT_REMOVE_NOTIFICATION_METHOD,
PinnedContextParams,
LIST_AVAILABLE_MODELS_REQUEST_METHOD,
FILTER_CONTEXT_COMMANDS_REQUEST_METHOD,
FilterContextCommandsParams,
} from '@aws/language-server-runtimes-types'

export const TELEMETRY = 'telemetry/event'
Expand Down Expand Up @@ -83,6 +85,7 @@ export type ServerMessageCommand =
| typeof PINNED_CONTEXT_REMOVE_NOTIFICATION_METHOD
| typeof LIST_AVAILABLE_MODELS_REQUEST_METHOD
| typeof OPEN_FILE_DIALOG_METHOD
| typeof FILTER_CONTEXT_COMMANDS_REQUEST_METHOD

export interface ServerMessage {
command: ServerMessageCommand
Expand Down Expand Up @@ -119,3 +122,4 @@ export type ServerMessageParams =
| ListRulesParams
| PinnedContextParams
| OpenFileDialogParams
| FilterContextCommandsParams
Loading
Loading