(context = {})
| 296 | |
| 297 | // Run all plugin init handlers. Called once at startup after loadAll(). |
| 298 | async runInit(context = {}) { |
| 299 | for (const { handler, plugin } of this.initHandlers) { |
| 300 | try { |
| 301 | await handler(context); |
| 302 | } catch (e) { |
| 303 | console.error(`[plugin:${plugin}] init failed: ${e.message}`); |
| 304 | } |
| 305 | } |
| 306 | } |
| 307 | |
| 308 | // Run all plugin shutdown handlers. Called on exit for cleanup. |
| 309 | async runShutdown(context = {}) { |