- keep the `server(ctx)` entry that OpenCode 1.18.x dispatches hooks from
- fill `setup(ctx)` with the V2 hook registrations (execute.after,
compaction) and fail open per domain, so one unavailable registration
neither breaks the host nor disables the other
- prefer `content` over `output` in appendResult and return the result
unchanged when no text surface exists, so a tool's own output is never
hidden
- persist the post-compaction note as a keyed session instruction
(`codebase-memory-session-note`) that survives compaction instead of
editing the system prompt; hosts without that channel skip reinjection
- resolve each session's directory with ctx.session.get (cached), because
ctx.location is the plugin instance's location, not the session's
- update the #2089 emission test in place to state the 2.x contract
Fixes#2204
Refs #2077#2089
Signed-off-by: HazielMagallanes <contactame.haziel@gmail.com>