Skip to content

fix(sqlite): load node:sqlite in ESM runtime#104

Merged
iamtoruk merged 1 commit intogetagentseal:mainfrom
aaronflorey:fix/opencode-sqlite-esm-loader
Apr 19, 2026
Merged

fix(sqlite): load node:sqlite in ESM runtime#104
iamtoruk merged 1 commit intogetagentseal:mainfrom
aaronflorey:fix/opencode-sqlite-esm-loader

Conversation

@aaronflorey
Copy link
Copy Markdown

Summary

  • replace eval-based SQLite loader with createRequire(import.meta.url) in src/sqlite.ts
  • fix OpenCode/Cursor provider discovery when CLI runs in ESM and require is unavailable
  • keep change minimal to avoid affecting provider parsing behavior

Verification

  • npm run dev -- report
  • npm run dev -- today
  • npm test -- tests/providers/opencode.test.ts tests/provider-registry.test.ts

Replace eval-based require with createRequire(import.meta.url) so the SQLite driver loads correctly when the CLI runs as ESM.

This restores OpenCode and Cursor session discovery instead of returning empty results when require is unavailable.
@iamtoruk iamtoruk merged commit 64aae10 into getagentseal:main Apr 19, 2026
2 checks passed
@iamtoruk
Copy link
Copy Markdown
Member

Merged, thanks! Clean surgical fix. Verified locally: 238 tests pass, esbuild direct-eval warning gone, isolated ESM repro confirms createRequire works where eval('require') threw ReferenceError.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants