Skip to main content

ClientMsg

Enum ClientMsg 

Source
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.

Fields

§protocol: u32
§minor: u32
§client: String
§caps: Vec<String>
§

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.

Fields

§base_url: String
§model: String
§api_key: Option<String>
§

TestInference

Try an endpoint without switching to it; answered with ServerMsg::InferenceTested. api_key as for ClientMsg::SetInference.

Fields

§base_url: String
§model: String
§api_key: Option<String>
§

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).

Fields

§entry: u64
§text: String
§

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.

Fields

§text: String
§attachments: Vec<String>
§

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).

Fields

§text: String
§attachments: Vec<String>
§

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.

Fields

§id: u64
§

EditQueued

Replace the text and attachments of queued message id (in place). Empty text and no attachments removes it.

Fields

§id: u64
§text: String
§attachments: Vec<String>
§

MoveQueued

Move queued message id to position to (0 = next; past the end = last).

Fields

§id: u64
§to: u32
§

SendQueuedNow

Run queued message id next, now: stop the running turn (if any) and resume the queue.

Fields

§id: u64
§

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.

Fields

§step: u64
§

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).

Fields

§step: u64
§text: String
§

Undo

Reverse the file changes of assistant entry entry (see Entry::undoable). The engine refuses, changing nothing, if any of those files changed since.

Fields

§entry: u64
§

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).

Fields

§limit: u32
§

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.

Fields

§workspace: Option<String>
§

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).

Fields

§chat: String
§

OpenChat

Look at another chat. Only this client switches; a turn running elsewhere goes on.

Fields

§

RenameChat

Fields

§title: String
§

DeleteChat

Delete a chat and its messages. Refused while a reply is running in it.

Fields

§

PinChat

Pin a chat or unpin it. Pinning an archived chat also brings it back (17+).

Fields

§pinned: bool
§

ArchiveChat

Archive a chat (kept, listed apart; also unpins it) or bring it back (17+, cap version::CAP_ARCHIVE).

Fields

§archived: bool
§

ListLibrary

Every chat’s artifacts, for the Library; answered with ServerMsg::Library (17+, cap version::CAP_LIBRARY).

A plugin’s logo (its folder’s logo.png / logo.jpg); answered with ServerMsg::PluginLogo (17+, cap version::CAP_PLUGIN_LOGOS).

Fields

§plugin: String
§

GetLibraryFile

A file of any chat’s artifact, for the Library’s previews (images); answered with ServerMsg::LibraryFile (17+, cap version::CAP_LIBRARY).

Fields

§chat: String
§version: u32
§

DeleteArtifact

Delete one artifact for good (deleting its chat keeps it); the Library is sent again (17+, cap version::CAP_LIBRARY).

Fields

§chat: String
§

RevealArtifact

Show an artifact’s folder in the file manager of the machine byob runs on (17+, cap version::CAP_LIBRARY).

Fields

§chat: String
§

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+).

Fields

§chat: String
§

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).

Fields

§path: String
§

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.

Fields

§upload: u64
§name: String
§size: u64
§offset: u64
§data: String
§done: bool
§

GetMedia

Ask for the content of a MediaRef in the transcript; answered with ServerMsg::Media.

Fields

§path: String
§

GetArtifact

Ask for the bytes of version version of artifact id in the chat this client looks at; answered with ServerMsg::ArtifactFile.

Fields

§version: u32
§

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.

Fields

§on: bool
§

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.

Fields

§

WorkspaceEnv

Ask for the environment state of workspace workspace (default: the chat in view’s), after applying action if given; answered with ServerMsg::WorkspaceEnv.

Fields

§workspace: Option<String>
§

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

§name: String
§folder: NewFolder
§config: Layer
§folders: Vec<String>

Other folders it works in besides folder (13.18+, cap project_folders).

§

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).

Fields

§folders: Vec<String>
§

RenameWorkspace

Fields

§name: String
§

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).

Fields

§clean: bool
§

GetConfig

Ask for one level’s settings; answered with ServerMsg::Config.

Fields

§

SetConfig

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.

Fields

§layer: Layer
§api_key: Option<String>
§

ListFolders

List the subfolders of path on the engine’s machine (default: the home folder); answered with ServerMsg::Folders.

Fields

§

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.

Fields

§plugin: String
§enabled: Option<bool>
§

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).

Fields

§plugin: String
§

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.

Fields

§plugin: String
§new_id: Option<String>
§

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).

Fields

§plugin: String
§

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.

Fields

§workspace: String
§plugins: Vec<String>
§trust: bool
§

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.

Fields

§plugin: String
§msg: Value
§

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.

Fields

§view: ViewRef
§

CloseView

This client no longer shows view.

Fields

§view: ViewRef
§

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.

Fields

§view: ViewRef
§event: Event
§

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).

Fields

§call: u64
§owner: WebOwner
§method: String
§params: Value
§approved: bool
§

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.

Fields

§profile: Profile
§api_key: Option<String>
§make_main: bool
§

UpdateProfile

Replace profile profile.id. api_key: None keeps the stored key while the server (scheme, host, port) stays the same, Some("") removes it.

Fields

§profile: Profile
§api_key: Option<String>
§

DeleteProfile

Delete a profile (not the main one). Levels that picked it inherit their model again; roles that used it are unassigned.

Fields

§

DuplicateProfile

Save a copy of a profile, key included, as “ (copy)”.

Fields

§

SetRole

Give role role (see profiles::ROLES) profile profile; None unassigns it (not main).

Fields

§role: String
§profile: Option<String>
§

TestProfile

Check a profile’s endpoint now; answered with ServerMsg::ProfileTested.

Fields

§

SetLevelProfile

Make profile the model of one level (None: inherit it again). Answered with ServerMsg::Config for that scope.

Fields

§profile: Option<String>
§

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

§

SetLayout

Replace the layout (13.11+, cap layout::CAP_LAYOUT); every client gets the new ServerMsg::Layout.

Fields

§layout: 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.

Fields

§request: u64
§

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.

Fields

§routine: Routine
§

DeleteRoutine

Delete a routine (its run chats stay).

Fields

§

RunRoutine

Run a routine now.

Fields

§

SetRoutineEnabled

Turn a routine’s triggers on or off (Run now works either way).

Fields

§enabled: bool
§

ListRoutineRuns

A routine’s runs; answered with ServerMsg::RoutineRuns.

Fields

§

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.

Fields

§paused: bool
§

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.

Fields

§channel: String
§

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).

Implementations§

Source§

impl ClientMsg

Source

pub fn check_sizes(&self) -> Result<(), String>

Cheap checks of an untrusted message’s sizes (the engine checks meaning: unknown ids, folders that don’t exist, settings that don’t belong at a level).

Source§

impl ClientMsg

Source

pub fn hello(client: &str) -> Self

This build’s ClientMsg::Hello.

Source

pub fn to_json(&self) -> String

Source

pub fn from_json(text: &str) -> Result<Self, String>

Parse an untrusted frame.

Trait Implementations§

Source§

impl Clone for ClientMsg

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ClientMsg

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ClientMsg

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ClientMsg

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ClientMsg

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ClientMsg

Auto Trait Implementations§

§

impl Forget for ClientMsg

§

impl Freeze for ClientMsg

§

impl Move for ClientMsg

§

impl RefUnwindSafe for ClientMsg

§

impl Send for ClientMsg
where RawVecInner: Send, NodeRef<Owned, String, bool, LeafOrInternal>: Send, BoxRaw<(String, bool)>: Send, NodeRef<Owned, String, Value, LeafOrInternal>: Send, BoxRaw<(String, Value)>: Send, NodeRef<Owned, String, Show, LeafOrInternal>: Send, BoxRaw<(String, Show)>: Send, NodeRef<Owned, String, Vec<String>, LeafOrInternal>: Send, BoxRaw<(String, Vec<String>)>: Send, NodeRef<Owned, String, String, LeafOrInternal>: Send, BoxRaw<(String, String)>: Send,

§

impl Sync for ClientMsg
where RawVecInner: Sync, NodeRef<Owned, String, bool, LeafOrInternal>: Sync, BoxRaw<(String, bool)>: Sync, NodeRef<Owned, String, Value, LeafOrInternal>: Sync, BoxRaw<(String, Value)>: Sync, NodeRef<Owned, String, Show, LeafOrInternal>: Sync, BoxRaw<(String, Show)>: Sync, NodeRef<Owned, String, Vec<String>, LeafOrInternal>: Sync, BoxRaw<(String, Vec<String>)>: Sync, NodeRef<Owned, String, String, LeafOrInternal>: Sync, BoxRaw<(String, String)>: Sync,

§

impl Unpin for ClientMsg
where *const u8 is !null: Unpin, *const LeafNode<String, bool> is !null: Unpin, Box<(String, bool)>: Unpin, *const LeafNode<String, Value> is !null: Unpin, Box<(String, Value)>: Unpin, *const LeafNode<String, Show> is !null: Unpin, Box<(String, Show)>: Unpin, *const LeafNode<String, Vec<String>> is !null: Unpin, Box<(String, Vec<String>)>: Unpin, *const LeafNode<String, String> is !null: Unpin, Box<(String, String)>: Unpin,

§

impl UnsafeUnpin for ClientMsg

§

impl UnwindSafe for ClientMsg

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.