Skip to content

Commit f37bf5f

Browse files
ashishrp-awsbywang56laileni-awsjguoamztsmithsz
authored
feat: adding mcp servers feature to the language-server (#1544)
* feat: basic invoking and result message for MCP (#1251) - Add basic invoking and result messages for MCP - Require acceptance for MCP tool invocation - Minor fixes for regression * feat: add CRUD methods for MCP servers (#1271) * feat: basic invoking and result message for MCP (#1251) * feat: add basic CRUD methods for MCP servers/tools * feat: add MCP init timeut and minor fixes (#1304) * Merge remote-tracking branch 'upstream/main' into agentic-mcp (#1318) * fix: update listDirectory tool to output in tree-like format to reduce toolSize (#1260) * fix: clear history for `inputTooLong` errors (#1268) * fix: errors/cancellation not resetting undoAll state (#1273) * fix: errors/cancellation not resetting undoAll state * test: add unit tests * test: update test * style: revert formatting change * feat: adding a check before invoking workspace context (#1227) Co-authored-by: Supraja Venkatesh <[email protected]> * fix: improve data synchronization of server side workspace context (#1278) * fix: improve data synchronization of server side workspace context * fix: adding catch to snapshotWorkspace call --------- Co-authored-by: Weitao Wang <[email protected]> Co-authored-by: Paras <[email protected]> * chore: update netTransform unsupportedViewComponents * chore(release): release packages from branch main * fix: update versions manually (release-please bug) * fix: use the correct command name for testing bundles (#1280) * fix: use the correct command name for testing bundles * chore: change return type to pipe to see if more logs can be available --------- Co-authored-by: Paras <[email protected]> * fix: regex should match workspace text in bold style and startLine can be 0 (#1272) * fix: regex should match workspace text in bold style and startLine can be 0 * fix: remove unintended debug lines * fix: abandon requests with invalid toolResults (#1274) * fix: prevent timeout messages from displaying (#1282) * fix: set streamingClient timeout config (#1283) * fix: filter out .git folder from listDirectory (#1286) * fix: add requestId to chat for QModelResponse errors (#1284) * fix: add more common ignore patterns for listDirectory (#1287) * fix: wrap load chats on ready in try-catch (#1289) Problem Currently when the chat loads up a UI ready event is sent to the lsp, to load up previous chats and start indexing. If loading of previous chats fail, the LSP process crashes. This is particularly evident when openTab event has not been handled by the client. An error in that flow should not crash the LSP process or block the rest of the indexing from continuing. Solution This change surrounds the load chat logic within a try catch of its own to allow the rest of the indexing logic to proceed and not crash the server process * fix: stop chat response first when close tab (#1292) * fix: undo buttom not dimmed the card (#1276) * fix: undo buttom not dimmed the card * fix: fix more regression case for reject * fix: permission check ux changes (#1290) * fix: permission ux * fix: minor edits * fix: address bugs impacting indexing disabled functionality (#1293) * fix(amazonq): add codewhispererCustomizationArn to codewhisperer_perceivedLatency (#1285) ## Problem events between vscode and flare are not aligned ## Solution add codewhispererCustomizationArn * fix: show tooltip for warning message and remove the warning text (#1259) * fix: add tooltip for warning message * fix: fix the string * fix: add enum * fix: remove numbers * fix: the icon for different category icon and reject button * fix: add visibleName property to fix empty directory name when the directory ends with a slash (#1302) * fix: add visibleName property to fix empty directory name when the directory ends with a slash * fix: format --------- Co-authored-by: Francesco Piccoli <[email protected]> * chore: bump mynah-ui version (#1303) Co-authored-by: Francesco Piccoli <[email protected]> * chore(release): release packages from branch main (#1279) * chore(release): release packages from branch main * fix: update versions manually (release-please bug) --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Francesco Piccoli <[email protected]> * feat: merge updates for inline completions (#1299) * fix: stop buttom work expected (#1307) * fix: allowing reading multiple files with fsRead, minor tool validation fix (#1297) * fix: bug fix for exportResultsArchive to call with profileArn as parameter (#1300) * fix: for exportResultsArchive to call with profileArn --------- Co-authored-by: Pranav Firake <[email protected]> * chore: refactor common customization logic to a function and update corresponding CONTRIBUTION.md (#1281) Co-authored-by: Paras <[email protected]> * fix: remove @ mention in placeholder q chat text if agentic mode not available (#1311) * fix: remove @ mention in placeholder q chat text if agentic mode not available * style: rename DEFAULT_TAB_DATA to getDefaultTabConfig --------- Co-authored-by: Francesco Piccoli <[email protected]> * chore: update netTransform unsupportedViewComponents (#1306) * chore: update netTransform unsupportedViewComponents * chore: update netTransform unsupportedViewComponents * feat: add userWrittenCodeTracker (#1308) * feat: add userWrittenCodeTracker * fix: add unit test * fix: bug in skip edit for userWrittenCode (#1315) --------- Co-authored-by: Jason Guo <[email protected]> Co-authored-by: tsmithsz <[email protected]> Co-authored-by: Tai Lai <[email protected]> Co-authored-by: suprajaven <[email protected]> Co-authored-by: Supraja Venkatesh <[email protected]> Co-authored-by: Ivan <[email protected]> Co-authored-by: Weitao Wang <[email protected]> Co-authored-by: Paras <[email protected]> Co-authored-by: Jiayu Wang <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Ivan Mykhailovskyi <[email protected]> Co-authored-by: pras0131 <[email protected]> Co-authored-by: andrewyuq <[email protected]> Co-authored-by: Shruti Sinha <[email protected]> Co-authored-by: Na Yue <[email protected]> Co-authored-by: Randall-Jiang <[email protected]> Co-authored-by: Nicolas <[email protected]> Co-authored-by: Josh Pinkney <[email protected]> Co-authored-by: Francesco Piccoli <[email protected]> Co-authored-by: Francesco Piccoli <[email protected]> Co-authored-by: Zoe Lin <[email protected]> Co-authored-by: Pranav Firake <[email protected]> Co-authored-by: Pranav Firake <[email protected]> Co-authored-by: JiayuW2 <[email protected]> * feat: expose MCP server init status (#1324) * feat: initial MCP servers list ui changes (#1345) * feat: support mcp exec timeout, add tool state interface (#1335) * feat: handle mcp config conflicts, support infinity timeout (#1352) * chore: bump up language server version (#1360) * chore: bump up language server version * chore: bump up language server version chat-client-ui-types * feat: add update server permission method without re-init server (#1363) * Merge main to agentic-mcp branch (#1366) * fix: update listDirectory tool to output in tree-like format to reduce toolSize (#1260) * fix: clear history for `inputTooLong` errors (#1268) * fix: errors/cancellation not resetting undoAll state (#1273) * fix: errors/cancellation not resetting undoAll state * test: add unit tests * test: update test * style: revert formatting change * feat: adding a check before invoking workspace context (#1227) Co-authored-by: Supraja Venkatesh <[email protected]> * fix: improve data synchronization of server side workspace context (#1278) * fix: improve data synchronization of server side workspace context * fix: adding catch to snapshotWorkspace call --------- Co-authored-by: Weitao Wang <[email protected]> Co-authored-by: Paras <[email protected]> * chore: update netTransform unsupportedViewComponents * chore(release): release packages from branch main * fix: update versions manually (release-please bug) * fix: use the correct command name for testing bundles (#1280) * fix: use the correct command name for testing bundles * chore: change return type to pipe to see if more logs can be available --------- Co-authored-by: Paras <[email protected]> * fix: regex should match workspace text in bold style and startLine can be 0 (#1272) * fix: regex should match workspace text in bold style and startLine can be 0 * fix: remove unintended debug lines * fix: abandon requests with invalid toolResults (#1274) * fix: prevent timeout messages from displaying (#1282) * fix: set streamingClient timeout config (#1283) * fix: filter out .git folder from listDirectory (#1286) * fix: add requestId to chat for QModelResponse errors (#1284) * fix: add more common ignore patterns for listDirectory (#1287) * fix: wrap load chats on ready in try-catch (#1289) Problem Currently when the chat loads up a UI ready event is sent to the lsp, to load up previous chats and start indexing. If loading of previous chats fail, the LSP process crashes. This is particularly evident when openTab event has not been handled by the client. An error in that flow should not crash the LSP process or block the rest of the indexing from continuing. Solution This change surrounds the load chat logic within a try catch of its own to allow the rest of the indexing logic to proceed and not crash the server process * fix: stop chat response first when close tab (#1292) * fix: undo buttom not dimmed the card (#1276) * fix: undo buttom not dimmed the card * fix: fix more regression case for reject * fix: permission check ux changes (#1290) * fix: permission ux * fix: minor edits * fix: address bugs impacting indexing disabled functionality (#1293) * fix(amazonq): add codewhispererCustomizationArn to codewhisperer_perceivedLatency (#1285) ## Problem events between vscode and flare are not aligned ## Solution add codewhispererCustomizationArn * fix: show tooltip for warning message and remove the warning text (#1259) * fix: add tooltip for warning message * fix: fix the string * fix: add enum * fix: remove numbers * fix: the icon for different category icon and reject button * fix: add visibleName property to fix empty directory name when the directory ends with a slash (#1302) * fix: add visibleName property to fix empty directory name when the directory ends with a slash * fix: format --------- Co-authored-by: Francesco Piccoli <[email protected]> * chore: bump mynah-ui version (#1303) Co-authored-by: Francesco Piccoli <[email protected]> * chore(release): release packages from branch main (#1279) * chore(release): release packages from branch main * fix: update versions manually (release-please bug) --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Francesco Piccoli <[email protected]> * feat: merge updates for inline completions (#1299) * fix: stop buttom work expected (#1307) * fix: allowing reading multiple files with fsRead, minor tool validation fix (#1297) * fix: bug fix for exportResultsArchive to call with profileArn as parameter (#1300) * fix: for exportResultsArchive to call with profileArn --------- Co-authored-by: Pranav Firake <[email protected]> * chore: refactor common customization logic to a function and update corresponding CONTRIBUTION.md (#1281) Co-authored-by: Paras <[email protected]> * fix: remove @ mention in placeholder q chat text if agentic mode not available (#1311) * fix: remove @ mention in placeholder q chat text if agentic mode not available * style: rename DEFAULT_TAB_DATA to getDefaultTabConfig --------- Co-authored-by: Francesco Piccoli <[email protected]> * chore: update netTransform unsupportedViewComponents (#1306) * chore: update netTransform unsupportedViewComponents * chore: update netTransform unsupportedViewComponents * feat: add userWrittenCodeTracker (#1308) * feat: add userWrittenCodeTracker * fix: add unit test * fix: bug in skip edit for userWrittenCode (#1315) * fix: update ignore pattern of glob for sspc (#1319) * chore: stub timeout (#1316) * fix: open initial tab using mynahUI defaults instead of waiting for ChatOptions (#1322) * fix: open initial tab using mynahUI defaults instead of waiting for ChatOptions * fix: push banner message to initial tab after chat options are received * fix: bump runtimes and fix broken test (#1323) * chore: bump runtimes version * fix: broken test after bumping runtimes --------- Co-authored-by: Francesco Piccoli <[email protected]> * feat(amazonq): telemetry for chat history and export (#1314) * fix: update fileSearch toolSpec and implementation (#1320) * fix: update fileSearch toolSpec and implementation * fix: update unit test * fix(amazonq): 500k max input limit in user input box. Align payload prompt with user typed prompt. (#1325) * fix: truncate userInputMessage to first 500k characters (#1327) * fix: truncate userInputMessage to 500k * fix: duplicate suggestion in inline response (#1331) * fix: welcome card shows everytime (#1332) * chore: script to create local build (#1301) * chore: script to create local build * fix: refactor custom webpack config to allow .node files to be created inside build directory add local-build script usage to package.json add README for local-build --------- Co-authored-by: Paras <[email protected]> * chore(release): release packages from branch main (#1305) * chore(release): release packages from branch main * fix: update versions manually (release-please bug) --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Francesco Piccoli <[email protected]> * chore: bump runtimes-types and chat-client-ui-types version to latest (#1333) Co-authored-by: Francesco Piccoli <[email protected]> * fix(amazonq): export q chat in windows not working due to invalid path (#1330) * fix(amazonq): export chat in Windows not working due to invalid path * chore: emit telemetry for inline chat result (#1131) * feat: change to emit STE event for inline chat action * chore: add support for emitting telemetry related to inlineChatResult * fix: fix merge conflict * chore: remove the unused imports from TelemetryService class --------- Co-authored-by: Paras <[email protected]> * refactor(amazonq): optimization: remove validation call for selected profile (#1329) * refactor(amazonq): optimization: only call listAvailableProfile with region associated with the arn * revert(amazonq): console.log * refactor(amazonq): stop validating profile availability on configurationChanged * fix(amazonq): fix typo * fix(amazonq): test * test(amazonq): amazonQTokenServiceManager.test.ts * refactor(amazonq): revert unneeded changes * refactor(amazonq): nit * refactor(amazonq): more nit * refactor(amazonq): fix test * refactor(amazonq): fix test * refactor(amazonq): nit * refactor(amazonq): revert unneeded changes * chore(release): release packages from branch main (#1334) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: don't force commit-lint locally (#1337) Problem: Forcing commit-lint locally is very disruptive. Solution: Drop it. * fix: add requestIds for each LLM call for amazonq_addMessage metric (#1338) * fix: adding new telemetry metrics and addtional fields for existing metrics (#1341) * fix: adding new telemetry metrics and addtional fields for existing metrics * Minor edits * fix: failing tests * fix: adding agenticCodingMode to emitMessageResponseError metric * chore: bumping language server runtime versions (#1344) * feat: migrate inline completion telemetry to Flare (#1336) * feat: migrate inline completion telemetry to Flare * feat: migrate inline completion telemetry to Flare * chore: bump the typescript-eslint group with 2 updates (#1255) Bumps the typescript-eslint group with 2 updates: [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) and [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser). Updates `@typescript-eslint/eslint-plugin` from 8.31.0 to 8.31.1 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.31.1/packages/eslint-plugin) Updates `@typescript-eslint/parser` from 8.31.0 to 8.31.1 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.31.1/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-version: 8.31.1 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: typescript-eslint - dependency-name: "@typescript-eslint/parser" dependency-version: 8.31.1 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: typescript-eslint ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: adding error handling for export tab (#1350) Current export chat functionality doesn't properly handle user cancellation of the save dialog, leading to incorrect telemetry reporting and runs into errors. Solution Added proper handling of save dialog cancellation. Enhanced error handling to differentiate between user cancellation and other failure cases. Updated telemetry emission to accurately reflect the export operation outcome. * fix: add robust validation logic to fixHistory (#1340) * fix: Reduce perceived latency of fsWrite. Show fsWrite errors in the UX (#1351) * fix: reduce perceived latency * fix: only do render on partial results for fsWrite (#1354) * fix: re-categorize error status code (#1355) * chore: revert "chore: bump the typescript-eslint group with 2 updates (#1255)" (#1357) This reverts commit 140104a. * fix: convert RTS improperly formed request error to 500 (#1356) --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Jason Guo <[email protected]> Co-authored-by: tsmithsz <[email protected]> Co-authored-by: Tai Lai <[email protected]> Co-authored-by: suprajaven <[email protected]> Co-authored-by: Supraja Venkatesh <[email protected]> Co-authored-by: Ivan <[email protected]> Co-authored-by: Weitao Wang <[email protected]> Co-authored-by: Paras <[email protected]> Co-authored-by: Jiayu Wang <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Ivan Mykhailovskyi <[email protected]> Co-authored-by: pras0131 <[email protected]> Co-authored-by: andrewyuq <[email protected]> Co-authored-by: Shruti Sinha <[email protected]> Co-authored-by: Na Yue <[email protected]> Co-authored-by: Randall-Jiang <[email protected]> Co-authored-by: Nicolas <[email protected]> Co-authored-by: Josh Pinkney <[email protected]> Co-authored-by: Francesco Piccoli <[email protected]> Co-authored-by: Francesco Piccoli <[email protected]> Co-authored-by: Zoe Lin <[email protected]> Co-authored-by: Pranav Firake <[email protected]> Co-authored-by: Pranav Firake <[email protected]> Co-authored-by: JiayuW2 <[email protected]> Co-authored-by: wweitao <[email protected]> Co-authored-by: Oksana Volodkevych <[email protected]> Co-authored-by: Viktor Shcherba <[email protected]> Co-authored-by: Avi Alpert <[email protected]> Co-authored-by: Lei Gao <[email protected]> Co-authored-by: Will Lo <[email protected]> Co-authored-by: Justin M. Keyes <[email protected]> Co-authored-by: chungjac <[email protected]> Co-authored-by: yzhangok <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lokesh <[email protected]> Co-authored-by: Natalia Durlik <[email protected]> * fix: refresh mcp server functionality (#1349) * feat: setup for MCP server tools permission UX (#1375) * feat: adding tool count to the MCP list (#1380) * fix: fixing merge conflicts * fix: refresh button (#1381) * feat: adding add mcp configuration UX (#1385) * fix: refresh button should not reset singleton instance (#1391) * feat: adding disable and delete mcp server functions (#1390) * feat: adding optional values field to add mcp configuration ux (#1393) * feat: support persona file (#1411) * feat: enable mcp server and fix for permission list mandatory items (#1413) * fix: handle wilcar for enable/disable server (#1414) * feat: adding correct icons for MCP servers state (#1417) * fix: success and error case for adding mcp server (#1412) * chore: bumping up language server version (#1418) * fix: adding chat summary card for mcp tools (#1419) * chore: bumping up language server version * fix: adding chat summary card for mcp tools * feat: added built-in tools with proper permissions (#1420) * support MCP paths for Windows (#1426) * fix: multiple fixes for MCP + add back UTs (#1423) * fix: check if mcp.json exits when mutating mcp json (#1427) * fix: handle the case when mcp json file not exist * feat: adding permissions ux to the mcp and refactoring mynahui.ts and agenticcontroller.ts * fix: closing mcp servers and each server should return to chat (#1430) * fix: emit status change event on MCP error (#1432) * fix: add validation for user's input (#1434) * feat: update server UX (#1437) * feat: dynamic server update and fix configuration button (#1436) * fix: merge conflict resolution (#1439) * fix: disable mcp tools for pair programmer off mode (#1442) * fix: use edit mcp view for fix configuration (#1441) * fix: adding ux changes to run button (#1445) * fix: fix for removing duplicates of completed status for chat summary item header for mcp tools (#1447) * fix: removing edit config * fix: fix for mcp permissions page for global and workspace (#1450) * fix: use delimiter ___ between serverName and toolName for MCP (#1451) * chore: bumpingup language server runtimes version to 0.2.88 * fix: don't add args and env to mcp.json file if empty (#1453) * fix: when user enter duplicate server name it should be an error (#1457) * fix: adding error handling for list of mcp servers * fix: rebasing to agentic-chat * fix: Adding tooltip descriptions to tool count and enabling the count * fix: showing error status if there is a validation error in list of mcp servers * feat: check if mcp is supported (#1460) * fix: ux fixes for mcp list (#1471) * fix: minor fix * fix: adding tool descriptions in edit mcp * chore: use mcp field passed in from client (#1473) * fix: adding error handling for config load errors to display them to ux * fix: addressing comments * fix: minor edita * fix: fix ws level config and multiple bugs (#1477) * fix: revert change on json file (#1455) * fix: show invalid configuration error when fixing server config (#1472) * fix: ux fit and finish task and adding explanation to chat summary card * fix: remove unused util (#1482) * fix: use json for persona, add default persona (#1491) * fix: add remove function for inactive mcp server (#1498) * fix: add remove function for inactive mcp server * fix: remove extra line when user execute the command * fix: refresh MCP server list after user delete the mcp server * fix: fix bugs (#1493) * fix: do not have empty args or env while updating server (#1492) * merge mainline to agentic-mcp (#1509) * fix: make whole row clickable (#1507) * fix: update default persona file spec and tool permisions strings * fix: fix to correctly load the permissions (#1516) * merge main into agentic-mcp (#1520) * fix: handle requestAborted errors silently (#1394) * fix: Revert stop text align (#1397) * Revert "fix: remove the unused center stop message and add comment" This reverts commit 654a25a. * Revert "fix: when user input a prompt, it wont have stop message before the new prompt" This reverts commit f6e9904. * fix: add validation for empty chat history (#1403) * fix: the new prompt wont stop the process properly (#1404) * chore: generate a temporary workspaceIdentifier if not given (#1389) Co-authored-by: Jiatong Li <[email protected]> * feat(amazonq): add fileUri to FileContext (#1399) Co-authored-by: Jiatong Li <[email protected]> * fix: Set `source` parameter chat request context to 'IDE' (#1407) * fix: set source to 'IDE' for chat client --------- Co-authored-by: Alice Koreman <[email protected]> * feat: integrate server side project context into agentic chat (#1405) * feat: pass remote workspaceId in agentic chat API calls * feat: removed dev logs * feat: add unit test * feat: bumping up dependency version * chore: updating package-lock.json * fix: install new streaming client correctly --------- Co-authored-by: Ege Ozcan <[email protected]> * fix: add crypto import (#1408) #1389 this change broke LSP initialization as the file does not add the required import for crypto. Added the required import * fix: accidental formatting #1410 * feat(amazonq): integrate server side workspace context with inline completion (#1402) * feat(amazonq): integrate workspace context with inline completion * fix: replace got with axios for s3 uploads in workspace context capability --------- Co-authored-by: Jiatong Li <[email protected]> Co-authored-by: Ege Ozcan <[email protected]> * fix: SSPC dependency upload and watcher fixes (#1377) * fix: resolve symlink of python dependency upload * fix: bundle events from dependency watcher * fix: correct watcher.close() with watcher.dispose() * fix: fix dependency watcher event * fix: add additional log for error cases of watcher and symlink resolver --------- Co-authored-by: Jiatong Li <[email protected]> * fix: change the version to axios to ^1.8.4 (#1421) Co-authored-by: Paras Miglani <[email protected]> * chore: bump runtimes dependencies (#1422) * chore(release): release packages from branch main (#1339) * chore(release): release packages from branch main * chore: apply missing package updates --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Natalia Durlik <[email protected]> * fix: ensure local index server updates with workspaceChangeEvent and bump runtimes (#1424) This change bumps runtimes to include fix related to didWorkspaceChangeFolders handling in aws/language-server-runtimes#522 In addition this change makes a fix in the localProjectContextServer where onDidChangeWorkpaceFolders event didn't update the workspaceFolders list used for indexing. It now updates to reflect the change. * fix: fix uncaught exception in workspaceFolderManager (#1428) * fix: fix uncaught exception in workspaceFolderManager * fix: fix agenticChatTriggerContexts test * chore: set a filter to run SSPC on supported extensions * fix: axios upload presigned url * fix: update log comments of extension filter --------- Co-authored-by: Jiatong Li <[email protected]> * chore: bump runtimes (#1438) * chore: bump the typescript-eslint group with 2 updates (#1362) Bumps the typescript-eslint group with 2 updates: [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) and [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser). Updates `@typescript-eslint/eslint-plugin` from 8.31.0 to 8.32.1 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.32.1/packages/eslint-plugin) Updates `@typescript-eslint/parser` from 8.31.0 to 8.32.1 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.32.1/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-version: 8.32.1 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: typescript-eslint - dependency-name: "@typescript-eslint/parser" dependency-version: 8.32.1 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: typescript-eslint ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix(amazonq): fix UTDE suggestion state for pagination cases (#1433) In pagination cases, in a certain condition when user has made a decision before a paginated response arrived to flare, an extra discard UTD event will be sent after an accept/reject event corresponding to a user action, this is incorrect * fix(chat-client): fix bug where pair programmer mode option update was not stored properly (#1400) `OnPromptInputOptionChange` event when the agentic mode button is toggled on and off, the mynahUI store was not updated properly to store the updated value. This resulted in "insert to cursor" option being disabled/hidden in a codeblock shown in an agentic mode OFF response. Solution With this change, on prompt option change event, the MynahUi store is now updated to preserve the latest value of "pair-programmer-mode" option. I verified the insert to cursor option now appears on toggle * fix: enable fuzzySearch tool (#1328) * fix: enable grepSearch tool (#1396) * fix: properly tokenize command args using shlex.split() for Windows (#1440) * fix: properly tokenize command args using shlex.split() for Windows * fix: handle built-in windows commands in validation check * fix(amazonq): fix for honouring the index cache dir path value (#1448) * fix: convert array values to comma-separated strings in telemetry metrics emitAgencticLoop_InvokeLLM (#1458) * fix: flatten array into string before emitting telemetry metric * fix: rename the toolName to toolNames for better readability * fix: update executeBash UI for failures during command existence check (#1462) * fix(amazonq): wrap sspc lsp handlers in try/catch so failures do not take down server (#1464) for example, if file is renamed from supported language to unsupported language, or upload itself fails, the server crashes. * fix: increase the code start and end line number by 1 (#1470) * fix: decode UTF-16LE shell output on Windows (#1456) * fix: remove gradient from create prompt button (#1475) * feat(amazonq): add abap as supported language #1463 * fix: reorder cancellation operations (#1478) * fix: use updated version of vecLib and use local context controller to raise context command updates (#1479) ## Problem `DidWorkspaceFolderChange` events did not update context commands. This issue is particularly pronounced in Visual Studio where this event is used to send information about projects contained in a solution on intial load which should be indexed. In addition, the updateIndex calls for vecLib was gated by the indexingEnabled flag which meant when a change event came with the indexer off, the context commands were not updated. The context command updates should happen unconditionally even when indexer is disabled. ## Solution This change addresses the issues above: * A new version of the vecLib has been added to the local development copy with the tgz file. A corresponding release PR is being tracked in a separate repo. * The update above adds support for updating indexer and context commands when workspace folders change. * A corresponding change has been made to the language server to support sending the workspace folders updates to the vecLib update index call. * The context command provider and controller were very strongly coupled causing issues updating the two independently. With this change, the controller now becomes the sole authority that raises an event to context command provider to get and push latest context commands after indexing finishes. * IndexingEnabled flag has been removed as check from the updateIndex calls. It is now expected that the vecLib knows when to not index locally(for @workspace) when the buildIndex('default') is invoked with this value. * chore: bump mynah-ui version to 4.35.1 in chat-client (#1485) Co-authored-by: Ege Ozcan <[email protected]> * chore: add workspace context server to the agent-standalone bundle (#1486) Co-authored-by: Ege Ozcan <[email protected]> * chore: bump runtimes version to 0.2.89 (#1487) * chore: bump runtimes version to 0.2.89 * chore: bump chat client types dependency --------- Co-authored-by: Supraja Venkatesh <[email protected]> * fix: add tests for workspace change supports (#1484) * chore(release): release packages from branch main (#1488) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: improve the executeBash tool spec (#1465) * Improve the executeBash tool spec * Remove unnecessary instructions * fix(amazonq): fix line endings before fswrite for windows (#1483) * feat(amazonq): send relative file path for inline completion (#1481) Co-authored-by: Jiatong Li <[email protected]> * chore: bump runtimes (#1490) * feat: model selection for agentic chat (#1294) * feat: model selection for agentic chat * move modelId to userInputMessage * add modelId to sendTelemetryEvent * support per-region selection * update modelId values * feat: add custom model exception handling * merge main and adapt to new changes in runtime with new mynah * change code to 500 * remove unwanted changes * persist modelId selection in fs * model change indicator * keep model selection for other tabs * fix tests * update mynahui version * remove region for now * remove comment * fix issues after merge * only persist selection for the current tab --------- Co-authored-by: Yaofu Zuo <[email protected]> * fix: grepSearch on Windows (#1494) Fix Windows GrepSearch path * fix: fix paths array issue in fsRead (#1496) * fix(amazonq): pagination request should also used truncated left/right context (#1497) * fix(amazonq): pagination request should also used truncated left/right context also fixes a fallout that the function call should be used for isIndexingEnabled() * fix: add tests * fix: extra line when user run the command (#1499) * fix: add environment variable override to disable indexing library init (#1504) * chore(release): release packages from branch main (#1489) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: disable grep search (#1514) * fix: model doesn't update in session for new tabs (#1506) * feat: added configurable token cache location (#1517) * feat: added configurable token cache location - Add support for configuring token cache location through LSP initialization options - Move default token cache from local .cache directory to $HOMEDIR/.aws/device-sso-lsp/cache - Update README with configuration documentation - Pass token cache location through the authentication flow components * fix: use standard aws/sso/cache location --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: tsmithsz <[email protected]> Co-authored-by: Randall-Jiang <[email protected]> Co-authored-by: Jiatong Li <[email protected]> Co-authored-by: Jiatong Li <[email protected]> Co-authored-by: Alice Koreman <[email protected]> Co-authored-by: Alice Koreman <[email protected]> Co-authored-by: guvishl <[email protected]> Co-authored-by: Ege Ozcan <[email protected]> Co-authored-by: Shruti Sinha <[email protected]> Co-authored-by: Jason Guo <[email protected]> Co-authored-by: wweitao <[email protected]> Co-authored-by: pras0131 <[email protected]> Co-authored-by: Paras Miglani <[email protected]> Co-authored-by: Natalia Durlik <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Natalia Durlik <[email protected]> Co-authored-by: Tai Lai <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: andrewyuq <[email protected]> Co-authored-by: Lokesh <[email protected]> Co-authored-by: Sherry Lu <[email protected]> Co-authored-by: Richard Li <[email protected]> Co-authored-by: Christopher Christou <[email protected]> Co-authored-by: Aseem sharma <[email protected]> Co-authored-by: ege0zcan <[email protected]> Co-authored-by: suprajaven <[email protected]> Co-authored-by: Supraja Venkatesh <[email protected]> Co-authored-by: jngyuamz <[email protected]> Co-authored-by: Yaofu Zuo <[email protected]> Co-authored-by: Jonathan Breedlove <[email protected]> Co-authored-by: Lei Gao <[email protected]> Co-authored-by: Viktor Shcherba <[email protected]> * fix: don't show erros on mcp server list page (#1513) * fix: persist only copy of mcp server when scope is changed * fix: fix for correct initialization of tools with namespacing for refresh * fix: fix to refresh only one server that is enabled * fix: correcting fuzzysearch to fileSearch from merge conflicts (#1543) * fix: fix for merge conflict errors (#1545) * fix: fix merge conflicts for fuzzySearch (#1546) * telemetry(mcp): adding mcp telemetry metrics (#1528) * fix: two telemetry events are emitted for mcp except init case * fix: emitting amazonq_mcpConfig metric from init function of mcpManager. * fix: adding amazonq_mcpConfig to enable and disable config cases * fix: refactoring code * fix: adding mcp server through UI for Windows (#1547) * fix: mcp server should use workspace persona first (#1530) * fix: fix to correctly store permissions if user reverts his permission to original choice (#1551) * fix: timeout displayed and accepted in seconds (#1535) * fix: when user remove the mcp server, it should also been removed from persona file (#1565) * fix: changing server name after pressing fix configuration button will work (#1561) * fix: fix to address main merge issues (#1568) * fix: fix for CI tests * fix: fix for CI tests for mcp manager * fix: fix to skip mcp mynah ui test case * fix: removed existing test * fix: fix for icon check in tests * fix: fix for agentic chat controller test failures * fix: fix for mcptools test failures * fix: fix for windows path tests --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Boyu <[email protected]> Co-authored-by: Laxman Reddy <[email protected]> Co-authored-by: Jason Guo <[email protected]> Co-authored-by: tsmithsz <[email protected]> Co-authored-by: Tai Lai <[email protected]> Co-authored-by: suprajaven <[email protected]> Co-authored-by: Supraja Venkatesh <[email protected]> Co-authored-by: Ivan <[email protected]> Co-authored-by: Weitao Wang <[email protected]> Co-authored-by: Paras <[email protected]> Co-authored-by: Jiayu Wang <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Ivan Mykhailovskyi <[email protected]> Co-authored-by: pras0131 <[email protected]> Co-authored-by: andrewyuq <[email protected]> Co-authored-by: Shruti Sinha <[email protected]> Co-authored-by: Na Yue <[email protected]> Co-authored-by: Randall-Jiang <[email protected]> Co-authored-by: Nicolas <[email protected]> Co-authored-by: Josh Pinkney <[email protected]> Co-authored-by: Francesco Piccoli <[email protected]> Co-authored-by: Francesco Piccoli <[email protected]> Co-authored-by: Zoe Lin <[email protected]> Co-authored-by: Pranav Firake <[email protected]> Co-authored-by: Pranav Firake <[email protected]> Co-authored-by: JiayuW2 <[email protected]> Co-authored-by: wweitao <[email protected]> Co-authored-by: Oksana Volodkevych <[email protected]> Co-authored-by: Viktor Shcherba <[email protected]> Co-authored-by: Avi Alpert <[email protected]> Co-authored-by: Lei Gao <[email protected]> Co-authored-by: Will Lo <[email protected]> Co-authored-by: Justin M. Keyes <[email protected]> Co-authored-by: chungjac <[email protected]> Co-authored-by: yzhangok <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lokesh <[email protected]> Co-authored-by: Natalia Durlik <[email protected]> Co-authored-by: laileni <[email protected]> Co-authored-by: Jiatong Li <[email protected]> Co-authored-by: Jiatong Li <[email protected]> Co-authored-by: Alice Koreman <[email protected]> Co-authored-by: Alice Koreman <[email protected]> Co-authored-by: guvishl <[email protected]> Co-authored-by: Ege Ozcan <[email protected]> Co-authored-by: Natalia Durlik <[email protected]> Co-authored-by: Sherry Lu <[email protected]> Co-authored-by: Richard Li <[email protected]> Co-authored-by: Christopher Christou <[email protected]> Co-authored-by: Aseem sharma <[email protected]> Co-authored-by: ege0zcan <[email protected]> Co-authored-by: jngyuamz <[email protected]> Co-authored-by: Yaofu Zuo <[email protected]> Co-authored-by: Jonathan Breedlove <[email protected]>
1 parent d25bcb6 commit f37bf5f

39 files changed

+5900
-329
lines changed

app/aws-lsp-codewhisperer-runtimes/src/agent-standalone.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ import {
99
WorkspaceContextServerTokenProxy,
1010
} from '@aws/lsp-codewhisperer'
1111
import { IdentityServer } from '@aws/lsp-identity'
12-
import { BashToolsServer, FsToolsServer } from '@aws/lsp-codewhisperer/out/language-server/agenticChat/tools/toolServer'
12+
import {
13+
BashToolsServer,
14+
FsToolsServer,
15+
McpToolsServer,
16+
} from '@aws/lsp-codewhisperer/out/language-server/agenticChat/tools/toolServer'
1317
import { createTokenRuntimeProps } from './standalone-common'
1418

1519
const MAJOR = 0
@@ -28,7 +32,7 @@ const props = createTokenRuntimeProps(VERSION, [
2832
BashToolsServer,
2933
QLocalProjectContextServerTokenProxy,
3034
WorkspaceContextServerTokenProxy,
31-
// McpToolsServer,
35+
McpToolsServer,
3236
// LspToolsServer,
3337
])
3438

chat-client/CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@
216216

217217
### Changed
218218

219-
- Update `@aws/chat-client-ui-types` to 0.1.0
220-
- Update `@aws/language-server-runtimes-types` to 0.1.0
219+
- Update `@aws/chat-client-ui-types` to 0.1.35
220+
- Update `@aws/language-server-runtimes-types` to 0.1.29
221221
- Shortened legal text in the footer
222222

223223
## [0.0.9] - 2024-11-20
@@ -241,8 +241,8 @@
241241
### Changed
242242

243243
- Changed legal text in the footer
244-
- Update `@aws/chat-client-ui-types` to 0.0.8
245-
- Update `@aws/language-server-runtimes-types` to to 0.0.7
244+
- Update `@aws/chat-client-ui-types` to 0.1.35
245+
- Update `@aws/language-server-runtimes-types` to 0.1.29
246246
- Upgraded dependency: `@aws/mynah-ui` from 4.15.11 to 4.18.0:
247247
- Inline code elements now wrap onto new lines
248248
- Send button no longer shifts out of the window when horizontally filling the prompt input without spaces (now it wraps)

chat-client/src/client/chat.test.ts

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,201 @@ describe('Chat', () => {
336336
// @ts-expect-error: accessing prototype method
337337
assert.notCalled(TabFactory.prototype.enableExport)
338338
}).timeout(20000)
339+
340+
it('enables MCP when params.mcpServers is true and config.agenticMode is true', function () {
341+
// Create a separate sandbox for this test
342+
const testSandbox = sinon.createSandbox()
343+
344+
// Save original window functions
345+
const originalAddEventListener = window.addEventListener
346+
const originalDispatchEvent = window.dispatchEvent
347+
348+
try {
349+
// Create a clean stub for this test
350+
const enableMcpStub = testSandbox.stub(TabFactory.prototype, 'enableMcp')
351+
const localClientApi = { postMessage: testSandbox.stub() }
352+
353+
// Mock the event handling to isolate this test
354+
let messageHandler: any
355+
window.addEventListener = (type: string, handler: any) => {
356+
if (type === 'message') {
357+
messageHandler = handler
358+
}
359+
return undefined as any
360+
}
361+
362+
// Create a new chat instance specifically for this test
363+
const localMynahUi = createChat(localClientApi, { agenticMode: true })
364+
365+
// Create a new event
366+
const chatOptionsRequest = createInboundEvent({
367+
command: CHAT_OPTIONS,
368+
params: {
369+
mcpServers: true,
370+
chatNotifications: [],
371+
},
372+
})
373+
374+
// Manually call the handler with our event
375+
if (messageHandler) {
376+
messageHandler(chatOptionsRequest)
377+
}
378+
379+
// Verify enableMcp was called exactly once
380+
assert.calledOnce(enableMcpStub)
381+
} finally {
382+
// Restore window functions
383+
window.addEventListener = originalAddEventListener
384+
window.dispatchEvent = originalDispatchEvent
385+
testSandbox.restore()
386+
}
387+
})
388+
389+
it('does not enable MCP when params.mcpServers is true but config.agenticMode is false', function () {
390+
// Create a separate sandbox for this test
391+
const testSandbox = sinon.createSandbox()
392+
393+
// Save original window functions
394+
const originalAddEventListener = window.addEventListener
395+
const originalDispatchEvent = window.dispatchEvent
396+
397+
try {
398+
// Create a clean stub for this test
399+
const enableMcpStub = testSandbox.stub(TabFactory.prototype, 'enableMcp')
400+
const localClientApi = { postMessage: testSandbox.stub() }
401+
402+
// Mock the event handling to isolate this test
403+
let messageHandler: any
404+
window.addEventListener = (type: string, handler: any) => {
405+
if (type === 'message') {
406+
messageHandler = handler
407+
}
408+
return undefined as any
409+
}
410+
411+
// Create a new chat instance specifically for this test
412+
const localMynahUi = createChat(localClientApi, { agenticMode: false })
413+
414+
// Create a new event
415+
const chatOptionsRequest = createInboundEvent({
416+
command: CHAT_OPTIONS,
417+
params: {
418+
mcpServers: true,
419+
chatNotifications: [],
420+
},
421+
})
422+
423+
// Manually call the handler with our event
424+
if (messageHandler) {
425+
messageHandler(chatOptionsRequest)
426+
}
427+
428+
// Verify enableMcp was not called
429+
assert.notCalled(enableMcpStub)
430+
} finally {
431+
// Restore window functions
432+
window.addEventListener = originalAddEventListener
433+
window.dispatchEvent = originalDispatchEvent
434+
testSandbox.restore()
435+
}
436+
})
437+
438+
it('does not enable MCP when params.mcpServers is false and config.agenticMode is true', function () {
439+
// Create a separate sandbox for this test
440+
const testSandbox = sinon.createSandbox()
441+
442+
// Save original window functions
443+
const originalAddEventListener = window.addEventListener
444+
const originalDispatchEvent = window.dispatchEvent
445+
446+
try {
447+
// Create a clean stub for this test
448+
const enableMcpStub = testSandbox.stub(TabFactory.prototype, 'enableMcp')
449+
const localClientApi = { postMessage: testSandbox.stub() }
450+
451+
// Mock the event handling to isolate this test
452+
let messageHandler: any
453+
window.addEventListener = (type: string, handler: any) => {
454+
if (type === 'message') {
455+
messageHandler = handler
456+
}
457+
return undefined as any
458+
}
459+
460+
// Create a new chat instance specifically for this test
461+
const localMynahUi = createChat(localClientApi, { agenticMode: true })
462+
463+
// Create a new event
464+
const chatOptionsRequest = createInboundEvent({
465+
command: CHAT_OPTIONS,
466+
params: {
467+
mcpServers: false,
468+
chatNotifications: [],
469+
},
470+
})
471+
472+
// Manually call the handler with our event
473+
if (messageHandler) {
474+
messageHandler(chatOptionsRequest)
475+
}
476+
477+
// Verify enableMcp was not called
478+
assert.notCalled(enableMcpStub)
479+
} finally {
480+
// Restore window functions
481+
window.addEventListener = originalAddEventListener
482+
window.dispatchEvent = originalDispatchEvent
483+
testSandbox.restore()
484+
}
485+
})
486+
487+
it('does not enable MCP when params.mcpServers is undefined and config.agenticMode is true', function () {
488+
// Create a separate sandbox for this test
489+
const testSandbox = sinon.createSandbox()
490+
491+
// Save original window functions
492+
const originalAddEventListener = window.addEventListener
493+
const originalDispatchEvent = window.dispatchEvent
494+
495+
try {
496+
// Create a clean stub for this test
497+
const enableMcpStub = testSandbox.stub(TabFactory.prototype, 'enableMcp')
498+
const localClientApi = { postMessage: testSandbox.stub() }
499+
500+
// Mock the event handling to isolate this test
501+
let messageHandler: any
502+
window.addEventListener = (type: string, handler: any) => {
503+
if (type === 'message') {
504+
messageHandler = handler
505+
}
506+
return undefined as any
507+
}
508+
509+
// Create a new chat instance specifically for this test
510+
const localMynahUi = createChat(localClientApi, { agenticMode: true })
511+
512+
// Create a new event
513+
const chatOptionsRequest = createInboundEvent({
514+
command: CHAT_OPTIONS,
515+
params: {
516+
chatNotifications: [],
517+
},
518+
})
519+
520+
// Manually call the handler with our event
521+
if (messageHandler) {
522+
messageHandler(chatOptionsRequest)
523+
}
524+
525+
// Verify enableMcp was not called
526+
assert.notCalled(enableMcpStub)
527+
} finally {
528+
// Restore window functions
529+
window.addEventListener = originalAddEventListener
530+
window.dispatchEvent = originalDispatchEvent
531+
testSandbox.restore()
532+
}
533+
})
339534
})
340535

341536
describe('onGetSerializedChat', () => {

chat-client/src/client/chat.ts

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,15 @@ import {
6262
InfoLinkClickParams,
6363
LINK_CLICK_NOTIFICATION_METHOD,
6464
LIST_CONVERSATIONS_REQUEST_METHOD,
65+
LIST_MCP_SERVERS_REQUEST_METHOD,
6566
LinkClickParams,
6667
ListConversationsParams,
6768
ListConversationsResult,
69+
ListMcpServersParams,
70+
ListMcpServersResult,
71+
MCP_SERVER_CLICK_REQUEST_METHOD,
72+
McpServerClickParams,
73+
McpServerClickResult,
6874
OPEN_TAB_REQUEST_METHOD,
6975
OpenTabParams,
7076
OpenTabResult,
@@ -162,9 +168,16 @@ export const createChat = (
162168
case CHAT_REQUEST_METHOD:
163169
mynahApi.addChatResponse(message.params, message.tabId, message.isPartialResult)
164170
break
165-
case CHAT_UPDATE_NOTIFICATION_METHOD:
166-
mynahApi.updateChat(message.params as ChatUpdateParams)
167-
break
171+
case CHAT_UPDATE_NOTIFICATION_METHOD: {
172+
const messageParams = message.params as ChatUpdateParams
173+
if (messageParams?.tabId === 'mcpserver') {
174+
mynahApi.mcpServerClick({ id: 'update-mcp-list' })
175+
break
176+
} else {
177+
mynahApi.updateChat(message.params as ChatUpdateParams)
178+
break
179+
}
180+
}
168181
case OPEN_TAB_REQUEST_METHOD:
169182
mynahApi.openTab(message.requestId, message.params as OpenTabParams)
170183
break
@@ -186,6 +199,12 @@ export const createChat = (
186199
case CONVERSATION_CLICK_REQUEST_METHOD:
187200
mynahApi.conversationClicked(message.params as ConversationClickResult)
188201
break
202+
case LIST_MCP_SERVERS_REQUEST_METHOD:
203+
mynahApi.listMcpServers(message.params as ListMcpServersResult)
204+
break
205+
case MCP_SERVER_CLICK_REQUEST_METHOD:
206+
mynahApi.mcpServerClick(message.params as McpServerClickResult)
207+
break
189208
case GET_SERIALIZED_CHAT_REQUEST_METHOD:
190209
mynahApi.getSerializedChat(message.requestId, message.params as GetSerializedChatParams)
191210
break
@@ -220,6 +239,10 @@ export const createChat = (
220239
tabFactory.updateQuickActionCommands(quickActionCommandGroups)
221240
}
222241

242+
if (params?.mcpServers && config?.agenticMode) {
243+
tabFactory.enableMcp()
244+
}
245+
223246
if (params?.history) {
224247
tabFactory.enableHistory()
225248
}
@@ -363,6 +386,12 @@ export const createChat = (
363386
conversationClick: (params: ConversationClickParams) => {
364387
sendMessageToClient({ command: CONVERSATION_CLICK_REQUEST_METHOD, params })
365388
},
389+
listMcpServers: (params: ListMcpServersParams) => {
390+
sendMessageToClient({ command: LIST_MCP_SERVERS_REQUEST_METHOD, params })
391+
},
392+
mcpServerClick: function (params: McpServerClickParams): void {
393+
sendMessageToClient({ command: MCP_SERVER_CLICK_REQUEST_METHOD, params })
394+
},
366395
tabBarAction: (params: TabBarActionParams) => {
367396
sendMessageToClient({ command: TAB_BAR_ACTION_REQUEST_METHOD, params })
368397
},

0 commit comments

Comments
 (0)