support prompt in message serialization

That seems to be the last thing needed for message serialization.
Although it's only used in the assistant currently, so hard to tell if I
forgot something.

At this point, it should be possible to start using transferkeys
when performing transfers, which will allow killing a transferkeys
process if a transfer times out or stalls. But that's for another day.

This commit was sponsored by Ethan Aubin.
This commit is contained in:
Joey Hess 2020-12-04 14:54:09 -04:00
parent 581792bcf0
commit 438d5be1f7
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
8 changed files with 77 additions and 29 deletions

View file

@ -20,7 +20,9 @@ data OutputType
= NormalOutput
| QuietOutput
| JSONOutput JSONOptions
| SerializedOutput (SerializedOutput -> IO ())
| SerializedOutput
(SerializedOutput -> IO ())
(IO (Maybe SerializedOutputResponse))
data JSONOptions = JSONOptions
{ jsonProgress :: Bool
@ -70,7 +72,13 @@ data SerializedOutput
| StartProgressMeter (Maybe FileSize)
| UpdateProgressMeter BytesProcessed
| EndProgressMeter
| StartPrompt
| EndPrompt
| JSONObject L.ByteString
-- ^ This is always sent, it's up to the consumer to decide if it
-- wants to display JSON, or human-readable messages.
deriving (Show, Read)
data SerializedOutputResponse
= ReadyPrompt
deriving (Eq, Show, Read)