MCPcopy Create free account
hub / github.com/esengine/esengine / uninstall

Method uninstall

packages/core/src/Core/PluginManager.ts:123–145  ·  view source on GitHub ↗

* 卸载插件 * * @param name - 插件名称 * @throws 如果插件未安装或卸载失败

(name: string)

Source from the content-addressed store, hash-verified

121 * @throws 如果插件未安装或卸载失败
122 */
123 public async uninstall(name: string): Promise<void> {
124 const plugin = this._plugins.get(name);
125 if (!plugin) {
126 throw new Error(`Plugin ${name} is not installed`);
127 }
128
129 // 检查是否有其他插件依赖此插件
130 this._checkDependents(name);
131
132 try {
133 logger.info(`Uninstalling plugin: ${name}`);
134 await plugin.uninstall();
135
136 // 从注册表中移除
137 this._plugins.delete(name);
138 this._metadata.delete(name);
139
140 logger.info(`Plugin ${name} uninstalled successfully`);
141 } catch (error) {
142 logger.error(`Failed to uninstall plugin ${name}:`, error);
143 throw error;
144 }
145 }
146
147 /**
148 * 获取插件实例

Callers

nothing calls this directly

Calls 6

_checkDependentsMethod · 0.95
getMethod · 0.65
uninstallMethod · 0.65
deleteMethod · 0.65
infoMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected