Skip to content
pi-c Artifact [a18a5004c4]
Login

Artifact [a18a5004c4]

Artifact a18a5004c49b2f3b1797e016a00bc101ff3237951a7a79b649ecfce0047b2884:


/* pic remote (remote.c): remote control over a relay, docs/design/remote-protocol.md. A phone is
 * one more sender and one more observer of the journal: pic remote dials out to the relay, speaks
 * a Noise session to each paired phone, turns each command into a journal row before anything acts
 * on it (an inbox row, or a keyed admission), and rebuilds events from committed rows as pic
 * attach does. It holds no lease and listens on no socket. Pairing (pic remote pair, and /rc
 * through it) makes the keys and the mailbox on first use and adds a device row after a yes at
 * the terminal; the rows are sealed in ~/.pic/pic.sqlite under the credential store's key. */
#ifndef PIC_REMOTE_H
#define PIC_REMOTE_H

typedef struct {
    const char *self; /* this pic, for the children a prompt starts */
    /* Draws a QR code of TEXT on stdout (the composition root owns the drawing). */
    void (*show_qr)(const char *text);
} pic_remote_options;

/* pic remote [pair [--pipe] | devices | unpair ID | reset]: the process's exit status. */
int pic_remote_main(const pic_remote_options *o, int argc, char **argv);

/* The relay a pairing names when the setting remote.relay is unset. */
#define PIC_REMOTE_RELAY "https://remote.zeitforge.app"

#endif