()
| 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[] = []; |
no test coverage detected