mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-10-03 16:01:59 +00:00
OpenCode 2.x only loads a default export shaped { id, setup | effect } and
rejects the file otherwise ("Plugin must export a default definition with
an id and an effect or setup function"). The generated tty7.js only had a
named export, so every 2.x user got a load error.
- Export default { id, server, setup }: 1.x (>= 1.3.4) reads `server`,
2.x reads `setup`; the named Tty7Presence export stays for older 1.x.
- 2.x: subscribe via ctx.event.subscribe(), read event.data, map
permission.asked, and treat session.created with a parentID as a child
session. Stay inert inside the shared --service process, whose sessions
belong to no single pane.
- Spawn the emitter directly with node:child_process instead of
`sh -c`, which does not exist on Windows.