ES modules evaluate ALL static imports before any code executes. ensureNativeBinary() was called but matrix-bot-sdk was already loaded by the time it ran. Solution: all imports are now dynamic (await import()). The setup function calls ensureNativeBinary() first, then dynamically loads everything else including matrix-bot-sdk transitively. Changes: - Remove all static imports from index.ts - Move ensureNativeBinary() into async setup() - Pass log/logError as parameters to runPlugin - Make parseCodeModeTools async for dynamic acorn imports - Add import type for MatrixEventContext (erased at compile time) |
||
|---|---|---|
| .. | ||
| bootstrap-native.js | ||
| config-loader.js | ||
| index.js | ||
| logger.js | ||
| matrix-client.js | ||
| session-manager.js | ||
| types.js | ||