/** * Widget client: the entry point for widgets that live in other extensions or packages. * * import { registerWidget } from "pi-chassis/client"; * * registerWidget(pi, { id: "git", render: () => ({ text: "main ●2" }) }); * * Same spec and handle as api.ts, but it never loads the registry code: it only looks for the * host on globalThis (the Symbol.for keys below), so it works whichever extension loads first * and it works without chassis installed: * * - chassis already loaded: the widget is registered with it straight away. * - chassis loads later: the widget is queued and chassis registers it when it loads. * - chassis is not installed (checked at session_start, when every extension has loaded): the * widget falls back to ctx.ui.setStatus(id, "