Skip to content

v2.0.0 - BREAKING: v2 dual support

Choose a tag to compare

@smapira smapira released this 03 Sep 11:32
· 41 commits to main since this release
Immutable release. Only release title and notes can be modified.

BREAKING: v2 dual support

This release adds dual V1/V2 compatibility for opencode-autopilot-logbook.

BREAKING

  • V2 Plugin API: DailyLogbookPlugin (V1) kept, plus Plugin.define({ id: "smapira.daily-logbook", setup(ctx) }) for V2. See daily-logbook.ts API table for event.data.sessionID vs properties, ctx.session.get({sessionID}) vs path:{id}, ctx.app.log → console.
    • ctx.app.log does not exist in V2 (ctx.app is {name,version,channel} only) → replaced with console.warn/error via AppLogSink
    • ctx.location.directory replaces directory
    • promise subscribe({signal}) => AsyncIterable vs effect subscribe(type):Stream

Added

  • DailyLogbookPluginV2 + handleV2IdleEvent (testable extraction). Falls back to plain object on stable 1.18.x so bun test stays green; Plugin.define on @opencode-ai/plugin@beta.
  • AppLogSink abstraction, 4 new V2 tests (85 pass total), 25.40KB bundle

Changed

  • package.json stays on ^1.0.0 on main; switch to beta on beta branch: npm i -D @opencode-ai/plugin@beta + npx opencode@beta
  • README: new ## Compatibility section (V1 stable / V2 beta dual support) with plugins: [{ package }] example
  • .gitignore: keep dist/index.js tracked for npm publish

Migration

npm i -D @opencode-ai/plugin@beta  # beta branch only
npx opencode@beta --version
opencode --standalone  # beta
# opencode.json: { "plugins": [{ "package": "opencode-autopilot-logbook" }] }

See CHANGELOG.md and documents/plans/dev/20260903_v2-compat.md for full migration notes. During beta the V2 API may still break.

Full Changelog: v1.2.0...v2.0.0