MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / reload

Method reload

packages/agent-core/src/plugin/manager.ts:183–201  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

181 }
182
183 async reload(): Promise<ReloadSummary> {
184 const prevIds = new Set(this.records.keys());
185 const file = await readInstalled(this.kimiHomeDir);
186 const next = new Map<string, PluginRecord>();
187 const errors: Array<{ id: string; message: string }> = [];
188 for (const entry of file.plugins) {
189 try {
190 next.set(entry.id, await this.materialize(entry));
191 } catch (error) {
192 errors.push({ id: entry.id, message: (error as Error).message });
193 }
194 }
195 const added: string[] = [];
196 for (const id of next.keys()) if (!prevIds.has(id)) added.push(id);
197 const removed: string[] = [];
198 for (const id of prevIds) if (!next.has(id)) removed.push(id);
199 this.records = next;
200 return { added, removed, errors };
201 }
202
203 pluginSkillRoots(): readonly SkillRoot[] {
204 const roots: SkillRoot[] = [];

Callers 2

manager.test.tsFile · 0.80
reloadPluginsMethod · 0.80

Calls 6

materializeMethod · 0.95
readInstalledFunction · 0.90
keysMethod · 0.80
setMethod · 0.65
hasMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected