From adda9613fad48a68239e2dbd93321818a835c286 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Thu, 15 Oct 2026 02:22:05 +0200 Subject: feat(cli): chat --follow chat GROUP --follow prints the last messages, then each one the node pushes, until Ctrl+C (exit 130). The connection is pinged every half minute; one that closes, fails or stops answering is opened again, and what was said meanwhile is read from the history. Each message is printed once, by its (device, nonce) pair, which the node stores once. With --json, one object per line. The man page lists it, with an example, and its FILES now names the device keys kept for the Tier 2 check. Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-cli/tests/fake_node.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'packages/meshbay-cli/tests/fake_node.py') diff --git a/packages/meshbay-cli/tests/fake_node.py b/packages/meshbay-cli/tests/fake_node.py index 8f4356b..b4e64ff 100644 --- a/packages/meshbay-cli/tests/fake_node.py +++ b/packages/meshbay-cli/tests/fake_node.py @@ -76,6 +76,7 @@ class FakeNode: "pk_x25519": self.identity.pk_x, "added_by_pk": "", "add_sig": "", "add_nonce": "", "add_ts": 0}] self.members: dict[str, Identity] = {} # sender → the device it signs with + self.unresponsive = False # pings go unanswered, as a dead link's self.admin_ops: dict[str, dict] = {} def add(self, path: str, name: str, data: bytes, uploader_id: str = "") -> dict: @@ -273,6 +274,11 @@ class FakeChannel: return {"type": "chat_keys_resp", "group_id": GROUP_ID, **seal(n.gek, PURPOSE_CHAT_KEYS, "chat_keys_resp", GROUP_ID, payload)} + def _ping(self, msg): + if self.node.unresponsive: + return {"type": "error", "detail": "no answer"} + return {"type": "pong", "token": msg.get("token")} + def _group_roster_req(self, msg): n = self.node return {"type": "group_roster_resp", "group_id": GROUP_ID, -- cgit v1.2.3