feat(remote-shell): PTY-over-mesh terminal with retro-CRT UI#5131
Draft
jamesarich wants to merge 4 commits intomainfrom
Draft
feat(remote-shell): PTY-over-mesh terminal with retro-CRT UI#5131jamesarich wants to merge 4 commits intomainfrom
jamesarich wants to merge 4 commits intomainfrom
Conversation
fc908ed to
07c2a42
Compare
Contributor
|
I did a bit of a refactor, to get rid of the ugly stuffing values into payload. Much happier with the Firmware source now. Should be pretty straightforward to update. Looking forward to playing with the Android support. |
2f89b6b to
5278226
Compare
Collaborator
Author
Pushed up this change as well, just needs the fresh proto fields (not yet in the protobufs repo). |
Adds a full RemoteShell (portnum=13) implementation matching Jonathan's dmshell_client.py protocol: Protocol layer: - Seq/ack reliability: incrementing seq on every non-ACK frame, piggybacked ack_seq, out-of-order frame buffering, gap detection and replay requests - TX history ring buffer (last 50 frames) for retransmission on request - ACK frames carry optional 4-byte big-endian REPLAY_REQUEST payload - PING/PONG heartbeat with 8-byte status payload (lastTxSeq, lastRxSeq); PONG handler triggers replay if peer is behind - PKI: DataPacket.PKC_CHANNEL_INDEX so CommandSenderImpl applies Curve25519 encryption (firmware rejects non-PKI DMShell packets) - Input batching: 500ms debounce (matches Python client), immediate flush on \r, \t, buffer-full (64 bytes), or Enter Terminal UI: - Retro-CRT composables: TerminalCanvas (phosphor glow, two-pass bloom), ScanlinesOverlay, FlickerEffect (animated brightness variation), CrtCurvatureModifier (AGSL barrel distortion on Android 12+, no-op on JVM) - PhosphorPreset enum: GREEN (P1), AMBER (P3), WHITE (P4) - Pending-input rendered inline in preset.dim colour; snaps to confirmed on flush - Hidden zero-size BasicTextField captures soft and hardware keyboard input - Phosphor colour picker dropdown in top bar Capabilities gate: - supportsRemoteShell gated to UNRELEASED (9.9.9) - Entry only visible in AdministrationSection when node.capabilities.supportsRemoteShell
…ures - Import kotlin.concurrent.Volatile instead of JVM-auto-resolved variant - Replace synchronized() with Mutex.withLock for KMP compatibility - Replace String.format() with DataPacket.nodeNumToDefaultId() - Add iosMain actual for CrtCurvatureModifier (no-op stub) - Extract magic numbers to named constants (UINT32_BYTES, MAX_FLUSH_WINDOW_MS, CRT_STRENGTH_SCALE) - Add detekt suppressions for protocol-inherent complexity - Remove unnecessary safe calls on non-nullable Wire proto fields - Fix spotless formatting in RemoteShellHandler.kt Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Align with firmware refactor (meshtastic/firmware#10123) and protobufs PR meshtastic/protobufs#894 which adds last_tx_seq and last_rx_seq fields to the RemoteShell message. - ACK: use last_rx_seq proto field instead of encoding replay-from seq into payload bytes - PING: use last_tx_seq/last_rx_seq proto fields instead of encoding heartbeat status as 8-byte payload - PONG: read last_tx_seq/last_rx_seq from proto fields instead of decoding payload - SentFrame: store flags/lastTxSeq/lastRxSeq for faithful replay - Remove unused encodeUint32BE, encodeHeartbeatStatus, decodeHeartbeatStatus helpers and associated constants Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
5278226 to
97efcca
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
REMOTE_SHELL_APP = 13) implementing PTY-over-mesh with a retro-CRT UIdmshell_client.pyfrom firmware PR RemoteShell SSH-like experience over PKI firmware#10123 — reliability layer with seq/ack, single-frame replay, PING/PONG heartbeat, PKI-only encryptionlast_tx_seq/last_rx_seq) for replay and heartbeat metadata per Jonathan's firmware refactor and Add two more RemoteShell fields protobufs#894UNRELEASED(9.9.9) inCapabilities.kt— no user impact until firmware shipsWhat's included
Terminal UI (
feature/node/.../terminal/)BasicTextFieldfor raw keyboard capture (always focused), phosphor colour pickerProtocol (
RemoteShellViewModel)last_tx_seq/last_rx_seqproto fields for gap detection and replay triggerslast_rx_seqproto field (no payload byte-stuffing)\r/\t/buffer-full (64 bytes)DataPacket.channel = PKC_CHANNEL_INDEX(8) triggers Curve25519 encryptionReceivedShellFramewrapper (filters by node number, not just session ID)Infrastructure
ReceivedShellFramedata class propagates sender node number for origin verificationRemoteShellPacketHandlerImplwithSharedFlow(notStateFlow) for frame deliverysupportsRemoteShellcapability gate (UNRELEASED)NodesNavigation.kt, gating inAdministrationSection.ktDependencies
vibe-coded-dmshellbranch by @jp-bennett)last_tx_seq/last_rx_seqfields)Testing
Not yet buildable — needs proto dependency (meshtastic/protobufs#894) to land first. Protocol audited against Python reference client and firmware source.