Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 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: 1 addition & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
**/node_modules/**
**/out/**
server/aws-lsp-codewhisperer/src/client/sigv4/codewhisperersigv4client.d.ts
server/aws-lsp-codewhisperer/src/client/token/codewhispererbearertokenclient.d.ts
**/out/**
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ build
**/*.tgz
!core/codewhisperer-streaming/amzn-codewhisperer-streaming-*.tgz
!core/q-developer-streaming-client/amzn-amazon-q-developer-streaming-client-*.tgz
!core/codewhisperer-runtime/amzn-codewhisperer-runtime-*.tgz
!core/codewhisperer/amzn-codewhisperer-*.tgz
!server/aws-lsp-codewhisperer/types/types-local-indexing-*.tgz

.testresults/**
Expand Down
2 changes: 0 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ node_modules/
out/
**/bin/
**/obj/
server/aws-lsp-codewhisperer/src/client/sigv4/codewhisperersigv4client.d.ts
server/aws-lsp-codewhisperer/src/client/token/codewhispererbearertokenclient.d.ts
**/*.md
**/antlr-generated/
12 changes: 6 additions & 6 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"chat-client": "0.1.37",
"core/aws-lsp-core": "0.0.15",
"server/aws-lsp-antlr4": "0.1.19",
"server/aws-lsp-codewhisperer": "0.0.82",
"server/aws-lsp-json": "0.1.19",
"chat-client": "0.1.38",
"core/aws-lsp-core": "0.0.16",
"server/aws-lsp-antlr4": "0.1.20",
"server/aws-lsp-codewhisperer": "0.0.83",
"server/aws-lsp-json": "0.1.20",
"server/aws-lsp-partiql": "0.0.18",
"server/aws-lsp-yaml": "0.1.19"
"server/aws-lsp-yaml": "0.1.20"
}
6 changes: 3 additions & 3 deletions app/aws-lsp-antlr4-runtimes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"webpack": "webpack"
},
"dependencies": {
"@aws/language-server-runtimes": "^0.2.129",
"@aws/language-server-runtimes": "^0.3.0",
"@aws/lsp-antlr4": "*",
"antlr4-c3": "^3.4.1",
"antlr4ng": "^3.0.4"
"antlr4-c3": "^3.4.2",
"antlr4ng": "^3.0.14"
},
"devDependencies": {
"@types/chai": "^4.3.5",
Expand Down
2 changes: 1 addition & 1 deletion app/aws-lsp-buildspec-runtimes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"compile": "tsc --build"
},
"dependencies": {
"@aws/language-server-runtimes": "^0.2.129",
"@aws/language-server-runtimes": "^0.3.0",
"@aws/lsp-buildspec": "^0.0.1"
}
}
2 changes: 1 addition & 1 deletion app/aws-lsp-cloudformation-runtimes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"compile": "tsc --build"
},
"dependencies": {
"@aws/language-server-runtimes": "^0.2.129",
"@aws/language-server-runtimes": "^0.3.0",
"@aws/lsp-cloudformation": "^0.0.1"
}
}
3 changes: 2 additions & 1 deletion app/aws-lsp-codewhisperer-runtimes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"local-build": "node scripts/local-build.js"
},
"dependencies": {
"@aws/language-server-runtimes": "^0.2.129",
"@aws/language-server-runtimes": "^0.3.0",
"@aws/lsp-codewhisperer": "*",
"copyfiles": "^2.4.1",
"cross-env": "^7.0.3",
Expand All @@ -35,6 +35,7 @@
"process": "^0.11.10",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"url": "^0.11.4",
"vscode-languageserver": "^9.0.1",
"wdio": "^6.0.1",
"webpack-dev-server": "^5.2.0"
Expand Down
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.35.0"
"agenticChat": "1.37.0"
}
1 change: 1 addition & 0 deletions app/aws-lsp-codewhisperer-runtimes/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const webworkerConfig = {
http: 'stream-http',
crypto: 'crypto-browserify',
stream: 'stream-browserify',
url: require.resolve('url/'),
fs: path.resolve(__dirname, 'src/mock-fs.js'),
child_process: false,
vm: false,
Expand Down
2 changes: 1 addition & 1 deletion app/aws-lsp-identity-runtimes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"compile": "tsc --build"
},
"dependencies": {
"@aws/language-server-runtimes": "^0.2.129",
"@aws/language-server-runtimes": "^0.3.0",
"@aws/lsp-identity": "^0.0.1"
}
}
2 changes: 1 addition & 1 deletion app/aws-lsp-json-runtimes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"webpack": "webpack"
},
"dependencies": {
"@aws/language-server-runtimes": "^0.2.129",
"@aws/language-server-runtimes": "^0.3.0",
"@aws/lsp-json": "*"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion app/aws-lsp-notification-runtimes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"compile": "tsc --build"
},
"dependencies": {
"@aws/language-server-runtimes": "^0.2.129",
"@aws/language-server-runtimes": "^0.3.0",
"@aws/lsp-notification": "^0.0.1"
}
}
4 changes: 2 additions & 2 deletions app/aws-lsp-partiql-runtimes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"package": "npm run compile && npm run compile:webpack"
},
"dependencies": {
"@aws/language-server-runtimes": "^0.2.128",
"@aws/lsp-partiql": "^0.0.5"
"@aws/language-server-runtimes": "^0.3.0",
"@aws/lsp-partiql": "^0.0.18"
},
"devDependencies": {
"ts-loader": "^9.4.4",
Expand Down
2 changes: 1 addition & 1 deletion app/aws-lsp-s3-runtimes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"compile": "tsc --build"
},
"dependencies": {
"@aws/language-server-runtimes": "^0.2.129",
"@aws/language-server-runtimes": "^0.3.0",
"@aws/lsp-s3": "^0.0.1"
}
}
2 changes: 1 addition & 1 deletion app/aws-lsp-yaml-json-webworker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"serve:webpack": "NODE_ENV=development webpack serve"
},
"dependencies": {
"@aws/language-server-runtimes": "^0.2.129",
"@aws/language-server-runtimes": "^0.3.0",
"@aws/lsp-json": "*",
"@aws/lsp-yaml": "*"
},
Expand Down
2 changes: 1 addition & 1 deletion app/aws-lsp-yaml-runtimes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"webpack": "webpack"
},
"dependencies": {
"@aws/language-server-runtimes": "^0.2.129",
"@aws/language-server-runtimes": "^0.3.0",
"@aws/lsp-yaml": "*"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion app/hello-world-lsp-runtimes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"dependencies": {
"@aws/hello-world-lsp": "^0.0.1",
"@aws/language-server-runtimes": "^0.2.128"
"@aws/language-server-runtimes": "^0.3.0"
},
"devDependencies": {
"@types/chai": "^4.3.5",
Expand Down
8 changes: 8 additions & 0 deletions chat-client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [0.1.38](https://github.com/aws/language-servers/compare/chat-client/v0.1.37...chat-client/v0.1.38) (2025-10-01)


### Bug Fixes

* **amazonq:** Fix mock fs clean; Node version upgrade ([#2324](https://github.com/aws/language-servers/issues/2324)) ([1d9afd4](https://github.com/aws/language-servers/commit/1d9afd410e19624223e300ca06ea7d08a112cc82))
* optimize memory bank token usage and add new tab support ([#2366](https://github.com/aws/language-servers/issues/2366)) ([3057d56](https://github.com/aws/language-servers/commit/3057d56e4a3047d1715d6e3560e9f934d1de469c))

## [0.1.37](https://github.com/aws/language-servers/compare/chat-client/v0.1.36...chat-client/v0.1.37) (2025-09-24)


Expand Down
10 changes: 5 additions & 5 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.37",
"version": "0.1.38",
"description": "AWS Chat Client",
"main": "out/index.js",
"repository": {
Expand All @@ -24,10 +24,10 @@
"package": "webpack"
},
"dependencies": {
"@aws/chat-client-ui-types": "^0.1.56",
"@aws/language-server-runtimes": "^0.2.129",
"@aws/language-server-runtimes-types": "^0.1.50",
"@aws/mynah-ui": "^4.36.6"
"@aws/chat-client-ui-types": "^0.1.57",
"@aws/language-server-runtimes": "^0.3.0",
"@aws/language-server-runtimes-types": "^0.1.56",
"@aws/mynah-ui": "^4.36.8"
},
"devDependencies": {
"@types/jsdom": "^21.1.6",
Expand Down
11 changes: 10 additions & 1 deletion chat-client/src/client/features/rules.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ describe('rules', () => {
mynahUi = {
openTopBarButtonOverlay: sinon.stub(),
showCustomForm: sinon.stub(),
getAllTabs: sinon.stub().returns({}),
updateStore: sinon.stub().returns('new-tab-id'),
notify: sinon.stub(),
} as unknown as MynahUI
openTopBarButtonOverlayStub = mynahUi.openTopBarButtonOverlay as sinon.SinonStub
showCustomFormStub = mynahUi.showCustomForm as sinon.SinonStub

messager = {
onRuleClick: sinon.stub(),
onChatPrompt: sinon.stub(),
onTabAdd: sinon.stub(),
} as unknown as Messager

rulesList = new RulesList(mynahUi, messager)
Expand Down Expand Up @@ -151,12 +155,17 @@ describe('rules', () => {

onItemClick(createMemoryBankItem)

// Should send a chat prompt
// Should create new tab and send chat prompt
sinon.assert.calledOnce(messager.onTabAdd as sinon.SinonStub)
sinon.assert.calledOnce(messager.onChatPrompt as sinon.SinonStub)

const tabAddArgs = (messager.onTabAdd as sinon.SinonStub).getCall(0).args[0]
assert.equal(tabAddArgs, 'new-tab-id')

const chatPromptArgs = (messager.onChatPrompt as sinon.SinonStub).getCall(0).args[0]
assert.equal(chatPromptArgs.prompt.prompt, 'Generate a Memory Bank for this project')
assert.equal(chatPromptArgs.prompt.escapedPrompt, 'Generate a Memory Bank for this project')
assert.equal(chatPromptArgs.tabId, 'new-tab-id')
})

it('calls messager when regular rule is clicked', () => {
Expand Down
49 changes: 40 additions & 9 deletions chat-client/src/client/features/rules.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { MynahIconsType, MynahUI, DetailedListItem, DetailedListItemGroup, MynahIcons } from '@aws/mynah-ui'
import {
MynahIconsType,
MynahUI,
DetailedListItem,
DetailedListItemGroup,
MynahIcons,
NotificationType,
} from '@aws/mynah-ui'
import { Messager } from '../messager'
import { ListRulesResult } from '@aws/language-server-runtimes-types'
import { RulesFolder } from '@aws/language-server-runtimes-types'
Expand Down Expand Up @@ -82,14 +89,38 @@ export class RulesList {
// Close the rules list first
this.rulesList?.close()

// Use the current tab, the tabId should be the same as the one used for the rules list
this.messager.onChatPrompt({
prompt: {
prompt: 'Generate a Memory Bank for this project',
escapedPrompt: 'Generate a Memory Bank for this project',
},
tabId: this.tabId,
})
// Check if we're at the tab limit (10 tabs max)
const currentTabCount = Object.keys(this.mynahUi.getAllTabs()).length
if (currentTabCount >= 10) {
// Show notification that max tabs reached
this.mynahUi.notify({
content: 'You can only open ten conversation tabs at a time.',
type: NotificationType.WARNING,
})
return
}

// Create a new tab for the memory bank generation
const newTabId = this.mynahUi.updateStore('', { tabTitle: 'Memory Bank' })
if (newTabId) {
// Add the new tab and switch to it
this.messager.onTabAdd(newTabId)

// Send the chat prompt to the new tab
this.messager.onChatPrompt({
prompt: {
prompt: 'Generate a Memory Bank for this project',
escapedPrompt: 'Generate a Memory Bank for this project',
},
tabId: newTabId,
})
} else {
// Show error notification if tab creation failed
this.mynahUi.notify({
content: 'Failed to create new tab for Memory Bank generation.',
type: NotificationType.ERROR,
})
}
}

showLoading(tabId: string) {
Expand Down
10 changes: 7 additions & 3 deletions chat-client/src/client/mynahUi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ describe('MynahUI', () => {
// Simulate the response from the server
const models = [
{ id: 'CLAUDE_3_7_SONNET_20250219_V1_0', name: 'Claude Sonnet 3.7' },
{ id: 'CLAUDE_SONNET_4_20250514_V1_0', name: 'Claude Sonnet 4' },
{ id: 'CLAUDE_SONNET_4_20250514_V1_0', name: 'Claude Sonnet 4', description: 'Test description' },
]

const result: ListAvailableModelsResult = {
Expand All @@ -589,8 +589,12 @@ describe('MynahUI', () => {
{
id: 'model-selection',
options: [
{ value: 'CLAUDE_3_7_SONNET_20250219_V1_0', label: 'Claude Sonnet 3.7' },
{ value: 'CLAUDE_SONNET_4_20250514_V1_0', label: 'Claude Sonnet 4' },
{ value: 'CLAUDE_3_7_SONNET_20250219_V1_0', label: 'Claude Sonnet 3.7', description: '' },
{
value: 'CLAUDE_SONNET_4_20250514_V1_0',
label: 'Claude Sonnet 4',
description: 'Test description',
},
],
type: 'select',
value: 'CLAUDE_3_7_SONNET_20250219_V1_0',
Expand Down
6 changes: 5 additions & 1 deletion chat-client/src/client/mynahUi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1737,7 +1737,11 @@ ${params.message}`,
? {
...option,
type: 'select',
options: params.models.map(model => ({ value: model.id, label: model.name })),
options: params.models.map(model => ({
value: model.id,
label: model.name,
description: model.description ?? '',
})),
value: params.selectedModelId,
}
: option
Expand Down
11 changes: 7 additions & 4 deletions chat-client/src/client/texts/modelSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,24 @@ import { ChatItem, ChatItemFormItem, ChatItemType } from '@aws/mynah-ui'
*/
export enum BedrockModel {
CLAUDE_SONNET_4_20250514_V1_0 = 'CLAUDE_SONNET_4_20250514_V1_0',
CLAUDE_3_7_SONNET_20250219_V1_0 = 'CLAUDE_3_7_SONNET_20250219_V1_0',
}

type ModelDetails = {
label: string
description: string
}

const modelRecord: Record<BedrockModel, ModelDetails> = {
[BedrockModel.CLAUDE_3_7_SONNET_20250219_V1_0]: { label: 'Claude 3.7 Sonnet' },
[BedrockModel.CLAUDE_SONNET_4_20250514_V1_0]: { label: 'Claude Sonnet 4' },
[BedrockModel.CLAUDE_SONNET_4_20250514_V1_0]: {
label: 'Claude Sonnet 4',
description: 'Hybrid reasoning and coding for regular use',
},
}

const modelOptions = Object.entries(modelRecord).map(([value, { label }]) => ({
const modelOptions = Object.entries(modelRecord).map(([value, { label, description }]) => ({
value,
label,
description,
}))

export const modelSelection: ChatItemFormItem = {
Expand Down
4 changes: 2 additions & 2 deletions client/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,8 @@
"devDependencies": {
"@aws-sdk/credential-providers": "^3.731.1",
"@aws-sdk/types": "^3.734.0",
"@aws/chat-client-ui-types": "^0.1.56",
"@aws/language-server-runtimes": "^0.2.129",
"@aws/chat-client-ui-types": "^0.1.57",
"@aws/language-server-runtimes": "^0.3.0",
"@types/uuid": "^9.0.8",
"@types/vscode": "^1.98.0",
"jose": "^5.2.4",
Expand Down
Loading