Message protocol

Generated from Schemas/fray.proto. Every Fray process frames messages as a routing prefix, a Header, and a payload.

ProcessKind · PayloadType · MessageCategory · MessageNotice · MessageFlag · MessageType · Command · ApplicationStyle · SystemFonts · ApplicationPreferences · ApplicationPreferenceChange · ProjectPreferencesRequest · ProjectPreferenceChange · ProjectPreferences · ProjectSessionEntry · ProjectSession · StartupProgress · StartupFailure · WindowTarget · BuildInfo · LayoutChanged · ActiveProjectChanged · ProjectRenamed · ProjectCloseRequest · ProjectCloseResult · ProjectClosingStatus · ProjectClosingStatuses · ProjectCreateChoice · ProjectCreateStatus · ProjectCreateRequest · ProjectCreateResult · PromptButton · PromptRequest · PromptResponse · Recipient · Header · Receipt · QueueHealth · HealthReport · HistoryDirection · HistoryStep · HistoryRestored · HistoryRequested · LogEntryKind · LogEntry · LogPageRequest · LogProjectResolved · LogPage · ConsoleEntryKind · NotificationSeverity · Notification · ConsoleCommandStatus · ConsoleEntry

enum ProcessKind

Kind of process or component a message is sent from or addressed to. Used numerically in the routing prefix. Never reuse a number.

ValueNumberMeaning
PROCESS_KIND_UNSPECIFIED0
PROCESS_KIND_ENGINE1
PROCESS_KIND_ENGINE_PLUGIN2
PROCESS_KIND_ELECTRON_MAIN3
PROCESS_KIND_ELECTRON_RENDERER4
PROCESS_KIND_ELECTRON_PLUGIN5
PROCESS_KIND_BROADCAST6Destination only: every process except the sender. Never a sender.
PROCESS_KIND_MULTICAST7Destination only: the explicitly listed recipients in Header.recipients.

enum PayloadType

How the payload bytes are encoded. CUSTOM means Fray's utilities cannot decode it.

ValueNumberMeaning
PAYLOAD_TYPE_NONE0
PAYLOAD_TYPE_PROTOBUF1
PAYLOAD_TYPE_JSON2
PAYLOAD_TYPE_CUSTOM3

enum MessageCategory

Selects which identifier namespace the routing prefix's operation id belongs to.

ValueNumberMeaning
MESSAGE_CATEGORY_COMMAND0
MESSAGE_CATEGORY_MESSAGE1

enum MessageNotice

Protocol notifications, distinct from commands and from on-screen notifications.

ValueNumberMeaning
MESSAGE_NOTICE_UNSPECIFIED0
MSG_READY3"I can receive messages now."
MSG_RECEIPT4"I received the message with this UID." The payload is a Receipt, sent to the Engine.

enum MessageFlag

Bits of Header.flags. A sender sets them to opt a message out of the Engine's default handling. Setting both makes the message invisible to the log and the Console; it is only forwarded.

ValueNumberMeaning
MESSAGE_FLAG_NONE0
MESSAGE_FLAG_NO_LOG1Do not write the message (or its receipt) to the disk log.
MESSAGE_FLAG_NO_CONSOLE2Do not show the message (or its receipt) in the Console.

enum MessageType

Which schema to decode the payload with. Never reuse a number.

ValueNumberMeaning
MESSAGE_TYPE_NONE0
MESSAGE_TYPE_HEALTH_REPORT1
MESSAGE_TYPE_PROMPT_REQUEST4
MESSAGE_TYPE_PROMPT_RESPONSE5
MESSAGE_TYPE_PROJECT_CREATE_REQUEST6
MESSAGE_TYPE_PROJECT_CREATE_RESULT7
MESSAGE_TYPE_PROJECT_CLOSE_REQUEST8
MESSAGE_TYPE_PROJECT_CLOSE_RESULT9
MESSAGE_TYPE_LAYOUT_CHANGED10
MESSAGE_TYPE_ACTIVE_PROJECT_CHANGED11
MESSAGE_TYPE_PROJECT_RENAMED12
MESSAGE_TYPE_HISTORY_STEP13
MESSAGE_TYPE_HISTORY_RESTORED14
MESSAGE_TYPE_HISTORY_REQUESTED15
MESSAGE_TYPE_LOG_ENTRY16
MESSAGE_TYPE_LOG_PAGE_REQUEST17
MESSAGE_TYPE_LOG_PAGE18
MESSAGE_TYPE_LOG_PROJECT_RESOLVED19
MESSAGE_TYPE_PROJECT_CLOSING_STATUSES20
MESSAGE_TYPE_CONSOLE_ENTRY21
MESSAGE_TYPE_RECEIPT22
MESSAGE_TYPE_NOTIFICATION23
MESSAGE_TYPE_BUILD_INFO24
MESSAGE_TYPE_WINDOW_TARGET25
MESSAGE_TYPE_STARTUP_PROGRESS26
MESSAGE_TYPE_STARTUP_FAILURE27
MESSAGE_TYPE_APPLICATION_PREFERENCES28
MESSAGE_TYPE_APPLICATION_PREFERENCE_CHANGE29
MESSAGE_TYPE_PROJECT_PREFERENCES_REQUEST30
MESSAGE_TYPE_PROJECT_PREFERENCE_CHANGE31
MESSAGE_TYPE_PROJECT_PREFERENCES32
MESSAGE_TYPE_APPLICATION_STYLE33
MESSAGE_TYPE_SYSTEM_FONTS34

enum Command

Initial core commands used by the Engine and Electron main process.

ValueNumberMeaning
COMMAND_UNSPECIFIED0
COMMAND_TEST1
COMMAND_QUIT2Main -> Engine requests shutdown; Engine -> Main independently commands local exit. Both directions use the default instance IDs and an empty, untyped payload.
reserved3Never reuse.
COMMAND_REQUEST_READY4"Tell me if you are ready." Answered with MSG_READY, sent only to the sender.
COMMAND_PING5
COMMAND_PONG6
COMMAND_PROMPT_REQUEST9
COMMAND_PROMPT_RESPONSE10
COMMAND_CREATE_PROJECT11
COMMAND_PROJECT_CREATE_RESULT12
COMMAND_CLOSE_PROJECT13
COMMAND_PROJECT_CLOSE_RESULT14
COMMAND_LAYOUT_CHANGED15Renderer to Engine, addressed to a project with Header.target_project: the layout changed.
COMMAND_ACTIVE_PROJECT_CHANGED16Engine to Renderer: which project is active now, with its saved layout.
COMMAND_PROJECT_RENAMED17Engine to Renderer: a project's path changed because it was renamed.
COMMAND_HISTORY_STEP18Renderer to Engine: undo or redo one step.
COMMAND_HISTORY_RESTORED19Engine to Renderer: the step's result, or that there was nothing to step.
COMMAND_HISTORY_REQUESTED20Engine to Renderer: the Engine lacks revisions it needs before it can step; please send them as COMMAND_LAYOUT_CHANGED.
COMMAND_LOG_ENTRY21Any process to Engine: one log line to write down. Engine to Renderer: the same line, as it arrived.
COMMAND_LOG_PAGE_REQUEST22Renderer to Engine: send me a page of older log lines.
COMMAND_LOG_PAGE23Engine to Renderer: the page that was asked for.
COMMAND_LOG_PROJECT_RESOLVED24Engine to Renderer: lines tagged with a temporary opening tag belong to this project. Nothing waits for it.
COMMAND_PROJECT_CLOSING_REQUEST25Renderer requests the current pending-close snapshot; Engine also sends updates when it changes.
COMMAND_PROJECT_CLOSING_STATUSES26
COMMAND_CONSOLE_ADD27A new Console entry, sent to the Renderer. The Engine sends one for every logged message; any process may send its own (a plug-in progress bar, say). The uid is the uid of the message it describes. Nothing waits for it.
COMMAND_CONSOLE_UPDATE28The entry changed, sent to the Renderer. The Engine sends one when a MSG_RECEIPT arrives; any process may send its own. Carries the whole entry, so the Renderer can add it if the add was dropped.
COMMAND_NOTIFY29Any process to Engine: a notification the user was shown. The Engine logs it and adds it to the Console as a notification entry, so it can still be read after its card is gone. It is never receipted or shown as a command.
COMMAND_CLOSE_LOADING_WINDOW30Engine to Main: independently close the startup window and reveal the application window.
COMMAND_SHOW_MAIN_WINDOW31
COMMAND_LOADING_BUILD_INFO32Engine to loading Renderer: build label and application version.
COMMAND_WINDOW_LAUNCH33Engine to Main: operate on the specified window without waiting for completion.
COMMAND_WINDOW_SHOW34
COMMAND_WINDOW_HIDE35
COMMAND_WINDOW_CLOSE36
COMMAND_LOADING_READY_TO_SHOW37Loading Renderer to Engine: initial content is ready for presentation.
COMMAND_MAIN_FRAME_READY38Main announces the application window's first frame to Engine.
COMMAND_STARTUP_PROGRESS39Engine publishes its current startup progress to the loading Renderer.
COMMAND_STARTUP_FAILED40Main reports that application-window startup failed.
COMMAND_APPLICATION_PREFERENCES_REQUEST41Renderer requests or changes application preferences; Engine sends authoritative snapshots.
COMMAND_APPLICATION_PREFERENCE_CHANGE42
COMMAND_APPLICATION_PREFERENCES43
COMMAND_PROJECT_PREFERENCES_REQUEST44
COMMAND_PROJECT_PREFERENCE_CHANGE45
COMMAND_PROJECT_PREFERENCES46
COMMAND_APPLICATION_STYLE_REQUEST47Renderer requests or saves a button stylesheet; Engine sends a separate result.
COMMAND_APPLICATION_STYLE48
COMMAND_SYSTEM_FONTS49Engine to the application Renderer: the font families installed on this computer, sent unprompted.

