agentlytics 0.2.9 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +22 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -196,6 +196,28 @@ if (!collectOnly && !isUiDev && !fs.existsSync(publicIndex)) {
196
196
  process.exit(1);
197
197
  }
198
198
 
199
+ // ── Ensure better-sqlite3 native bindings exist ─────────────
200
+ try {
201
+ require('better-sqlite3');
202
+ } catch (e) {
203
+ if (e.message && e.message.includes('Could not locate the bindings file')) {
204
+ console.log(chalk.cyan(' ⟳ Rebuilding native SQLite module...'));
205
+ try {
206
+ const bsqlDir = path.dirname(require.resolve('better-sqlite3/package.json'));
207
+ execSync('npx --yes prebuild-install -r napi || npx --yes node-gyp rebuild --release', {
208
+ cwd: bsqlDir, stdio: 'pipe', timeout: 120000,
209
+ });
210
+ console.log(chalk.green(' ✓ Native module rebuilt'));
211
+ } catch (rebuildErr) {
212
+ console.error(chalk.red(' ✗ Failed to rebuild better-sqlite3:'), rebuildErr.message);
213
+ console.error(chalk.dim(' Try: npm install better-sqlite3 --build-from-source'));
214
+ process.exit(1);
215
+ }
216
+ } else {
217
+ throw e;
218
+ }
219
+ }
220
+
199
221
  const cache = require('./cache');
200
222
 
201
223
  // Wipe cache if --no-cache flag is passed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentlytics",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "description": "Comprehensive analytics dashboard for AI coding agents — Cursor, Windsurf, Claude Code, VS Code Copilot, Zed, Antigravity, OpenCode, Command Code",
5
5
  "main": "index.js",
6
6
  "bin": {