omp packages

@jalaxy33/pi-p2p0.1.1

Session-to-session messaging for Pi, on one machine or across machines.

jalaxy33 Published 1 day ago MIT ~0 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

pi-p2p

Message another Pi session — on this machine or on another one. Two transports: tcp+token and ssh.

Install

pi install npm:@jalaxy33/pi-p2p
pi install git:github.com/jalaxy33/pi-p2p

Either one, then restart Pi. Both machines need it installed.

Use

/name planner        name this session (Pi's own command; p2p picks it up)
/p2p                 menu: Sessions, Connect…, Disconnect…
/p2p list            sessions here and on every connected machine

A target is a session name, a session id, or name@machine.

Connect two machines

tcp+token (no login)

  1. On the machine that accepts: /p2p → Connect… → tcp+token → Accept a connection. It prints the address, a token, and a short code.
  2. On the other machine: /p2p → Connect… → tcp+token → Reach a machine. Paste the address and the token.
  3. Both screens print the same code. If they differ, the token was copied wrong.

Both machines must reach each other on that port (LAN, or a VPN such as Tailscale).

ssh

  1. /p2p → Connect… → ssh → host, then optional ssh arguments (-p 2222 -i ~/.ssh/id_ed25519) and an optional command to run there.
  2. If ssh asks for a password or a key passphrase, Pi shows a prompt that echoes nothing. It asks at most twice.

ssh <host> has to work without a prompt first; if it does not, connect says what failed.

From the agent

p2p({ action: "list" })                        sessions here and on peers
p2p({ action: "send", to, message })            fire and forget
p2p({ action: "ask", to, message })             waits for the reply
p2p({ action: "pending" })                      asks waiting on this session
p2p({ action: "reply", message, to? })          answers one
p2p({ action: "status" })

Inbound messages appear as a p2p-message and are answered in the turn they arrive.

Where it lives

Path Contents Private?
~/.pi/agent/p2p.json behaviour switches no, safe to commit
~/.pi/agent/p2p/ socket, machine id, peers.json, mail, askpass helper yes

When it does not connect

Message Next step
does not hold this machine's token tokens differ; compare the code on both machines
Permission denied (publickey) Pi prompts for a password; or copy a key with ssh-copy-id
That host has no pi-p2p on PATH install pi-p2p there, or set command in peers.json
Connection refused / timed out sshd or the TCP listener is not reachable on that port
Host key verification failed the host key changed; check it, then drop the old line from known_hosts

More

  • Configuration — p2p.json, peers.json, environment variables, file layout
  • Design — how delivery, the link handshake, and crypto work
  • Verification — what the test layers cover and how to run them

Similar Extensions

License

MIT