message ApplicationStyle

FieldTypeNumberMeaning
cssstring1Request: packaged defaults when loading, edited stylesheet when saving. Result: loaded or saved stylesheet; empty is valid.
savebool2
errorstring3
edituint644

message SystemFonts

The font families installed on this computer, sorted and without duplicates. Read once at startup.

FieldTypeNumberMeaning
familiesrepeated string1

message ApplicationPreferences

FieldTypeNumberMeaning
default_save_locationstring1
reopen_projects_on_launchbool2
package_on_closebool3
database_pathstring4
errorstring5

message ApplicationPreferenceChange

FieldTypeNumberMeaning
default_save_locationstring (oneof change)1
reopen_projects_on_launchbool (oneof change)2
package_on_closebool (oneof change)3
database_pathstring (oneof change)4
resetbool (oneof change)5

message ProjectPreferencesRequest

FieldTypeNumberMeaning
idstring1

message ProjectPreferenceChange

FieldTypeNumberMeaning
idstring1
namestring (oneof change)2
package_on_closebool (oneof change)3

message ProjectPreferences

FieldTypeNumberMeaning
idstring1
namestring2
package_on_closebool3
errorstring4

message ProjectSessionEntry

Engine-owned shutdown snapshot; paths identify working folders or their .fry counterpart.

FieldTypeNumberMeaning
idstring1
pathstring2

message ProjectSession

FieldTypeNumberMeaning
projectsrepeated ProjectSessionEntry1
active_idstring2

message StartupProgress

FieldTypeNumberMeaning
percentuint321
statusstring2

message StartupFailure

FieldTypeNumberMeaning
errorstring1

message WindowTarget

FieldTypeNumberMeaning
window_iduint321

message BuildInfo

Build information displayed by the loading window.

FieldTypeNumberMeaning
namestring1
versionstring2

message LayoutChanged

The complete layout document, never a delta. The revision counts layout changes within one project and is never reused, so the Engine can tell when it has missed one.

FieldTypeNumberMeaning
revisionuint641
layoutstring2

message ActiveProjectChanged

An empty path means no project is open.

FieldTypeNumberMeaning
pathstring1
namestring2
has_layoutbool3
layoutstring4
layout_revisionuint645
latest_layout_revisionuint646The highest layout revision ever recorded, so the next one can be numbered after it.
idstring7Stable across renames, unlike the path.
active_revisionuint648Engine-local ordering for independently queued active-project announcements.

message ProjectRenamed

FieldTypeNumberMeaning
idstring1
pathstring2
namestring3

message ProjectCloseRequest

FieldTypeNumberMeaning
packagebool1

message ProjectCloseResult

FieldTypeNumberMeaning
request_iduint641
namestring2
successbool3
packagedbool4
errorstring5
pathstring6Where the project can be found: the .fry file when packaged, otherwise the working folder.
idstring7The project's stable id, so the Console can drop the project's entries. Empty when no project was closed.

message ProjectClosingStatus

FieldTypeNumberMeaning
idstring1
namestring2
pathstring3

message ProjectClosingStatuses

A complete snapshot, ordered by an Engine-local revision.

FieldTypeNumberMeaning
revisionuint641
projectsrepeated ProjectClosingStatus2

enum ProjectCreateChoice

ValueNumberMeaning
PROJECT_CREATE_NEW0
PROJECT_OPEN_EXISTING1
PROJECT_OPEN_ARCHIVE2
PROJECT_OPEN_FOLDER3
PROJECT_SELECT_ARCHIVE4
PROJECT_SELECT_FOLDER5
PROJECT_CREATE_IN_FOLDER6
PROJECT_CREATE_IN_FOLDER_RESOLVE7

enum ProjectCreateStatus

ValueNumberMeaning
PROJECT_CREATE_FAILED0
PROJECT_CREATE_SUCCEEDED1
PROJECT_OPEN_SUCCEEDED2
PROJECT_FOLDER_CONFLICT3
PROJECT_ARCHIVE_CONFLICT4
PROJECT_BOTH_CONFLICT5
PROJECT_INVALID_DATABASE6

message ProjectCreateRequest

FieldTypeNumberMeaning
pathstring1
choiceProjectCreateChoice2

message ProjectCreateResult

FieldTypeNumberMeaning
request_iduint641
pathstring2
statusProjectCreateStatus3
errorstring4
working_pathstring5The project's working folder, set when it was created or opened.

message PromptButton

FieldTypeNumberMeaning
labelstring1
valuestring2

message PromptRequest

FieldTypeNumberMeaning
titlestring1
descriptionstring2
buttonsrepeated PromptButton3
dismissibleoptional bool4

message PromptResponse

FieldTypeNumberMeaning
request_iduint641
dismissedbool2
valuestring3
errorstring4

message Recipient

One process instance addressed by a multicast message.

FieldTypeNumberMeaning
kindProcessKind1
iduint322

message Receipt

Sent by a destination process to the Engine as soon as it receives a stamped message addressed to it. The Engine logs it and tells the Console the original message arrived.

FieldTypeNumberMeaning
uidstring1UID of the message that was received, as 32 hexadecimal characters.
flagsuint322The original message's Header.flags, so the Engine does not have to look the message up.
senderProcessKind3Who sent the original, who it was addressed to, and which command it was, so the Engine can still show it in the Console if it no longer holds an entry for the UID.
destinationProcessKind4
operationuint645

message QueueHealth

FieldTypeNumberMeaning
destinationProcessKind1
depthuint642
oldest_age_msuint643
destination_iduint324

message HealthReport

FieldTypeNumberMeaning
processed_countuint641
progress_age_msuint642
heartbeatuint643
queuesrepeated QueueHealth4

enum HistoryDirection

ValueNumberMeaning
HISTORY_DIRECTION_UNSPECIFIED0
HISTORY_DIRECTION_UNDO1
HISTORY_DIRECTION_REDO2

message HistoryStep

An empty domain means global: the Engine picks the domain whose action is the most recent still in effect (undo) or the earliest one undone (redo). from_revision is the layout revision the renderer is showing.

FieldTypeNumberMeaning
directionHistoryDirection1
domainstring2
from_revisionuint643

message HistoryRestored

FieldTypeNumberMeaning
idstring1
domainstring2
from_revisionuint643
changedbool4False when there was nothing to undo or redo; the renderer keeps what it shows.
revisionuint645
payloadstring6

message HistoryRequested

FieldTypeNumberMeaning
idstring1
domainstring2
after_revisionuint643Send every revision you hold above after_revision, up to and including through_revision, in order.
through_revisionuint644

enum LogEntryKind

One log line. Senders fill in level, thread, project and text; the Engine adds who sent it and when it arrived. arrived_us is microseconds since the Unix epoch and is used for order and paging. uid is the entry's 128-bit identity as 32 lowercase hexadecimal characters. What a log row records. Commands and receipts keep the fields the Console needs to show them again from history.

ValueNumberMeaning
LOG_ENTRY_KIND_LINE0
LOG_ENTRY_KIND_COMMAND1A command was sent. The process is the sender and the uid is the command's.
LOG_ENTRY_KIND_RECEIPT2A destination confirmed a command. The process is the receiver and ref_uid is the command's uid.
LOG_ENTRY_KIND_NOTIFICATION3A notification. The text is the title, then a newline and the description when there is one; operation is the NotificationSeverity.
LOG_ENTRY_KIND_SESSION4The first row of every session file. The text is the session's name: "Fray" for the application, or the project's name. The arrival time is when the session began. The Console shows it as a divider.

message LogEntry

FieldTypeNumberMeaning
arrived_usuint641
processProcessKind2
levelstring3
threaduint324
projectstring5The id of the project the line belongs to. Empty means the application.
textstring6
uidstring7
kindLogEntryKind8The remaining fields are set only for commands and receipts.
destinationProcessKind9
operationuint6410
ref_uidstring11

message LogPageRequest

A page of log lines older than before_us, across every session the Engine can reach. Every filter that is set has to match: a process or level from the lists, a project, or text anywhere in the line.

FieldTypeNumberMeaning
before_usuint6410 means the newest lines.
limituint322
processesrepeated ProcessKind3
levelsrepeated string4
projectoptional string5
containsstring6
request_iduint647Echoed in the LogPage that answers this request.

message LogProjectResolved

A project logs lines while it opens, before its id is known, under a temporary tag. This says whose they are.

FieldTypeNumberMeaning
opening_tagstring1
projectstring2

message LogPage

Oldest first. When exhausted is true nothing older matched.

FieldTypeNumberMeaning
request_iduint641
entriesrepeated LogEntry2
exhaustedbool3

enum ConsoleEntryKind

What a Console entry shows. Log lines still travel as LogEntry.

ValueNumberMeaning
CONSOLE_ENTRY_KIND_UNSPECIFIED0
CONSOLE_ENTRY_KIND_COMMAND1
CONSOLE_ENTRY_KIND_NOTIFICATION2Shown with a severity icon, using title, detail and severity.

enum NotificationSeverity

ValueNumberMeaning
NOTIFICATION_SEVERITY_UNSPECIFIED0
NOTIFICATION_SEVERITY_INFO1
NOTIFICATION_SEVERITY_SUCCESS2
NOTIFICATION_SEVERITY_WARNING3
NOTIFICATION_SEVERITY_ERROR4

message Notification

The payload of COMMAND_NOTIFY.

FieldTypeNumberMeaning
severityNotificationSeverity1
titlestring2
descriptionstring3

enum ConsoleCommandStatus

What is known about a command. PENDING means no receipt was observed, not that none happened.

ValueNumberMeaning
CONSOLE_COMMAND_STATUS_UNSPECIFIED0
CONSOLE_COMMAND_STATUS_PENDING1
CONSOLE_COMMAND_STATUS_RECEIVED2

message ConsoleEntry

One entry in the list the Engine owns and the Renderer shows. The uid is shared with the disk log and the message. The revision counts changes to this entry, starting at 1, so a late add can never undo a newer state.

FieldTypeNumberMeaning
uidstring1
timestamp_usuint642Microseconds since the Unix epoch, on the same clock as log rows, so entries and log lines interleave exactly.
kindConsoleEntryKind3
senderProcessKind4
destinationProcessKind5
projectstring6The id of the project the entry belongs to. Empty means the application.
titlestring7
detailstring8
statusConsoleCommandStatus9
revisionuint6410
severityNotificationSeverity11Set only for notification entries.
recipientsrepeated Recipient12Multicast recipient snapshot and the number of distinct receipts observed.
received_countuint3213