Repository navigation
v2.0.1 - fix beta ESM-only detection
·
39 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
Fixed
-
beta ESM-only:
@opencode-ai/plugin@betais ESM-only (exports "."has onlyimport), sorequire("@opencode-ai/plugin")fails withNo "exports" main definedanddefaultfell back to V1 even on beta. AddedisBetaPluginAvailable()that checkspackage.jsonversion viafileURLToPath(import.meta.url)+existsSync/readFileSync(candidates:dist/../node_modules,../../node_modules,cwd/node_modules) — ifversionincludesbeta→ return V2. Fallback tocreateRequirefor stable CJS. -
tryCreateV2Pluginnow documents ESM fallback plain object is accepted by beta host (Plugin.defineis identity).
E2E (beta)
npx @opencode-ai/cli@beta --version→opencode2 v0.0.0-beta-18999handleV2IdleEvent(flatget/context/create/prompt,ctx.location.directory,consolesink) andv2Setup(ctx.event.subscribe({signal}) => AsyncIterable+event.data.sessionID) verified via mockctx(seebun /tmp/beta-e2e-v2setup.mjs— both PASS)bun test85 pass on stable1.18.27(^1.0.0),dist 26.50 KBdefaultisV2 (smapira.daily-logbook)on beta,V1 functionon stable — verified viabun /tmp/test-v2.mjs
Full Changelog: v2.0.0...v2.0.1