pub enum ClientMsg {
Show 54 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,
SendMessage {
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>,
},
OpenChat {
id: String,
},
RenameChat {
id: String,
title: String,
},
DeleteChat {
id: String,
},
PinChat {
id: String,
pinned: bool,
},
Upload {
upload: u64,
name: String,
size: u64,
offset: u64,
data: String,
done: bool,
},
GetMedia {
path: String,
},
GetArtifact {
id: String,
version: u32,
},
Compact {
focus: Option<String>,
},
WorkspaceEnv {
action: Option<EnvAction>,
workspace: Option<String>,
},
CreateWorkspace {
name: String,
folder: NewFolder,
config: Layer,
},
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>,
},
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.
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.
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.
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
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.
Compact
Summarise 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.
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.
Unknown
A message from a newer client this engine doesn’t know (answered with a notice).