ES modules hoist all static imports before any code executes, so
matrix-bot-sdk was loaded BEFORE ensureNativeBinary() could download
the native binary. Using dynamic imports inside runPlugin ensures
the binary is downloaded first.
Add bootstrap-native.ts that downloads @matrix-org/matrix-sdk-crypto-nodejs
native binary before loading matrix-bot-sdk. This is needed because
opencode's npm doesn't run postinstall scripts, and the binary is required
for the Matrix SDK to work.
- Set noEmit to false in tsconfig.json
- Change main entry point from index.ts to dist/index.js
- Add files field to package.json
- Pre-compile TypeScript to JavaScript