mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-05 08:10:14 +00:00
chore(marketplace): invoke to reload modes and mcps
This commit is contained in:
parent
fbd0297d32
commit
e1a0e659be
3 changed files with 17 additions and 4 deletions
|
|
@ -308,7 +308,7 @@ export class CustomModesManager {
|
|||
await fs.writeFile(filePath, yaml.stringify(settings), "utf-8")
|
||||
}
|
||||
|
||||
private async refreshMergedState(): Promise<void> {
|
||||
public async refreshMergedState(): Promise<void> {
|
||||
const settingsPath = await this.getCustomModesFilePath()
|
||||
const roomodesPath = await this.getWorkspaceRoomodes()
|
||||
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ export async function handleMarketplaceMessages(
|
|||
try {
|
||||
await marketplaceManager
|
||||
.installMarketplaceItem(message.mpItem, message.mpInstallOptions)
|
||||
.then(async (r) => r === "$COMMIT" && (await provider.postStateToWebview()))
|
||||
.then(async (r) => r === "$COMMIT" && (await _onCommit()))
|
||||
} catch (error) {
|
||||
vscode.window.showErrorMessage(
|
||||
`Failed to install item "${message.mpItem.name}":\n${error instanceof Error ? error.message : String(error)}`,
|
||||
|
|
@ -263,7 +263,7 @@ export async function handleMarketplaceMessages(
|
|||
try {
|
||||
await marketplaceManager
|
||||
.installMarketplaceItem(item, { parameters })
|
||||
.then(async (r) => r === "$COMMIT" && (await provider.postStateToWebview()))
|
||||
.then(async (r) => r === "$COMMIT" && (await _onCommit()))
|
||||
} catch (error) {
|
||||
console.error(`Error submitting marketplace parameters: ${error}`)
|
||||
vscode.window.showErrorMessage(
|
||||
|
|
@ -287,7 +287,7 @@ export async function handleMarketplaceMessages(
|
|||
try {
|
||||
await marketplaceManager
|
||||
.removeInstalledMarketplaceItem(message.mpItem, message.mpInstallOptions)
|
||||
.then(async (r) => r === "$COMMIT" && (await provider.postStateToWebview()))
|
||||
.then(async (r) => r === "$COMMIT" && (await _onCommit()))
|
||||
} catch (error) {
|
||||
vscode.window.showErrorMessage(
|
||||
`Failed to remove item "${message.mpItem.name}":\n${error instanceof Error ? error.message : String(error)}`,
|
||||
|
|
@ -302,4 +302,12 @@ export async function handleMarketplaceMessages(
|
|||
default:
|
||||
return false
|
||||
}
|
||||
|
||||
async function _onCommit() {
|
||||
await Promise.all([
|
||||
provider.getMcpHub()?.reloadMcpServers?.(),
|
||||
provider.customModesManager?.refreshMergedState?.(),
|
||||
provider.postStateToWebview(),
|
||||
])
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -353,6 +353,11 @@ export class McpHub {
|
|||
)
|
||||
}
|
||||
|
||||
public async reloadMcpServers() {
|
||||
await this.initializeProjectMcpServers()
|
||||
await this.initializeGlobalMcpServers()
|
||||
}
|
||||
|
||||
private async initializeMcpServers(source: "global" | "project"): Promise<void> {
|
||||
try {
|
||||
const configPath =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue