From 419af660eeb8a4403e37a63c54a15586d04d5a8e Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Thu, 15 Oct 2026 02:06:35 +0200 Subject: feat(cli): chat — Tier 2 check on the signing device, interactive room MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each message's signing device is checked against the group's roster as the page checks it (a port of transport-roster.js, held to it by the parity test): chains of countersignatures walked from each account's roots, the keys accepted per account and node kept in the store, the roster read again once before a key is called changed. Only "changed" is said, under the message; --json carries every verdict. chat with no group opens the interactive chat: the groups, then one group's conversation IRC-style with pushed messages arriving live and a line to write in; Esc or /part goes back to the groups, /quit or Ctrl+Q quits. Like the bare command, it opens on the sign-in screen when nothing is stored. Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-cli/src/meshbay_cli/tui/app.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'packages/meshbay-cli/src/meshbay_cli/tui/app.py') diff --git a/packages/meshbay-cli/src/meshbay_cli/tui/app.py b/packages/meshbay-cli/src/meshbay_cli/tui/app.py index dbb773c..fe7fa2c 100644 --- a/packages/meshbay-cli/src/meshbay_cli/tui/app.py +++ b/packages/meshbay-cli/src/meshbay_cli/tui/app.py @@ -3,7 +3,8 @@ Textual, because it runs on the same asyncio loop as aiortc and httpx rather than beside them, and on Linux terminals and Windows' consoles alike. Signed in -already, it opens on the two panes; otherwise on the sign-in screen first. +already, it opens on the two panes — or, for `meshbay-cli chat` with no group, +on the groups to chat in (`tui/chat.py`); otherwise on the sign-in screen first. Nothing is printed while it runs — a line on stderr would tear the screen — so the log goes to a file in the CLI's data directory instead. @@ -24,10 +25,12 @@ from .screens import DeviceCode, MainScreen, SignInScreen class MeshBayApp(App): TITLE = "MeshBay" - def __init__(self, ctx: Context): + def __init__(self, ctx: Context, home=MainScreen): super().__init__() self.ctx = ctx self.hub = ctx.hub + # The screen a signed-in account lands on, made from the account. + self.home = home async def use_hub(self, url: str) -> None: if url != self.hub.url: @@ -51,9 +54,9 @@ class MeshBayApp(App): def start(self, account: Account) -> None: account.on_device_code = DeviceCode(self) if isinstance(self.screen, SignInScreen): - self.switch_screen(MainScreen(account)) + self.switch_screen(self.home(account)) else: - self.push_screen(MainScreen(account)) + self.push_screen(self.home(account)) def _log_to_file() -> None: @@ -70,7 +73,7 @@ def _log_to_file() -> None: root.addHandler(handler) -async def run_interactive(ctx: Context) -> int: +async def run_interactive(ctx: Context, home=MainScreen) -> int: _log_to_file() - await MeshBayApp(ctx).run_async() + await MeshBayApp(ctx, home).run_async() return 0 -- cgit v1.2.3