pub enum ClientMsg {
Show 82 variants
Hello {
protocol: u32,
minor: u32,
client: String,
caps: Vec<String>,
},
SetInference {
base_url: String,
model: String,
api_key: Option<String>,
},
TestInference {
base_url: String,
model: String,
api_key: Option<String>,
},
DetectEndpoints,
Retry,
Rewind {
entry: u64,
text: String,
},
SendMessage {
text: String,
attachments: Vec<String>,
},
Steer {
text: String,
attachments: Vec<String>,
},
Cancel,
Unqueue {
id: u64,
},
EditQueued {
id: u64,
text: String,
attachments: Vec<String>,
},
MoveQueued {
id: u64,
to: u32,
},
SendQueuedNow {
id: u64,
},
ResumeQueue,
Approve {
step: u64,
answer: ApprovalAnswer,
},
AnswerQuestion {
step: u64,
text: String,
},
Undo {
entry: u64,
},
ListChats {
after: Option<ChatCursor>,
limit: u32,
},
NewChat {
workspace: Option<String>,
},
NewUnattachedChat,
ChatToProject {
chat: String,
},
OpenChat {
id: String,
},
RenameChat {
id: String,
title: String,
},
DeleteChat {
id: String,
},
PinChat {
id: String,
pinned: bool,
},
ArchiveChat {
id: String,
archived: bool,
},
ListLibrary,
GetPluginLogo {
plugin: String,
},
GetLibraryFile {
chat: String,
id: String,
version: u32,
},
DeleteArtifact {
chat: String,
id: String,
},
RevealArtifact {
chat: String,
id: String,
},
RevealChatFolder {
chat: String,
},
AddLiveFile {
path: String,
},
Upload {
upload: u64,
name: String,
size: u64,
offset: u64,
data: String,
done: bool,
},
GetMedia {
path: String,
},
GetArtifact {
id: String,
version: u32,
},
SetArtifactNetwork {
id: String,
on: bool,
},
Compact {
focus: Option<String>,
},
WorkspaceEnv {
action: Option<EnvAction>,
workspace: Option<String>,
},
CreateWorkspace {
name: String,
folder: NewFolder,
config: Layer,
folders: Vec<String>,
},
SetWorkspaceFolders {
id: String,
folders: Vec<String>,
},
RenameWorkspace {
id: String,
name: String,
},
RemoveWorkspace {
id: String,
clean: bool,
},
GetConfig {
scope: ConfigScope,
},
SetConfig {
scope: ConfigScope,
layer: Layer,
api_key: Option<String>,
},
ListFolders {
path: Option<String>,
},
CheckContainers,
GetExtensions,
SetPluginEnabled {
scope: ConfigScope,
plugin: String,
enabled: Option<bool>,
},
SetPluginSetting {
plugin: String,
key: String,
value: Option<String>,
},
KeepPlugin {
plugin: String,
scope: PluginScope,
new_id: Option<String>,
},
RemovePlugin {
plugin: String,
scope: PluginScope,
},
ReloadPlugins,
TrustPlugins {
workspace: String,
plugins: Vec<String>,
trust: bool,
},
Plugin {
plugin: String,
msg: Value,
},
OpenView {
view: ViewRef,
},
CloseView {
view: ViewRef,
},
ViewEvent {
view: ViewRef,
event: Event,
},
WebCall {
call: u64,
owner: WebOwner,
method: String,
params: Value,
approved: bool,
},
GetProfiles,
CreateProfile {
profile: Profile,
api_key: Option<String>,
assign: Option<ConfigScope>,
make_main: bool,
},
UpdateProfile {
profile: Profile,
api_key: Option<String>,
},
DeleteProfile {
id: String,
},
DuplicateProfile {
id: String,
},
SetRole {
role: String,
profile: Option<String>,
},
TestProfile {
id: String,
},
SetLevelProfile {
scope: ConfigScope,
profile: Option<String>,
},
SetKeepRunning {
value: KeepRunning,
},
SetLayout {
layout: Layout,
},
ReportLook(LookReport),
Captured {
request: u64,
image: Option<String>,
error: Option<String>,
},
SaveRoutine {
routine: Routine,
},
DeleteRoutine {
id: String,
},
RunRoutine {
id: String,
},
SetRoutineEnabled {
id: String,
enabled: bool,
},
ListRoutineRuns {
id: String,
},
PauseRoutines {
paused: bool,
},
PairPhone {
channel: String,
},
CancelPairing,
UnpairPhone,
TestPhone,
Unknown,
}Expand description
Client -> engine.
Variants§
Hello
First message on every connection: the client’s PROTOCOL_MAJOR (protocol),
minor and caps (see version). Answered with ServerMsg::Welcome, or an error
notice if the major differs.
SetInference
Point the engine at a different inference endpoint (saved, then checked). api_key:
None keeps the stored key if the server (scheme, host, port) is unchanged and drops
it otherwise; Some("") removes it.
TestInference
Try an endpoint without switching to it; answered with ServerMsg::InferenceTested.
api_key as for ClientMsg::SetInference.
DetectEndpoints
Look again for inference servers on this machine’s usual ports
(EngineState::detected).
Retry
Run the last message of the chat in view again, after its reply failed before producing anything (e.g. the server was down). The failed reply is removed.
Rewind
Go back to user message entry of the chat in view and start over from there: it
and everything after it are removed, and text is sent in its place (with its
attachments). The same text runs it again; new text is an edit. Refused while a
reply runs. Files the removed replies changed stay as they are (13.13, engine cap
version::CAP_REWIND).
SendMessage
Send a user message and start a turn; while a reply runs in the chat, queue it
instead (see queue). attachments are paths the engine returned in
ServerMsg::Uploaded.
Steer
Send a user message to the reply running in the chat in view: it reaches the model at
the reply’s next step (once the tool calls it is making have finished), and the reply
goes on with it in view. Until then it waits in the queue as a steering item
(QueuedMessage::steer); if the reply ends first it starts the next turn. With no
reply running it is ClientMsg::SendMessage (24, engine cap queue::CAP_STEER;
see queue).
Cancel
Stop the running turn. Pending approvals are denied; the chat’s queue pauses.
Unqueue
Take queued message id out of the queue of the chat in view.
EditQueued
Replace the text and attachments of queued message id (in place). Empty text and no
attachments removes it.
MoveQueued
Move queued message id to position to (0 = next; past the end = last).
SendQueuedNow
Run queued message id next, now: stop the running turn (if any) and resume the queue.
ResumeQueue
Let a paused queue go on (starts the next message if the chat is free).
Approve
Answer a pending approval (a Step with status StepStatus::Waiting). Any
client may answer; the first answer wins and later ones are ignored.
AnswerQuestion
Answer a question card (a waiting Step whose Ask::choice is set): one of its
options or, when it takes one, the user’s own text (≤ MAX_ANSWER_CHARS). Skipping
it is ClientMsg::Approve with ApprovalAnswer::Deny. First answer wins (13.8).
Undo
Reverse the file changes of assistant entry entry (see Entry::undoable). The
engine refuses, changing nothing, if any of those files changed since.
ListChats
Ask for a page of the chat list (answered with ServerMsg::Chats). after is the
previous page’s next; None asks for the first page (pinned chats included).
NewChat
Start a new, empty chat in this client, in workspace workspace (default: the
workspace of the chat in view, else the default one). The chat is created when the
first message is sent; until then this client sees an empty transcript.
NewUnattachedChat
Start a new, empty chat in this client that belongs to no project: it works in a
folder of its own in byob’s data folder (created with the chat), so nothing lands
in whatever folder byob was started in. ClientMsg::ChatToProject can make that
folder a project later (13.16, engine cap version::CAP_UNATTACHED).
ChatToProject
Make chat chat’s folder a project named after the chat (its chats, this one
included, then belong to it). For a chat without a project; answered with
ServerMsg::Workspaces (13.16, engine cap version::CAP_UNATTACHED).
OpenChat
Look at another chat. Only this client switches; a turn running elsewhere goes on.
RenameChat
DeleteChat
Delete a chat and its messages. Refused while a reply is running in it.
PinChat
Pin a chat or unpin it. Pinning an archived chat also brings it back (17+).
ArchiveChat
Archive a chat (kept, listed apart; also unpins it) or bring it back (17+, cap
version::CAP_ARCHIVE).
ListLibrary
Every chat’s artifacts, for the Library; answered with ServerMsg::Library (17+,
cap version::CAP_LIBRARY).
GetPluginLogo
A plugin’s logo (its folder’s logo.png / logo.jpg); answered with
ServerMsg::PluginLogo (17+, cap version::CAP_PLUGIN_LOGOS).
GetLibraryFile
A file of any chat’s artifact, for the Library’s previews (images); answered with
ServerMsg::LibraryFile (17+, cap version::CAP_LIBRARY).
DeleteArtifact
Delete one artifact for good (deleting its chat keeps it); the Library is sent again
(17+, cap version::CAP_LIBRARY).
RevealArtifact
Show an artifact’s folder in the file manager of the machine byob runs on (17+, cap
version::CAP_LIBRARY).
RevealChatFolder
Show the folder a chat works in, in the file manager of the machine byob runs on (a chat without a project keeps its files in byob’s own folder) (17+).
AddLiveFile
Keep a file of the chat in view in the Library as a live file (path relative to the
chat’s folder): byob snapshots it now and whenever it changes; the file stays yours
(17+, cap version::CAP_LIBRARY).
Upload
One chunk of a file the user attaches. upload is chosen by the client (unique per
connection); chunks arrive in order, offset is where data (base64, at most
media::UPLOAD_CHUNK_BYTES raw) starts; size is the whole file’s size. The engine
answers the last chunk (done) or the first problem with ServerMsg::Uploaded.
GetMedia
Ask for the content of a MediaRef in the transcript; answered with ServerMsg::Media.
GetArtifact
Ask for the bytes of version version of artifact id in the chat this client looks
at; answered with ServerMsg::ArtifactFile.
SetArtifactNetwork
Let artifact id, an HTML app in the chat this client looks at, use the internet
(HTTPS), or not (cap version::CAP_ARTIFACT_NETWORK). Viewers get
ServerMsg::ArtifactUpdated; a refusal is a notice.
Compact
Summarize the conversation in view now, so later requests start from the summary
(also typed as /compact [focus]). focus says what the summary must keep.
WorkspaceEnv
Ask for the environment state of workspace workspace (default: the chat in view’s),
after applying action if given; answered with ServerMsg::WorkspaceEnv.
CreateWorkspace
Make a workspace: a name, a folder on the engine’s machine, its own settings
(validated for the workspace level). Answered with ServerMsg::WorkspaceCreated;
on success this client starts a new chat in it.
Fields
SetWorkspaceFolders
Replace the other folders a project works in (13.18+, cap project_folders). Each must
exist on the engine’s machine; its own folder can’t be one. Answered by
ServerMsg::Workspaces (or a notice saying why not).
RenameWorkspace
RemoveWorkspace
Remove a workspace from byob with its chats; the folder and its files stay. clean
also deletes what byob keeps for it elsewhere (installed packages, its container).
GetConfig
Ask for one level’s settings; answered with ServerMsg::Config.
Fields
scope: ConfigScopeSetConfig
Replace one level’s own settings (None fields inherit). api_key as for
ClientMsg::SetInference, for a level with its own URL. Answered with
ServerMsg::Config.
ListFolders
List the subfolders of path on the engine’s machine (default: the home folder);
answered with ServerMsg::Folders.
CheckContainers
Is Docker/Podman reachable? Answered with ServerMsg::ContainersChecked.
GetExtensions
Ask for the plugins of the chat in view; answered with ServerMsg::Extensions.
SetPluginEnabled
Turn plugin plugin on (Some(true)) or off (Some(false)) at one level of the
layered settings, or forget that level’s switch (None: inherit). Applies from the
next turn. Answered with ServerMsg::Extensions.
SetPluginSetting
Set (or clear, None) a setting the plugin declares. Secret settings go to
secrets.json, the others to settings.json; values are never sent back, only whether
each is set (PluginSetting::set).
KeepPlugin
Keep plugin plugin of the chat in view (its scratch copy, or whichever copy the chat
uses) in the chat’s workspace or everywhere, as new_id if given. The user asked, so
there is no approval card.
RemovePlugin
Delete the copy of plugin plugin in scope (the chat in view’s scratch folder, its
workspace’s .byob/plugins, or the global plugins folder).
ReloadPlugins
Read the plugin folders of the chat in view again now.
TrustPlugins
Let the plugins that came with workspace workspace’s folder run their tools and
servers (trust: true), or keep them to skills and prompt lines without asking again
(false). plugins empty: all of them.
Plugin
A message for plugin plugin’s handler in the engine (the plugin channel; only when
the engine lists version::CAP_PLUGIN_CHANNEL). Its meaning is the plugin’s.
OpenView
This client shows live view view at its site (13.3+, only when the engine lists
sites::CAP_VIEW_SITES): answered with a ServerMsg::LiveView holding its tree,
then its changes until ClientMsg::CloseView or another chat is opened.
CloseView
This client no longer shows view.
ViewEvent
The user did something in live view view (a click, Enter in a field, a cell edit):
for the plugin’s backend, which answers with a new view.
WebCall
A call from a web surface for the engine (13.5+, only when the engine lists
web::CAP_WEB_BRIDGE): JSON-RPC method + params from the page whose calls
owner answers. Answered with one ServerMsg::WebReply of the same call number.
approved: the user allowed it after a reply asked (web::WebError::approval).
GetProfiles
Ask for the model profiles; answered with ServerMsg::Profiles (13.9+, see
profiles).
CreateProfile
Save a new profile (its id is made by the engine) with its key, if any. assign
also makes it that level’s model; make_main the default model of every chat.
UpdateProfile
Replace profile profile.id. api_key: None keeps the stored key while the
server (scheme, host, port) stays the same, Some("") removes it.
DeleteProfile
Delete a profile (not the main one). Levels that picked it inherit their model again; roles that used it are unassigned.
DuplicateProfile
Save a copy of a profile, key included, as “
SetRole
Give role role (see profiles::ROLES) profile profile; None unassigns it
(not main).
TestProfile
Check a profile’s endpoint now; answered with ServerMsg::ProfileTested.
SetLevelProfile
Make profile the model of one level (None: inherit it again). Answered with
ServerMsg::Config for that scope.
SetKeepRunning
Whether closing the desktop window keeps byob running (13.20+, to an engine whose
EngineState::keep_running is set): saved in settings.json, every client gets the
new ServerMsg::State.
Fields
value: KeepRunningSetLayout
Replace the layout (13.11+, cap layout::CAP_LAYOUT); every client gets the new
ServerMsg::Layout.
ReportLook(LookReport)
This client’s look (13.12+, cap look::CAP_LOOK): after connecting, after every
change, and in answer to ServerMsg::SetLook.
Captured
A screenshot of this client’s window (13.15+, cap look::CAP_CAPTURE), in answer
to ServerMsg::Capture: a PNG or JPEG of at most media::MAX_IMAGE_BYTES,
base64, longest side at most look::CAPTURE_SIDE; or why there’s none.
SaveRoutine
Save a routine (13.19+, cap routines::CAP_ROUTINES): an empty id makes a new
one. Every client gets the new ServerMsg::Routines; a refusal is an error notice.
DeleteRoutine
Delete a routine (its run chats stay).
RunRoutine
Run a routine now.
SetRoutineEnabled
Turn a routine’s triggers on or off (Run now works either way).
ListRoutineRuns
A routine’s runs; answered with ServerMsg::RoutineRuns.
PauseRoutines
Pause or resume every routine’s schedule (13.21+, to an engine whose
EngineState::routines_paused is set): saved in settings.json; slots that pass while
paused are skipped, not made up. Run now still works. Every client gets the new
ServerMsg::State.
PairPhone
Start pairing a phone on channel channel (<plugin>:<channel>; 13.23+, cap
phone::CAP_PHONE): the engine makes a one-time code and the channel a link, sent
back in ServerMsg::Phone. At most 3 codes wait at once per channel.
CancelPairing
Forget the pairing codes waiting.
UnpairPhone
Forget My phone and the person paired on it (they can’t reach byob any more).
TestPhone
Send My phone a test message (an error notice if it can’t).
Unknown
A message from a newer client this engine doesn’t know (answered with a notice).