aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-cli/src/meshbay_cli/tui/app.py
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-10-15 02:06:35 +0200
committerChristophe Besson <cbesson@gmail.com>2026-10-15 02:06:35 +0200
commit419af660eeb8a4403e37a63c54a15586d04d5a8e (patch)
treeb0c0cdd831a5fb2864d5bedf581681aa0ec86023 /packages/meshbay-cli/src/meshbay_cli/tui/app.py
parent47583c5e405f3011a526df73cc9485c46598f214 (diff)
downloadmeshbay-419af660eeb8a4403e37a63c54a15586d04d5a8e.tar.gz
feat(cli): chat — Tier 2 check on the signing device, interactive room
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 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-cli/src/meshbay_cli/tui/app.py')
-rw-r--r--packages/meshbay-cli/src/meshbay_cli/tui/app.py15
1 files changed, 9 insertions, 6 deletions
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