Expand description
Unix Socket IPC Utilities
Provides async read/write helpers for Unix domain socket communication between the TUI viewer and Agent process.
§Encryption
This module provides both plaintext and encrypted IPC:
IpcReader/IpcWriter- Plaintext JSON over newlines (legacy, for handshake)EncryptedIpcReader/EncryptedIpcWriter- ChaCha20-Poly1305 encrypted messages
The encrypted variants use the session token to derive the encryption key, providing confidentiality and integrity for all messages after handshake.
Structs§
- Encrypted
IpcConnection - Encrypted IPC connection handle
- Encrypted
IpcReader - Encrypted reader for receiving IPC messages
- Encrypted
IpcWriter - Encrypted writer for sending IPC messages
- IpcConnection
- IPC connection handle (combines reader and writer)
- IpcReader
- Reader for receiving IPC messages
- IpcWriter
- Writer for sending IPC messages
Functions§
- delete_
session_ token - Delete session token file
- generate_
session_ token - Generate a cryptographically secure session token (64 hex characters = 256 bits)
- get_
agent_ socket_ path - Get the socket path for an agent session
- get_
session_ token_ path - Get the token file path for an agent session
- read_
session_ token - Read session token from disk This is used by clients that need to reattach to a session
- validate_
session_ token - Validate that a provided token matches the stored token for a session Returns true if tokens match, false if they don’t match or no token exists
- write_
session_ token - Write session token to disk with secure permissions (0600) This should only be called by the agent process that owns the session