syndicate-pty-driver/protocols/schemas/pty.prs

45 lines
1.8 KiB
Plaintext
Raw Permalink Normal View History

2023-11-24 09:53:48 +00:00
# Protocol for interacting with processes attached to pseudoterminals.
#
# syndicate-pty-driver publishes a dataspace into its parent and engages in
# this protocol over that dataspace.
2023-11-11 01:03:30 +00:00
version 1 .
2023-11-24 09:53:48 +00:00
# Assert PtySession with a fresh ID (management of these is out-of-scope;
# use UUIDs?) to allocate a PTY on the machine the driver is running on,
# and spawn a subprocess attached to it running CommandLine.
#
2023-11-24 09:55:37 +00:00
# When PtySession is retracted, the driver will terminate the subprocess
# (via SIGHUP first, SIGTERM if that doesn't work, and ultimately SIGKILL)
# and close the associated PTY.
#
2023-11-25 20:40:36 +00:00
PtySession = <pty @id any <command @commandLine CommandLine>> .
2023-11-24 09:53:48 +00:00
#
# A CommandLine is a non-empty sequence of pieces which, "stringified",
# will form the command line used to create a subprocess. Each element of
# the CommandLine is "stringified" as follows:
#
# - a String is used as-is (no quotes or escaping)
# - a Symbol's associated string is used as-is (no quotes or escaping)
# - anything else is formatted to a string using the Preserves text syntax.
#
2023-11-11 01:03:30 +00:00
CommandLine = [@command any @args any ...] .
2023-11-24 09:53:48 +00:00
# Asserted by the driver when a PtySession request has resulted in a
# running and ready session.
#
2023-11-25 20:40:36 +00:00
PtySessionRunning = <pty @id any <session-running>> .
2023-11-11 01:03:30 +00:00
2023-11-25 22:26:57 +00:00
# Assertion. The driver interprets these as a request to execute TIOCSWINSZ
# with the minima of all concurrently asserted values.
2023-11-25 20:40:36 +00:00
PtyResize = <pty @id any <resize @columns int @rows int>> .
2023-11-20 19:43:11 +00:00
2023-11-25 22:26:57 +00:00
# Assertion. The driver asserts this to report the current size of the tty.
PtySize = <pty @id any <size @columns int @rows int>> .
2023-11-24 09:53:48 +00:00
# Message. Causes `data` to be delivered by the driver to the subprocess via the pty.
2023-11-25 20:40:36 +00:00
PtyInput = <pty @id any <input @data bytes>> .
2023-11-11 01:03:30 +00:00
2023-11-24 09:53:48 +00:00
# Message. `data` was received by the driver from the subprocess via the pty.
2023-11-25 20:40:36 +00:00
PtyOutput = <pty @id any <output @data bytes>> .