Automatic Sync: Merge changes from stable/ballerina to main - #2392
Automatic Sync: Merge changes from stable/ballerina to main#2392choreo-cicd wants to merge 185 commits into
Conversation
- Spawn MCP clients per server config in ~/.ballerina/copilot/mcp.json (stdio and Streamable HTTP) - Bridge MCP tools into the agent's tool registry as mcp__<server>__<tool> - File watcher and per-turn refresh pick up config edits without restart - MCP chip in the AI chat input with per-server enable toggle, reload, and Edit config - Stream view renders mcp__ tool calls with the plug icon and prettified label - New RPC endpoints: listMcpServers, setMcpServerEnabled, openMcpConfig, mcpServersChanged
- New AddMcpServerModal: name, stdio (command + args) or HTTP (URL + Bearer) - + Add server button in the MCP popover header opens the form - addMcpServer RPC: validates name regex + uniqueness, writes the entry to ~/.ballerina/copilot/mcp.json atomically, refreshes the manager, and pushes mcpServersChanged - writeMcpServer helper reads the latest file before mutating so external edits are preserved
- Per-workspace mcp.json lives at ~/.ballerina/copilot/workspaces/<hash>/mcp.json, sharing computeWorkspaceHash with chat-persistence - McpClientManager keys state by scope:name so user-scope and workspace-scope servers with the same name are independent; workspace shadows user in the agent registry - configLoader gains workspaceMcpConfigPath, scope-aware writeMcpServer, dual-file watcher, and a flat scoped-entries return shape - Activator captures resolveProjectRootPath at setupMcp and passes it into initMcpClientManager + watchMcpConfig - listMcpServers DTO carries scope and a shadowed flag; setMcpServerEnabled/addMcpServer/openMcpConfig now take scope; new getMcpWorkspaceContext RPC tells the webview whether a workspace is open - Chip popover shows a scope badge per row, splits Edit config into Edit user / Edit workspace, and disables the workspace button when no workspace is open - Add server modal: scope segmented control at the top (defaults to Workspace when available); uniqueness check is now scoped
- Project-scope config now lives at <workspacePath>/.mcp.json in the user's repo, matching the Claude Code / Cline / Continue convention so the same file works across MCP-aware tools - Drop the system-tree path (~/.ballerina/copilot/workspaces/<hash>/mcp.json) and the computeWorkspaceHash dependency for MCP - Require vscode.workspace.isTrusted before loading project-scope entries; untrusted workspaces fall back to user scope only - Listen for onDidGrantWorkspaceTrust and refresh the manager mid-session so granting trust brings workspace servers online without a reload - RPC addMcpServer + openMcpConfig reject workspace scope when not trusted; getMcpWorkspaceContext returns hasWorkspace=false until trust is granted
User-facing strings now say Project instead of Workspace. Internal type McpScope = 'user' | 'workspace' is unchanged so the existing config files, override-store keys, and RPC payloads stay compatible. - Chip popover: scope badge shows User / Project; button is now Edit project; shadowed-by hint and tooltips updated. - Add server modal: tab label is now Project; hint and uniqueness error use the project wording. - RPC errors and warnings for missing or untrusted workspace use project terminology and point users at VS Code's workspace trust prompt.
The same extension ships in WSO2 Integrator (a VS Code fork) and vanilla VS Code, so user-facing copy should stay IDE-neutral. Refer to the workspace trust prompt by name only.
- New McpManagerPanel: full settings-style page (back arrow + title + + Add + global toggle in header), built-in / project / user sections, server cards with status / scope badge / transport / tool count, collapsible Tools list with names + descriptions, per-server toggle, Edit and Delete actions with inline confirm - New backend RPCs: updateMcpServer, deleteMcpServer (atomic JSON writes) and setMcpToolsEnabled (toggles the ballerina.ai.enableMcpTools setting; the existing onDidChangeConfiguration listener picks up the change) - Popover redesign: sticky header with global toggle / reload / Manage; scrollable body capped at 360px; servers sorted by scope (Project then User) with a thin divider between groups, no per-row scope badge; off-state shows a clear placeholder; drops the in-popover Add / Edit-JSON buttons in favour of the Manager - Chip is now always rendered; the mcpToolsEnabled prop drives the disabled visual state and gates the popover body - AddMcpServerModal extended with an editTarget prop: when set, title becomes Edit, name and scope are locked, fields pre-fill from the target, and submit calls updateMcpServer
- Use the inputOption-activeBackground token for all toggle on-tracks (popover, manager card, manager header) — softer than the primary button blue, matches VS Code's editor-search active toggles; thin border for definition on light themes - Drop the redundant USER/PROJECT badge from manager cards; the section header already groups them - Popover: small uppercase Project / User labels above each populated group, replacing the unlabelled divider; empty groups omit the label entirely - Manager: hide empty sections (built-in registry stays empty so its section disappears); centered empty state when no servers are configured; the off-state hint stays as-is - Replace each section's Edit JSON text link with an icon button (codicon go-to-file) styled with the ui-toolkit Button appearance=icon — matches VS Code's Open Settings (JSON) affordance
Drop the specific reference-server name from the args placeholder and broaden the command placeholder beyond npx so the form doesn't bias toward any single ecosystem (npm vs Python uvx vs direct binaries).
Edit MCP server now round-trips the full saved config instead of opening with empty fields and wiping env vars / headers on save. - McpServerStatusDTO now carries the raw config; McpClientManager.listServers normalises the internal McpServerConfig (sets type, drops the disabled flag) before emitting - McpManagerPanel.handleEdit passes the real config straight to the dialog - AddMcpServerModal: - Arguments is now a multi-line textarea (one arg per line), so paths with spaces survive - Stdio: full Environment variables editor (key/value rows with + Add and per-row trash) - HTTP: full Headers editor (replaces the dedicated Bearer field; Authorization is just another row, hint line spells out the Bearer convention) - Edit pre-fills command, args, env, url, headers from the saved config (env/headers sorted by key for stability) - Save builds the config from form state, dropping empty key rows
Small inline badge for marking pre-GA UI surfaces. Uses VS Code's statusBarItem warning tokens so the warning hue picks up the theme. Lives under views/AIPanel/components/ to keep new AI-panel work isolated from other visualizer code.
Drops the new ExperimentalTag badge into both surfaces next to their title. The tag carries a tooltip explaining the experimental status so users register that the feature may change.
When a user's mcp.json or project .mcp.json has invalid JSON or a missing mcpServers key, configLoader now returns the error per scope alongside the entries instead of swallowing it. McpClientManager caches the latest errors; a new getMcpLoadErrors RPC and mcpLoadErrorsChanged notification surface them to the webview.
Both the chip popover and the MCP Manager panel now subscribe to mcpLoadErrorsChanged and surface a clickable warning row when the user or project mcp.json couldn't be read. Clicking the banner opens the offending file in an editor tab so the user can fix the JSON in place; the watcher clears the banner as soon as the file parses cleanly again.
Project-tree config sits inside the open workspace, so the editor's OS-event-based createFileSystemWatcher is the idiomatic choice — no polling needed. The user-global file lives outside any workspace and stays on fs.watchFile (the only API that works for that path); the polling interval is bumped to 3s since 1.5s was overkill.
- Extract Primary/Secondary/Danger/Success action button variants into shared AIPanel styles - Switch SettingsPanel Authorize/Authorized/Sign out to the shared variants - Switch McpManagerPanel Add server, Edit, Delete, Cancel to the shared variants - Move global toggle next to title with a divider before action group - Reorder header actions to reload then Add server - Add reload icon button to McpManagerPanel header
- Block variant replaces empty-state cards while data is loading - Inline variant fits inside chip popovers or action rows
- Show Loader while MCP servers boot after toggle on or initial mount - 8s safety timeout clears the loader if no notification arrives - Right-align the delete confirm row to match the resting action layout
- Add codicon-symbol-method leading each tool name - Wrap rows in a bordered container with hover background and row separators - Clamp descriptions to two lines with full text revealed on row hover
- Lift per-server toggle from the action row into the card header, anchored on the right - Reduce the action row to Edit and Delete only - Make Project and User section headers clickable to toggle expand/collapse
- Skip the Map delete on a pure enable to disable transition - Only delete entries on config disappearance or config change
- Swap the per-server toggle for a fixed-size spinner while the RPC is in flight - Ignore extra clicks on a server whose toggle is already pending - Clear pending keys when a fresh server list notification arrives
- Introduce a group override stored alongside per-server overrides - AND the group flag with each server's intent to drive actual MCP connections - Surface a group toggle in each section header with spinner and click guard - Disable per-server toggles when the group is off in both manager and popover - Show a Disabled badge next to popover group labels with a manage-panel hint
Lets users open the Manager panel and flip the global toggle from there instead of forcing them to find the inline toggle in the popover header.
- Extend the override store with delete and keys methods - Drop the server override when an MCP server is deleted - Prune orphan server overrides at extension activation, leaving group keys intact
Fix Create Types from Scratch flakiness on slow runners
Reverts the label change from #2234 ("Login using WSO2 Cloud") back to "Login using WSO2 Integration Platform". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Improve quota exceed error message
Update login button to "Login using WSO2 Integration Platform"
Fix trivy vulnerability issue
Fix the blueChip rendering issue for the rc1
Fix the trivy vulnerability
Fix vulnerability
Fix e2e tests with the vscode update
Fix vulnerabilities
Revert "Fix vulnerabilities"
Change Copilot quota contact email to support@wso2.com
Merge "ballerina-5.12.2" into "stable/ballerina"
|
Important Review skippedToo many files! This PR contains 199 files, which is 49 over the limit of 150. To get a review, narrow the scope: Upgrade to a paid plan to raise the limit. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (7)
📒 Files selected for processing (199)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
This PR syncs changes from stable/ballerina to the main branch.
Automated PR created by GitHub Actions.