/** * The team's membership requests, answered: joining and leaving. * * `board` and `team` sit above the bus: `/board`, `/team join`, a card write and `/team exit` all ask * this session's membership to change, and none of them may import this extension. A *tool* context * could reach the `session` tool and an `ExtensionCommandContext` cannot — the same limit * `lib/mode-entry.ts` works around for plan mode — so the ask travels on `pi.events` and this module * answers it with the runtime's own `join` and `leave`. * * One module for both doors because they are one subject and one direction, and because a second * module is a start the `session-bus` entry pays for: `test/dependencies.test.ts` holds its static * graph to a row that may only fall. The two answers differ in one fact, and it is the reason they * are written apart rather than as one call: a join starts the bus when it is not up, and a leave does * not — a start mints the record, and a person asking to leave must not be joined by the act of * leaving. * * The answer always comes: every path here returns a result, including a failure, so a caller never * waits on a listener that threw. A caller that asks for `name` also gets Pi's session name, because * `/team join