bots-garden/sidekickspublic Fork
⑂ v1.7.0
Commits
⬇ Clone ▾
git clone https://git.rickub.com/bots-garden/sidekicks.git
git clone ssh://git@rickub.com/bots-garden/sidekicks.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP
agents-and-events.md · 313 lines · 38.3 KBmarkdown
Blame HistoryOpen raw

Reference: agents, channels and events

Agent states

State Shown as Meaning
stopped stopped No process. The initial state of every agent.
starting starting… The process is launched and the ACP handshake (initialize) is in progress.
ready ready Running and idle.
busy busy Running and used by at least one conversation.
error error The start failed, or the process exited on its own (crash). The status carries the reason, followed by the agent's last stderr lines for a failed start.

outdated (shown as "restart to apply changes") is set on a running agent whose definition changed in the configuration; a restart applies it.

Transitions

From Event To
stopped, error start requested (▶ in the Agents panel, or first use) starting
starting handshake succeeds ready
starting handshake fails, protocol other than ACP v1, timeout (30 s) error
ready used busy
busy last user done ready
ready, busy stop requested (■), application quits, agent removed from the configuration stopped
ready unused for limits.stopIdleAgentsAfter (checked every 30 s) stopped
ready another agent must start and this one is the least recently used idle agent stopped
ready, busy the process exits on its own error (never restarted automatically)
starting stop requested stopped once the start ends

When limits.maxRunningAgents agents are running and all are busy, a start is refused with the message too many agents running: N agent(s) busy (…), the limit is N.

Stopping an agent closes its stdin, waits 5 seconds, then kills its process group (the agent and what it started, such as mm under scripts/agents.sh).

Events from Go to the interface

Event Payload Sent when
config:changed {path, valid, problems[]} The configuration file was saved and reloaded (valid or not).
agent:state {agent, state, error?} An agent changes state or its definition changes.
agent:log {agent, line} An agent writes a line on its standard error, or a sandbox command of the agent prints one (prefixed with sandbox: ).
agent:progress {agent, step, line, since} A starting agent moved to another step — checking (its sandbox or container is looked at), preparing (it is created or started: a line came from its lifecycle command), connecting (its program starts and answers initialize) — or printed a line (line, without the sandbox: prefix of the log); since is when the start began, in Unix milliseconds (issue #98). The conversation shows a progress card with the step, the time elapsed and the last line (a bar when it holds a percentage or done/total sizes); the Agents panel shows the step. Ends with the next agent:state.
files:dropped {target, files[]} Files are dropped from the system on an element marked data-file-drop-target; target is its id, files their absolute paths.

The Go names and types are in internal/events; the TypeScript constants and types are generated in frontend/bindings/events and frontend/bindings/…/internal/events.

Services called by the interface

Service Method Effect
AgentService List() Every agent with name, title, icon, description, state, error, outdated, runtime, canStopSandbox, canRemoveSandbox (and, while starting, step, since as agent:progress gives them; signIn: the program its terminal runs to sign in with an account instead of an API key — claude for claude-agent-acp, agy for agy acp (issue #109), in an sbx sandbox, issues #105 and #106; oauth: the kind whose account sign-in it takes — codex for codex-acp in an sbx sandbox, issue #107), in configuration order.
Start(name), Stop(name), Restart(name) As in the transitions above; an error is returned to the interface. A start first recreates a missing sandbox when runtime.lifecycle.create is set.
StopSandbox(name), RemoveSandbox(name) Stops the agent, then runs runtime.lifecycle.stop or remove (container or sandbox); the output goes to the agent's log.
Unload(name) Has a running, idle agent that announced the unload command unload its model (issue #51): /unload is sent in a session of its own, which no conversation shows; the answer goes to the agent's log as unload: … lines. Errors: unknown agent, the agent is not running…, the agent is answering…, this agent cannot unload its model….
UnloadAll() Unload for every running agent: returns {unloaded[], skipped[]} (agent names); stopped agents are left out.
Logs(name) The last 200 stderr lines of the agent.
ConfigService Current() path, source, created, valid, problems[], warnings[], theme, language, historyProblem.
SystemService Memory() level (normal, warning, critical), used and total in bytes; all empty (total 0) where the memory cannot be measured. macOS: the level of kern.memorystatus_vm_pressure_level, used = app + wired + compressed memory (vm_stat), as in Activity Monitor. Linux and Windows: worked out from the available memory, warning under 20 %, critical under 10 %. The Log panel calls it every 5 seconds while it is open (issue #61).

Channels (milestones M2 and M3)

A channel holds a conversation between the user and one or several agents. A direct conversation is a channel with one member, no name, and direct set to its agent's name. Channels, members and finished messages are kept in the history of the configuration file (below); a streaming answer is kept once it ends.

Channels

Field Meaning
id sortable identifier
name, description 1 to 64 characters, unique whatever the case; empty for a direct conversation
direct the agent of a direct conversation; empty for a channel
members agent names, in the order they joined

Who answers a message

The message Answered by
/agent:command arguments (agent is a configured agent) that agent, which receives /command arguments
starts with the word /parallel (issue #89), in a channel the agents it mentions, at the same time, each with its part, no more at once than limits.maxRunningAgents (the others wait, in the order of the mentions); the rest of the message follows the rules below and the agents never receive /parallel. None sees the others' answers of that message: they are unseen messages for the next one. Hand-offs come after, one after the other. With fewer than two agents, or in a direct conversation, /parallel is left out. /parallel alone is an empty message
contains @name mentions of configured agents the mentioned agents, one after the other, in the order of the mentions; a mentioned agent that is not a member joins first. With several agents, each one receives only its part instead of the text: the words after its mention, up to the next answering agent's mention, without a linking word (then, and, puis, et…); the whole text when the part has fewer than two words
no mention the last agent who answered in the channel; with a single member, that member
no mention and nobody answered yet, several members nobody: system message no-recipient
any message in a direct conversation its agent; mentions are plain text there
an agent's answer, in a channel, mentions other members with @name (issue #26) those members answer next, in order, each told who addressed it; not the agent itself, not an agent that answers the message anyway, not a non-member, not a mention inside code, not the answer to a command. At most limits.maxAgentHandoffs hand-offs per user message (3 by default; 0 turns it off), then the system message handoff-limit; ■ stops the whole chain

A message starting with / (possibly after mentions) is a command: it is sent alone. Any other message is sent with the channel messages the agent has not seen yet (at most the last 20, each cut at 1500 characters). An agent answers one channel at a time; a channel waiting for it shows whose turn it is.

Joined files

A $path at the start of a word joins the file at path of an agent's folder (issue #53): in a direct conversation, its agent's; in a channel, the first agent mentioned with @, otherwise the first member's. A $ inside code, after another character (5$), escaped (\$) or followed by no letter ($5) is text; punctuation ending a sentence is not part of the path. A path ends at the first space.

Each agent that answers receives the files with the message (not with a slash command), as ACP content blocks chosen from what it announced:

File promptCapabilities Sent as
image (image/*) image image block (base64), with its URI
text, 1 MB at most embeddedContext resource block with the text
any other text or image — resource_link: URI file:// + the path as the agent sees it, name, type, size
neither text nor image — not sent: attachment-unavailable

A file is read when the agent's turn comes (5 MB at most); one that cannot be read gives attachment-unavailable, and the agent answers without it.

Messages

Field Meaning
id, channel, createdAt identity
agent the author of an agent message, or the agent a system message is about
role user, agent or system
parts text (Markdown), thought (reasoning), tool (a tool call), plan (plan entries)
done false while an agent message streams
queued a user message waiting for the current answers
stopReason how an agent message ended: end_turn, cancelled, max_tokens, max_turn_requests, refusal
error why an agent message ended without a stop reason (the agent's own explanation), or cancelled for a queued message dropped by Stop
code system messages: agent-joined, agent-left, no-recipient, agent-unavailable (could not start or reach it; error says why), attachment-unavailable (a joined file was not sent to agent; error names it and says why), handoff-limit (agent mentioned a member, but the message was already handed on limits.maxAgentHandoffs times)
attachments user messages: the files joined with $path, as {agent, path} (the agent whose folder holds it). Only the reference is kept, never the content.

A tool call has id, title, kind (read, edit, delete, move, search, execute, think, fetch, other), status (pending, in_progress, completed, failed), input (compact JSON), output, locations, diffs (path, oldText, newText, newFile).

Events

Event Payload Sent when
channels:changed {channels[]} a channel is created, renamed or deleted, or its members change
message:updated {channel, message} a message is added, or finished
message:delta {channel, messageId, index, kind, text?, part?} text is appended to the part at index (text, thought), or part replaces it (tool, plan)
turn:changed {channel, busy, queued, answering, answerers} the channel starts or stops answering, or an agent's turn begins or ends; queued messages wait; answerers are all the agents answering (several after /parallel), answering the first of them
permission:requested {id, channel, agent, messageId, toolCall, options[], rejections} an agent asks to run a tool; rejections counts the refusals already given in this turn
permission:resolved {id, channel} the request was answered, or cancelled by Stop
form:requested {id, channel, agent, messageId, form: {message, fields[], sessionId, toolCallId}} an agent asks the user to fill in a form (ACP elicitation/create, form mode; mini-me's ask_user, issue #95); the fields are those of CreatorService's forms
form:resolved {id, channel} the form was answered or declined, or cancelled by Stop or the end of the turn
usage:changed {channel, agent, usage: {used, size}} an agent reported its context window use (size is 0 when unknown)
commands:changed {agent, commands[]} an agent announced its slash commands (name, description, hint)

ChannelService

Method Effect
List() Every channel and direct conversation, oldest first.
Create(name, description) Creates a channel. A taken or empty name is an error.
Rename(id, name, description) Renames a channel (not a direct conversation).
Delete(id) Stops its answers, then deletes the channel and its whole history.
Clear(id) Erases every message of a channel or direct conversation and keeps its name, description and members. The members' sessions are forgotten (sessionId and lastSeen emptied): their next turn opens a new session, which knows nothing of what was erased; the usage is reset. Refused while the channel answers or has queued messages (an agent is answering in this channel…). Sends channels:changed.
AddMember(id, agent), RemoveMember(id, agent) Invites or removes an agent; the channel shows agent-joined or agent-left.
Direct(agent) The direct conversation with agent, created the first time.
Send(id, text) Adds a user message and returns its id; the agents that answer are started if needed; the message is queued if the channel is answering. Empty text and unknown channels are errors. Each $path joins a file of an agent's folder (see Joined files); more than 10 is an error.
Cancel(id) Stops the current answer (session/cancel), the agents still to answer and the queued messages; answers pending permission requests and forms "cancelled".
AnswerPermission(id, optionId) Answers a pending request with one of its options.
AnswerForm(id, answer) Answers a pending form: {action: "accept", content: {name: value…}}, decline or cancel. An unknown form or action is an error.
Conversation(id) channel, messages (the last 100), more, busy, queued, answering, answerers, usage{agent: …}, permissions, forms.
Older(id, beforeId) {messages, more}: the 100 messages before beforeId.
TrustFolder(id, agent) Tells the agent to trust its folder for good, from its session in channel id (issue #125): Mistral Vibe ignores a folder's AGENTS.md, skills and .vibe/ until it is trusted. Sends the ACP extension _trust/decision (trust_cwd, else trust_repo, from the decisions the agent offered in the _meta.workspace_trust of its session/new answer), then opens a new session at the agent's next turn. A session that opens on an untrusted folder holding such files adds a workspace-untrusted system message (error: the files); trusting it, workspace-trusted.
Prompts(id) The last 100 messages the user wrote in the channel (or direct conversation) id, oldest first, without consecutive repeats, read from the history: what ↑ brings back in its message box (issue #118).
Commands(agent) The commands the agent announced last, kept from one run to the next; empty if it never announced any.
Prepare(id) Starts the members of the channel that never announced their commands and opens their session for it (no model is loaded); returns once the sessions are open, the commands arrive as commands:changed. A member answering elsewhere is skipped. The session serves the member's first answer, which is still told the channel's past.

History

Location <user config dir>/sidekicks/data/<16 hex characters>/: one Pebble database per configuration file (the hash of its absolute path). <user config dir> is ~/Library/Application Support on macOS, $XDG_CONFIG_HOME or ~/.config on Linux.
Kept channels, members (with each agent's ACP session id and the last message it saw), finished messages, the last commands of each agent
Not kept pending permission requests, queued messages, an answer interrupted by quitting
Unavailable if the database cannot be opened (another Sidekicks uses the same file), the history lives in memory until Sidekicks quits, and ConfigService.Current().historyProblem says why
After a restart an agent that supports session/load resumes its session; otherwise its first prompt in a channel carries the last messages of that channel

Workspaces (milestone M4)

An agent's workspace is its workspace folder, reached according to runtime.type.

Runtime Files Changes followed Terminal Deletion
local directly file system notifications (not inside .git, node_modules), half a second after the last change $SHELL -l (else bash, else sh) in a pseudo-terminal to the system trash (~/.Trash, or the freedesktop.org trash); for good if the trash is on another disk
container docker exec in workspacePath (default: the same path as workspace) dates and sizes compared every 2 s docker exec -it: bash if present, else sh for good
sbx sbx exec in workspacePath (default: the same path as workspace, where sbx mounts the host folder) dates and sizes compared every 2 s sbx exec -it: bash if present, else sh for good

Paths are relative to the folder and use /. A path leaving the folder (.., absolute, a symbolic link pointing out) is refused. The folder itself cannot be deleted.

Files

Field Meaning
name, path the entry's name, and its path from the folder
dir a folder
size, modTime size in bytes, last change

A file opened for editing has path, content, version; version identifies the content.

WorkspaceService

Method Effect
Info(agent) {location, problem, revealable}: where the folder is (local · /path, container name · /path), or why it cannot be shown; revealable when the folder is on this computer (issue #74).
List(agent, dir) The entries of dir ("" is the folder), folders first, then by name.
Read(agent, path) A text file of at most 1 MB; a binary or larger file is an error.
Instructions(agent) The agent's instructions (issue #113): {file, exists, content, version, files} — the first of files (from its program: CLAUDE.md then AGENTS.md for Claude, AGENTS.md then GEMINI.md for Antigravity, else AGENTS.md) that exists at the root of its folder, else the first one, to create.
CreateInstructions(agent, content), SaveInstructions(agent, content, version), ImportInstructions(agent, hostPath), DeleteInstructions(agent), ChooseInstructions() Write the instruction file — the only way to, as it is protected (protect): from a template (refused when it exists), edited over version ({instructions, conflict}; conflict and nothing written when it changed), or copied from a UTF-8 text file of this computer (1 MiB at most; replaces it). DeleteInstructions removes that file only, to the trash on this computer (issue #122). For an agent in a container or a sandbox, its folder on this computer is used when it exists.
Skills(agent), CreateSkill(agent, name, content), ReadSkill(agent, path), SaveSkill(agent, path, content, version), ImportSkill(agent, hostPath), DeleteSkill(agent, path), ChooseSkillFolder() The agent's skills (issue #112): {dir, skills: [{folder, name, description, path}]} — the folders of its skills folder (from its program: .claude/skills for Claude, .vibe/skills for Vibe, skills or the skillsDir of its agent.yaml for mini-me, else .agents/skills) that hold a SKILL.md, with the name and description of its front matter. Create (name: lowercase letters, digits and -; refused when taken), save a SKILL.md over version ({file, conflict}), import a folder holding a SKILL.md (its files, hidden ones aside; 200 files and 20 MiB at most) or one Markdown file (.md, becomes <name>/SKILL.md; another file is refused); mini-me's <name>.md skills are listed too. DeleteSkill removes a skill's folder (or its <name>.md), to the trash on this computer, nothing else (issue #119). For an agent in a container or a sandbox, its folder on this computer is read and written when it exists.
Save(agent, path, content, version) Writes the file if it still has version; otherwise {conflict: true} and nothing is written. An empty version overwrites. The file is written next to its place and moved over it.
Create(agent, dir, name) Creates an empty file; refused if the name exists or contains /.
Remove(agent, path) Deletes a file or a folder with its content (see the table above).
RemoveAll(agent, paths) Deletes several files and folders (a path inside another one of the list is skipped); nothing is deleted when one of them is protected or holds a protected file. Issue #70.
Rename(agent, from, to) Renames or moves a file or a folder to the path to (its folders are created); returns the new path. Refused when to exists, leaves the folder, is inside from, or when from or to is protected. Issue #70.
Move(agent, paths, dir) Moves files and folders into dir ("" is the top), keeping their names; returns their new paths. Stops at the first that cannot move. Issue #70.
Duplicate(agent, paths) Copies files and folders next to themselves under a free name with -copy before the extension; returns the copies' paths. A copy whose path is protected is refused. Issue #70.
CreateFolder(agent, dir, name) Creates an empty folder; refused if the name exists or contains /. Issue #70.
Attach(agent, hostPath) Joins a file of this computer to a message: returns its path in the agent's folder, to write after $. A file already in the folder is used where it is; any other is copied into attachments/ (a free name, spaces turned into -, 5 MB at most).
ChooseAttachment() Shows the native file dialog, from the home folder; returns the chosen path, or "".
Image(agent, path) An image of the folder (.png, .jpg, .gif, .webp, .svg…, 5 MB at most) as a data: URL, for the preview. Any other file is an error.
Watch(agent), Unwatch() Follows the changes of one agent's folder, announced by workspace:changed.
Link(agent, href) {path, revealable}: the file of the agent's folder a link of its answer leads to — a relative path, an absolute path inside the folder (as the agent or this computer sees it), or a file:// URL; the anchor and query are dropped, %xx decoded. The file need not exist yet. revealable when it is on this computer. Any other link, or a path leaving the folder, is an error (this link is not a file of the agent's folder). Issue #65.
Reveal(agent, path) Shows the file in the file manager: open -R (macOS), explorer /select, (Windows), xdg-open of its folder (Linux). Only for a file of the folder on this computer.

TerminalService

Method Effect
Open(agent, cols, rows) Starts a shell in the agent's folder; returns its id.
Write(id, data) Sends keystrokes.
Resize(id, cols, rows) Changes the size, in characters.
Close(id) Hangs up the shell and everything it started (its descendants' process groups), background jobs included, then kills what is left after a second; in a container, inside the container too.

Events

Event Payload Sent when
workspace:changed {agent} files changed in the folder being watched
terminal:output {id, data} the terminal printed something; grouped every 16 ms or 32 KB, never cutting a character
terminal:exit {id} the shell exited

Settings methods of ConfigService

Method Effect
Content() The text of the configuration file.
Validate(text) The problems and warnings of text, with line, column, message, warning, without saving.
Save(text) Writes text if it is valid; otherwise returns its problems and writes nothing.
Schema() The configuration JSON Schema.
Open(path) Stops the answers and every agent, closes the history, loads and watches path with its own history, remembers it.
Choose() Shows the native file dialog and opens the chosen file; returns "" when cancelled.
Recent() The configuration files opened from the application, most recent first (8 at most).
ReadSandboxEnv(path) Reads an sbx environment file for the assistant: name, workspace, sandboxFolder, createCommand, stopCommand, removeCommand (commands on one line). A file that is not one is an error.
ChooseSandboxEnv() Shows the native file dialog, from the home folder, for an sbx environment file; returns its path, or "" when cancelled.
ChooseAgentConfig() The same, for an agent's configuration file (YAML).
ReadCompose(path) Reads a Docker Compose file for the assistant: folder, and each service's name, container, createCommand, stopCommand, removeCommand. A file without services is an error.
ChooseCompose() The native file dialog, for a Compose file.
Reset(choice) The Danger zone: settings (default configuration, preferences forgotten), history (this configuration's), allHistory (every configuration's) or everything. Each thing reset is first kept as a dated copy; returns {copies[]}. The history is reopened empty and the declared channels created again; then config:changed is sent.
Removal(agent), DeleteAgent(agent, {sandbox, folder}) Deleting an agent (issue #128). Removal says what may go with it: sandbox (its runtime.lifecycle has a remove command) and folder (its folder when it is directly in agentsFolder — the lifecycle folder, else the workspace — i.e. made by an assistant; otherwise ""). DeleteAgent stops it, runs the remove command when sandbox, deletes its direct conversation and takes it out of the channels in the history, removes its entry from the configuration and from the agents of the channels the file declares (comments kept), and puts its folder in the trash when folder. Returns {problems[]}: what could not be done; only the configuration failing is an error. Its name is then free again.

CreatorService

The assistant that creates a mini-me agent (issue #94, How to create a mini-me agent). Sidekicks is the ACP client of mm --acp-create --project yes --output .mm/agent.yaml (mini-me 1.0.9 and later): mm's mm init wizard, with the .mm layout imposed and neither of those two questions asked. Sidekicks advertises clientCapabilities.elicitation.form and shows each elicitation/create form of mm (fields in the order of required; string with enum → choice, boolean, array → several choices, number, other string → text). The wizard works in a temporary folder <agentsFolder>/.sidekicks-new-agent-…, because the agent's name, which names its folder, comes near the end. One wizard at a time.

Method Effect
Start() Runs mm --version (mini-me (mm) is not installed; mini-me (mm) 1.0.8 is too old: version 1.0.9 or later is needed; a version mm cannot tell is accepted), closes a wizard left open, creates the temporary folder (and removes those older than a day), starts mm there and sends /start. Returns {view, agentsFolder, version, taken[]} (taken: the names of the agents and of the folders of the agents' folder, issue #99).
Answer(answer) Answers the form shown: {action: "accept", content: {name: value…}}, decline or cancel. Returns the next view.
Send(text) Sends a message to mm (/back, /restart, /start…); refused while a form waits (decline it first). Returns the next view.
Finish({name, title, icon, environment}) Renames the temporary folder <agentsFolder>/<name> (mode 0755), then, for container or sbx, starts mm again in it and sends /dockerinit or /sbxinit; adds the agent with mm --acp --config <folder>/.mm/agent.yaml, through docker exec -i <container> or sbx exec -i <sandbox> with the lifecycle commands of the compose.yaml or sbxenv.yaml (as the "add an agent" assistant does with a dropped file), its title title, else acp.title. Returns {problem, problems[], name, folder, messages[]}: problem is nameTaken, folderExists or invalidName when nothing was changed and another name can be tried; problems are the configuration's. An existing folder is never touched.
Cancel() Stops mm; before Finish, removes the temporary folder. Also done when Sidekicks quits.

A view is {messages[], form, written, name, title}: mm's messages since the last call (each one whole), the form waiting ({message, fields[{name, title, description, type, options[], default, required}]}, null when none), and, once .mm/agent.yaml exists, written with mm's acp.name (turned into a valid name) and acp.title. The page shows mm's ⚠️ messages and folds the others; a model field asked as text means that no model server answered.

SbxCreatorService

The assistant that creates an agent in a Docker Sandbox (issue #96, How to create a Claude, Antigravity, Codex, Vibe or Copilot agent in a sandbox). The kinds it offers are a catalogue (internal/sbxcreate; there is no template file — How to add a kind of agent to the sandbox assistant): one entry per kind, with what its sbxenv.yaml holds, how Sidekicks starts it, and its default icon: its brand's logo (issue #100).

Kind agent: Kit Program in the sandbox sbx secret
claude (logo:claude) claude docker.io/sbx/claude-acp:latest claude-agent-acp anthropic
antigravity (logo:antigravity) antigravity docker.io/sbx/antigravity:latest agy acp google
codex (logo:openai) codex docker.io/sbx/codex-acp:latest codex-acp openai
vibe (logo:mistral) vibe docker.io/sbx/vibe-kit:latest vibe-acp mistral
copilot (logo:copilot) copilot docker.io/sbx/copilot-kit:latest copilot --acp --stdio copilot and github (the same GitHub token, issue #103)
Method Effect
Kinds() The catalogue, in order: {id, title, icon, agent, kit, program, service, keyUrl, token, fromGh, signIn, oauth} (oauth: the service also takes a sign-in with an account, sbx secret set <service> --oauth — Codex: ChatGPT, issue #107) (signIn: the program to run in the agent's terminal to sign in with an account — Claude: claude, then /login, issue #105; Antigravity: agy, issue #109) (token: the secret is a token of the user's account, not an API key — Copilot; the assistant says "token"; fromGh: it can come from gh auth token). A kind may give its secret to more sbx services (Copilot: github too, with api.github.com and github.com in its bindings).
Check(kind) sbx is not installed when sbx cannot be found (sbx in PATH, /usr/local/bin, /opt/homebrew/bin). Returns {hasKey, name, agentsFolder, taken[], gh, ghSignedIn} (hasKey: every service of the kind holds a secret; gh, ghSignedIn: for a kind with fromGh, whether gh is installed and has a token) (taken: the names used by an agent, a folder or a sandbox, issue #99): whether sbx secret ls --service <service> shows a global secret, and the first free name among <kind>, <kind>-2… — free as an agent of the configuration, a folder of the agents' folder and a sandbox (sbx ls -q).
SetKey(kind, key) sbx secret set <service> for each service of the kind, with the key on its standard input — never in its arguments, a file or a log; an error never repeats it. Global: every sandbox gets it.
Login() Runs sbx login (issue #97) — or joins the one in progress — and returns once sbx printed its device code and URL, 20 seconds at most: {code, url, done, user, error, output[]}. The code is the first XXXX-XXXX, the URL the first https://… naming login; output keeps every line for when sbx prints something else. Its standard input is empty: a question asked on the keyboard gets no answer.
LoginStatus() Waits, 20 seconds at most, for sbx login to end and returns the same state; done with user (from Signed in as <user>.) when signed in, else error (cancelled after CancelLogin). The interface calls it again until done.
CancelLogin() Stops sbx login; also done when Sidekicks quits.
UseGitHub(kind) For a kind with fromGh (issue #103): runs gh auth token and stores what it prints as with SetKey — as sbx secret set <service> --command 'gh auth token' would, for each service. gh is not signed in to GitHub when gh has no token, gh is not installed without gh (gh in PATH, /opt/homebrew/bin, /usr/local/bin). The token is never shown, written or logged.
GitHubLogin(), GitHubLoginStatus(), CancelGitHubLogin() Like Login, LoginStatus and CancelLogin, for gh auth login --web --hostname github.com --git-protocol https (issue #103): its code (XXXX-XXXX), its URL (https://github.com/login/device), then user from ✓ Logged in as <user>.
OAuthLogin(kind), OAuthLoginStatus(), CancelOAuthLogin() For a kind with oauth (issue #107): runs sbx secret set <service> --oauth, which opens a browser window; returns once it printed a page to open (url, or after 20 seconds), then like LoginStatus. ok when sbx ended without an error (it names nobody).
Create({kind, name, title, icon}) Writes <agentsFolder>/<name>/sbxenv.yaml (name: <name>, the kind's agent: and kit, workspace: ./workspace, bindings of its service, pullPolicy: always, English comments) and workspace/, then adds the agent: sbx exec -i <name> <program>, workspace <folder>/workspace, runtime.lifecycle in <folder> (sbx env create --force, sbx stop <name>, sbx env rm --force) — the sandbox is created at the first start. Returns {problem, problems[], name, folder}: problem is invalidName (lowercase letters, digits and -: no _, which sbx refuses), nameTaken, folderExists or sandboxExists when nothing was written.

Tools offered to the agents

Issues #90 and #91. Sidekicks offers every agent six tools, as agentTools allows (all by default), with mini-me's protocol (org.mini-me/tools, ACP extension methods). An agent that knows it (acp.clientTools in an mm file) gives them to its model as client_<name>; the others ignore them. Few ACP agents discover a client's tools: among the agents Sidekicks documents, only mini-me does (not Claude, Codex, Gemini nor docker-agent).

Tool (the model sees) Method Returns
memory_pressure (client_memory_pressure) _com.rickub.sidekicks/system/memory Memory pressure: warning (yellow). Used: 24.0 GB of 32.0 GB (75 %)., as the Log panel shows it (Watch the memory pressure); The memory cannot be measured on this computer. where it cannot be
about_sidekicks (client_about_sidekicks) _com.rickub.sidekicks/about Sidekicks' version (info.version of build/config.yml, dev for a development build), the system and architecture, what Sidekicks is, the agent's name in it, the releases page
list_channels (client_list_channels) _com.rickub.sidekicks/channels/list Every channel, oldest first, without the direct conversations: #name: description. Members: @a (you), @b. 12 messages, the last on 2026-11-10 14:05.
list_agents (client_list_agents) _com.rickub.sidekicks/agents/list Every agent of the configuration: @name (you), title: description. Runs on the user's computer (or in a Docker container, in an sbx sandbox) ; ready. (its state: stopped, starting, ready, busy, error)
search_messages (client_search_messages) _com.rickub.sidekicks/messages/search The user and agent messages of a channel that contain query, case and accents ignored, the most recent first: - 2026-11-10 14:05, @alice: …excerpt around the match… (80 characters on each side). Parameters: query (required), channel (general, #general, or @alice for a direct conversation; default: the channel of the call's session), limit (default 10, at most 50). The whole stored history is read, not only the messages shown. An unknown channel is an error that lists the channels (a direct conversation is searched with @agent, it is not listed)
current_channel (client_current_channel) _com.rickub.sidekicks/channel/current Channel #<name>., its description and its members (you (@agent), @other, and the user.), or A direct conversation between the user and you (<agent>)…. The channel is the one whose session (_meta["org.mini-me/sessionId"] of the call) the agent holds; a session of no channel is an error

Only search_messages takes parameters; its inputSchema says query is required. list_channels and search_messages read every channel, not only the ones the agent is a member of (it already reads those): leave them out of agentTools.offer when that is not wanted. A tool left out, or every tool with enabled: false, is not announced, and its method answers -32601. The protocol:

Step What Sidekicks does
initialize clientCapabilities._meta["org.mini-me/tools"] holds the list (name, description, method), or true when the agent's file says acp.clientTools.discovery: request. The file is the one after --config (or -config) in the agent's arguments, relative to its folder; without it, or unreadable, meta. clientInfo.version is Sidekicks' version
_org.mini-me/tools/list answered with {"tools": [...]}
a tool's method answered with {"content":[{"type":"text","text":"…"}],"isError":false}; a failure has isError: true and says why
any other _… method JSON-RPC error -32601 (Method not found)

When an agent starts, its log gets sidekicks: tools offered (meta|request): <names>, or sidekicks: no tool offered (agentTools). With acp.clientTools.permissions: ask (or auto without yolo), mm asks before each call: the permission card shows client: <name>.

Stopping an agent

The agent's stdin is closed; after 5 s the agent and its children get SIGTERM (time for scripts/agents.sh to unload the model); after 3 more seconds, SIGKILL.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
# Reference: agents, channels and events

## Agent states

| State | Shown as | Meaning |
| --- | --- | --- |
| `stopped` | stopped | No process. The initial state of every agent. |
| `starting` | starting… | The process is launched and the ACP handshake (`initialize`) is in progress. |
| `ready` | ready | Running and idle. |
| `busy` | busy | Running and used by at least one conversation. |
| `error` | error | The start failed, or the process exited on its own (crash). The status carries the reason, followed by the agent's last stderr lines for a failed start. |

`outdated` (shown as "restart to apply changes") is set on a running agent whose definition changed in the configuration; a restart applies it.

## Transitions

| From | Event | To |
| --- | --- | --- |
| `stopped`, `error` | start requested (▶ in the Agents panel, or first use) | `starting` |
| `starting` | handshake succeeds | `ready` |
| `starting` | handshake fails, protocol other than ACP v1, timeout (30 s) | `error` |
| `ready` | used | `busy` |
| `busy` | last user done | `ready` |
| `ready`, `busy` | stop requested (■), application quits, agent removed from the configuration | `stopped` |
| `ready` | unused for `limits.stopIdleAgentsAfter` (checked every 30 s) | `stopped` |
| `ready` | another agent must start and this one is the least recently used idle agent | `stopped` |
| `ready`, `busy` | the process exits on its own | `error` (never restarted automatically) |
| `starting` | stop requested | `stopped` once the start ends |

When `limits.maxRunningAgents` agents are running and all are `busy`, a start is refused with the message `too many agents running: N agent(s) busy (…), the limit is N`.

Stopping an agent closes its stdin, waits 5 seconds, then kills its process group (the agent and what it started, such as `mm` under `scripts/agents.sh`).

## Events from Go to the interface

| Event | Payload | Sent when |
| --- | --- | --- |
| `config:changed` | `{path, valid, problems[]}` | The configuration file was saved and reloaded (valid or not). |
| `agent:state` | `{agent, state, error?}` | An agent changes state or its definition changes. |
| `agent:log` | `{agent, line}` | An agent writes a line on its standard error, or a sandbox command of the agent prints one (prefixed with `sandbox: `). |
| `agent:progress` | `{agent, step, line, since}` | A starting agent moved to another step — `checking` (its sandbox or container is looked at), `preparing` (it is created or started: a line came from its lifecycle command), `connecting` (its program starts and answers `initialize`) — or printed a line (`line`, without the `sandbox: ` prefix of the log); `since` is when the start began, in Unix milliseconds (issue #98). The conversation shows a progress card with the step, the time elapsed and the last line (a bar when it holds a percentage or `done/total` sizes); the Agents panel shows the step. Ends with the next `agent:state`. |
| `files:dropped` | `{target, files[]}` | Files are dropped from the system on an element marked `data-file-drop-target`; `target` is its `id`, `files` their absolute paths. |

The Go names and types are in `internal/events`; the TypeScript constants and types are generated in `frontend/bindings/events` and `frontend/bindings/…/internal/events`.

## Services called by the interface

| Service | Method | Effect |
| --- | --- | --- |
| `AgentService` | `List()` | Every agent with `name, title, icon, description, state, error, outdated, runtime, canStopSandbox, canRemoveSandbox` (and, while starting, `step, since` as `agent:progress` gives them; `signIn`: the program its terminal runs to sign in with an account instead of an API key — `claude` for `claude-agent-acp`, `agy` for `agy acp` (issue #109), in an sbx sandbox, issues #105 and #106; `oauth`: the kind whose account sign-in it takes — `codex` for `codex-acp` in an sbx sandbox, issue #107), in configuration order. |
| | `Start(name)`, `Stop(name)`, `Restart(name)` | As in the transitions above; an error is returned to the interface. A start first recreates a missing sandbox when `runtime.lifecycle.create` is set. |
| | `StopSandbox(name)`, `RemoveSandbox(name)` | Stops the agent, then runs `runtime.lifecycle.stop` or `remove` (container or sandbox); the output goes to the agent's log. |
| | `Unload(name)` | Has a running, idle agent that announced the `unload` command unload its model (issue #51): `/unload` is sent in a session of its own, which no conversation shows; the answer goes to the agent's log as `unload: …` lines. Errors: unknown agent, `the agent is not running…`, `the agent is answering…`, `this agent cannot unload its model…`. |
| | `UnloadAll()` | `Unload` for every running agent: returns `{unloaded[], skipped[]}` (agent names); stopped agents are left out. |
| | `Logs(name)` | The last 200 stderr lines of the agent. |
| `ConfigService` | `Current()` | `path, source, created, valid, problems[], warnings[], theme, language, historyProblem`. |
| `SystemService` | `Memory()` | `level` (`normal`, `warning`, `critical`), `used` and `total` in bytes; all empty (`total` 0) where the memory cannot be measured. macOS: the level of `kern.memorystatus_vm_pressure_level`, used = app + wired + compressed memory (`vm_stat`), as in Activity Monitor. Linux and Windows: worked out from the available memory, `warning` under 20 %, `critical` under 10 %. The Log panel calls it every 5 seconds while it is open (issue #61). |

## Channels (milestones M2 and M3)

A channel holds a conversation between the user and one or several agents. A direct conversation is a channel with one member, no name, and `direct` set to its agent's name. Channels, members and finished messages are kept in the history of the configuration file (below); a streaming answer is kept once it ends.

### Channels

| Field | Meaning |
| --- | --- |
| `id` | sortable identifier |
| `name`, `description` | 1 to 64 characters, unique whatever the case; empty for a direct conversation |
| `direct` | the agent of a direct conversation; empty for a channel |
| `members` | agent names, in the order they joined |

### Who answers a message

| The message | Answered by |
| --- | --- |
| `/agent:command arguments` (`agent` is a configured agent) | that agent, which receives `/command arguments` |
| starts with the word `/parallel` (issue #89), in a channel | the agents it mentions, **at the same time**, each with its part, no more at once than `limits.maxRunningAgents` (the others wait, in the order of the mentions); the rest of the message follows the rules below and the agents never receive `/parallel`. None sees the others' answers of that message: they are unseen messages for the next one. Hand-offs come after, one after the other. With fewer than two agents, or in a direct conversation, `/parallel` is left out. `/parallel` alone is an empty message |
| contains `@name` mentions of configured agents | the mentioned agents, one after the other, in the order of the mentions; a mentioned agent that is not a member joins first. With several agents, each one receives only its part instead of the text: the words after its mention, up to the next answering agent's mention, without a linking word (then, and, puis, et…); the whole text when the part has fewer than two words |
| no mention | the last agent who answered in the channel; with a single member, that member |
| no mention and nobody answered yet, several members | nobody: system message `no-recipient` |
| any message in a direct conversation | its agent; mentions are plain text there |
| an agent's answer, in a channel, mentions other **members** with `@name` (issue #26) | those members answer next, in order, each told who addressed it; not the agent itself, not an agent that answers the message anyway, not a non-member, not a mention inside code, not the answer to a command. At most `limits.maxAgentHandoffs` hand-offs per user message (3 by default; `0` turns it off), then the system message `handoff-limit`; **■** stops the whole chain |

A message starting with `/` (possibly after mentions) is a command: it is sent alone. Any other message is sent with the channel messages the agent has not seen yet (at most the last 20, each cut at 1500 characters). An agent answers one channel at a time; a channel waiting for it shows whose turn it is.

### Joined files

A `$path` at the start of a word joins the file at `path` of an agent's folder (issue #53): in a direct conversation, its agent's; in a channel, the first agent mentioned with `@`, otherwise the first member's. A `$` inside code, after another character (`5$`), escaped (`\$`) or followed by no letter (`$5`) is text; punctuation ending a sentence is not part of the path. A path ends at the first space.

Each agent that answers receives the files with the message (not with a slash command), as ACP content blocks chosen from what it announced:

| File | `promptCapabilities` | Sent as |
| --- | --- | --- |
| image (`image/*`) | `image` | `image` block (base64), with its URI |
| text, 1 MB at most | `embeddedContext` | `resource` block with the text |
| any other text or image | — | `resource_link`: URI `file://` + the path as the agent sees it, name, type, size |
| neither text nor image | — | not sent: `attachment-unavailable` |

A file is read when the agent's turn comes (5 MB at most); one that cannot be read gives `attachment-unavailable`, and the agent answers without it.

### Messages

| Field | Meaning |
| --- | --- |
| `id`, `channel`, `createdAt` | identity |
| `agent` | the author of an agent message, or the agent a system message is about |
| `role` | `user`, `agent` or `system` |
| `parts` | `text` (Markdown), `thought` (reasoning), `tool` (a tool call), `plan` (plan entries) |
| `done` | false while an agent message streams |
| `queued` | a user message waiting for the current answers |
| `stopReason` | how an agent message ended: `end_turn`, `cancelled`, `max_tokens`, `max_turn_requests`, `refusal` |
| `error` | why an agent message ended without a stop reason (the agent's own explanation), or `cancelled` for a queued message dropped by Stop |
| `code` | system messages: `agent-joined`, `agent-left`, `no-recipient`, `agent-unavailable` (could not start or reach it; `error` says why), `attachment-unavailable` (a joined file was not sent to `agent`; `error` names it and says why), `handoff-limit` (`agent` mentioned a member, but the message was already handed on `limits.maxAgentHandoffs` times) |
| `attachments` | user messages: the files joined with `$path`, as `{agent, path}` (the agent whose folder holds it). Only the reference is kept, never the content. |

A tool call has `id, title, kind` (`read, edit, delete, move, search, execute, think, fetch, other`), `status` (`pending, in_progress, completed, failed`), `input` (compact JSON), `output`, `locations`, `diffs` (`path, oldText, newText, newFile`).

### Events

| Event | Payload | Sent when |
| --- | --- | --- |
| `channels:changed` | `{channels[]}` | a channel is created, renamed or deleted, or its members change |
| `message:updated` | `{channel, message}` | a message is added, or finished |
| `message:delta` | `{channel, messageId, index, kind, text?, part?}` | `text` is appended to the part at `index` (text, thought), or `part` replaces it (tool, plan) |
| `turn:changed` | `{channel, busy, queued, answering, answerers}` | the channel starts or stops answering, or an agent's turn begins or ends; `queued` messages wait; `answerers` are all the agents answering (several after `/parallel`), `answering` the first of them |
| `permission:requested` | `{id, channel, agent, messageId, toolCall, options[], rejections}` | an agent asks to run a tool; `rejections` counts the refusals already given in this turn |
| `permission:resolved` | `{id, channel}` | the request was answered, or cancelled by Stop |
| `form:requested` | `{id, channel, agent, messageId, form: {message, fields[], sessionId, toolCallId}}` | an agent asks the user to fill in a form (ACP `elicitation/create`, form mode; mini-me's `ask_user`, issue #95); the fields are those of [`CreatorService`](#creatorservice)'s forms |
| `form:resolved` | `{id, channel}` | the form was answered or declined, or cancelled by Stop or the end of the turn |
| `usage:changed` | `{channel, agent, usage: {used, size}}` | an agent reported its context window use (`size` is 0 when unknown) |
| `commands:changed` | `{agent, commands[]}` | an agent announced its slash commands (`name, description, hint`) |

### `ChannelService`

| Method | Effect |
| --- | --- |
| `List()` | Every channel and direct conversation, oldest first. |
| `Create(name, description)` | Creates a channel. A taken or empty name is an error. |
| `Rename(id, name, description)` | Renames a channel (not a direct conversation). |
| `Delete(id)` | Stops its answers, then deletes the channel and its whole history. |
| `Clear(id)` | Erases every message of a channel or direct conversation and keeps its name, description and members. The members' sessions are forgotten (`sessionId` and `lastSeen` emptied): their next turn opens a new session, which knows nothing of what was erased; the usage is reset. Refused while the channel answers or has queued messages (`an agent is answering in this channel…`). Sends `channels:changed`. |
| `AddMember(id, agent)`, `RemoveMember(id, agent)` | Invites or removes an agent; the channel shows `agent-joined` or `agent-left`. |
| `Direct(agent)` | The direct conversation with `agent`, created the first time. |
| `Send(id, text)` | Adds a user message and returns its id; the agents that answer are started if needed; the message is queued if the channel is answering. Empty text and unknown channels are errors. Each `$path` joins a file of an agent's folder (see [Joined files](#joined-files)); more than 10 is an error. |
| `Cancel(id)` | Stops the current answer (`session/cancel`), the agents still to answer and the queued messages; answers pending permission requests and forms "cancelled". |
| `AnswerPermission(id, optionId)` | Answers a pending request with one of its options. |
| `AnswerForm(id, answer)` | Answers a pending form: `{action: "accept", content: {name: value…}}`, `decline` or `cancel`. An unknown form or action is an error. |
| `Conversation(id)` | `channel, messages` (the last 100), `more, busy, queued, answering, answerers, usage{agent: …}, permissions, forms`. |
| `Older(id, beforeId)` | `{messages, more}`: the 100 messages before `beforeId`. |
| `TrustFolder(id, agent)` | Tells the agent to trust its folder for good, from its session in channel `id` (issue #125): Mistral Vibe ignores a folder's `AGENTS.md`, skills and `.vibe/` until it is trusted. Sends the ACP extension `_trust/decision` (`trust_cwd`, else `trust_repo`, from the decisions the agent offered in the `_meta.workspace_trust` of its `session/new` answer), then opens a new session at the agent's next turn. A session that opens on an untrusted folder holding such files adds a `workspace-untrusted` system message (`error`: the files); trusting it, `workspace-trusted`. |
| `Prompts(id)` | The last 100 messages the user wrote in the channel (or direct conversation) `id`, oldest first, without consecutive repeats, read from the history: what ↑ brings back in its message box (issue #118). |
| `Commands(agent)` | The commands the agent announced last, kept from one run to the next; empty if it never announced any. |
| `Prepare(id)` | Starts the members of the channel that never announced their commands and opens their session for it (no model is loaded); returns once the sessions are open, the commands arrive as `commands:changed`. A member answering elsewhere is skipped. The session serves the member's first answer, which is still told the channel's past. |

### History

| | |
| --- | --- |
| Location | `<user config dir>/sidekicks/data/<16 hex characters>/`: one Pebble database per configuration file (the hash of its absolute path). `<user config dir>` is `~/Library/Application Support` on macOS, `$XDG_CONFIG_HOME` or `~/.config` on Linux. |
| Kept | channels, members (with each agent's ACP session id and the last message it saw), finished messages, the last commands of each agent |
| Not kept | pending permission requests, queued messages, an answer interrupted by quitting |
| Unavailable | if the database cannot be opened (another Sidekicks uses the same file), the history lives in memory until Sidekicks quits, and `ConfigService.Current().historyProblem` says why |
| After a restart | an agent that supports `session/load` resumes its session; otherwise its first prompt in a channel carries the last messages of that channel |

## Workspaces (milestone M4)

An agent's workspace is its `workspace` folder, reached according to `runtime.type`.

| Runtime | Files | Changes followed | Terminal | Deletion |
| --- | --- | --- | --- | --- |
| `local` | directly | file system notifications (not inside `.git`, `node_modules`), half a second after the last change | `$SHELL -l` (else bash, else sh) in a pseudo-terminal | to the system trash (`~/.Trash`, or the freedesktop.org trash); for good if the trash is on another disk |
| `container` | `docker exec` in `workspacePath` (default: the same path as `workspace`) | dates and sizes compared every 2 s | `docker exec -it`: bash if present, else sh | for good |
| `sbx` | `sbx exec` in `workspacePath` (default: the same path as `workspace`, where sbx mounts the host folder) | dates and sizes compared every 2 s | `sbx exec -it`: bash if present, else sh | for good |

Paths are relative to the folder and use `/`. A path leaving the folder (`..`, absolute, a symbolic link pointing out) is refused. The folder itself cannot be deleted.

### Files

| Field | Meaning |
| --- | --- |
| `name`, `path` | the entry's name, and its path from the folder |
| `dir` | a folder |
| `size`, `modTime` | size in bytes, last change |

A file opened for editing has `path, content, version`; `version` identifies the content.

### `WorkspaceService`

| Method | Effect |
| --- | --- |
| `Info(agent)` | `{location, problem, revealable}`: where the folder is (`local · /path`, `container name · /path`), or why it cannot be shown; `revealable` when the folder is on this computer (issue #74). |
| `List(agent, dir)` | The entries of `dir` (`""` is the folder), folders first, then by name. |
| `Read(agent, path)` | A text file of at most 1 MB; a binary or larger file is an error. |
| `Instructions(agent)` | The agent's instructions (issue #113): `{file, exists, content, version, files}` — the first of `files` (from its program: `CLAUDE.md` then `AGENTS.md` for Claude, `AGENTS.md` then `GEMINI.md` for Antigravity, else `AGENTS.md`) that exists at the root of its folder, else the first one, to create. |
| `CreateInstructions(agent, content)`, `SaveInstructions(agent, content, version)`, `ImportInstructions(agent, hostPath)`, `DeleteInstructions(agent)`, `ChooseInstructions()` | Write the instruction file — the only way to, as it is protected (`protect`): from a template (refused when it exists), edited over `version` (`{instructions, conflict}`; `conflict` and nothing written when it changed), or copied from a UTF-8 text file of this computer (1 MiB at most; replaces it). `DeleteInstructions` removes that file only, to the trash on this computer (issue #122). For an agent in a container or a sandbox, its folder on this computer is used when it exists. |
| `Skills(agent)`, `CreateSkill(agent, name, content)`, `ReadSkill(agent, path)`, `SaveSkill(agent, path, content, version)`, `ImportSkill(agent, hostPath)`, `DeleteSkill(agent, path)`, `ChooseSkillFolder()` | The agent's skills (issue #112): `{dir, skills: [{folder, name, description, path}]}` — the folders of its skills folder (from its program: `.claude/skills` for Claude, `.vibe/skills` for Vibe, `skills` or the `skillsDir` of its `agent.yaml` for mini-me, else `.agents/skills`) that hold a `SKILL.md`, with the `name` and `description` of its front matter. Create (`name`: lowercase letters, digits and `-`; refused when taken), save a `SKILL.md` over `version` (`{file, conflict}`), import a folder holding a `SKILL.md` (its files, hidden ones aside; 200 files and 20 MiB at most) or one Markdown file (`.md`, becomes `<name>/SKILL.md`; another file is refused); mini-me's `<name>.md` skills are listed too. `DeleteSkill` removes a skill's folder (or its `<name>.md`), to the trash on this computer, nothing else (issue #119). For an agent in a container or a sandbox, its folder on this computer is read and written when it exists. |
| `Save(agent, path, content, version)` | Writes the file if it still has `version`; otherwise `{conflict: true}` and nothing is written. An empty `version` overwrites. The file is written next to its place and moved over it. |
| `Create(agent, dir, name)` | Creates an empty file; refused if the name exists or contains `/`. |
| `Remove(agent, path)` | Deletes a file or a folder with its content (see the table above). |
| `RemoveAll(agent, paths)` | Deletes several files and folders (a path inside another one of the list is skipped); nothing is deleted when one of them is protected or holds a protected file. Issue #70. |
| `Rename(agent, from, to)` | Renames or moves a file or a folder to the path `to` (its folders are created); returns the new path. Refused when `to` exists, leaves the folder, is inside `from`, or when `from` or `to` is protected. Issue #70. |
| `Move(agent, paths, dir)` | Moves files and folders into `dir` (`""` is the top), keeping their names; returns their new paths. Stops at the first that cannot move. Issue #70. |
| `Duplicate(agent, paths)` | Copies files and folders next to themselves under a free name with `-copy` before the extension; returns the copies' paths. A copy whose path is protected is refused. Issue #70. |
| `CreateFolder(agent, dir, name)` | Creates an empty folder; refused if the name exists or contains `/`. Issue #70. |
| `Attach(agent, hostPath)` | Joins a file of this computer to a message: returns its path in the agent's folder, to write after `$`. A file already in the folder is used where it is; any other is copied into `attachments/` (a free name, spaces turned into `-`, 5 MB at most). |
| `ChooseAttachment()` | Shows the native file dialog, from the home folder; returns the chosen path, or `""`. |
| `Image(agent, path)` | An image of the folder (`.png`, `.jpg`, `.gif`, `.webp`, `.svg`…, 5 MB at most) as a `data:` URL, for the preview. Any other file is an error. |
| `Watch(agent)`, `Unwatch()` | Follows the changes of one agent's folder, announced by `workspace:changed`. |
| `Link(agent, href)` | `{path, revealable}`: the file of the agent's folder a link of its answer leads to — a relative path, an absolute path inside the folder (as the agent or this computer sees it), or a `file://` URL; the anchor and query are dropped, `%xx` decoded. The file need not exist yet. `revealable` when it is on this computer. Any other link, or a path leaving the folder, is an error (`this link is not a file of the agent's folder`). Issue #65. |
| `Reveal(agent, path)` | Shows the file in the file manager: `open -R` (macOS), `explorer /select,` (Windows), `xdg-open` of its folder (Linux). Only for a file of the folder on this computer. |

### `TerminalService`

| Method | Effect |
| --- | --- |
| `Open(agent, cols, rows)` | Starts a shell in the agent's folder; returns its id. |
| `Write(id, data)` | Sends keystrokes. |
| `Resize(id, cols, rows)` | Changes the size, in characters. |
| `Close(id)` | Hangs up the shell and everything it started (its descendants' process groups), background jobs included, then kills what is left after a second; in a container, inside the container too. |

### Events

| Event | Payload | Sent when |
| --- | --- | --- |
| `workspace:changed` | `{agent}` | files changed in the folder being watched |
| `terminal:output` | `{id, data}` | the terminal printed something; grouped every 16 ms or 32 KB, never cutting a character |
| `terminal:exit` | `{id}` | the shell exited |

## Settings methods of `ConfigService`

| Method | Effect |
| --- | --- |
| `Content()` | The text of the configuration file. |
| `Validate(text)` | The problems and warnings of `text`, with `line, column, message, warning`, without saving. |
| `Save(text)` | Writes `text` if it is valid; otherwise returns its problems and writes nothing. |
| `Schema()` | The configuration JSON Schema. |
| `Open(path)` | Stops the answers and every agent, closes the history, loads and watches `path` with its own history, remembers it. |
| `Choose()` | Shows the native file dialog and opens the chosen file; returns `""` when cancelled. |
| `Recent()` | The configuration files opened from the application, most recent first (8 at most). |
| `ReadSandboxEnv(path)` | Reads an sbx environment file for the assistant: `name, workspace, sandboxFolder, createCommand, stopCommand, removeCommand` (commands on one line). A file that is not one is an error. |
| `ChooseSandboxEnv()` | Shows the native file dialog, from the home folder, for an sbx environment file; returns its path, or `""` when cancelled. |
| `ChooseAgentConfig()` | The same, for an agent's configuration file (YAML). |
| `ReadCompose(path)` | Reads a Docker Compose file for the assistant: `folder`, and each service's `name, container, createCommand, stopCommand, removeCommand`. A file without services is an error. |
| `ChooseCompose()` | The native file dialog, for a Compose file. |
| `Reset(choice)` | The Danger zone: `settings` (default configuration, preferences forgotten), `history` (this configuration's), `allHistory` (every configuration's) or `everything`. Each thing reset is first kept as a dated copy; returns `{copies[]}`. The history is reopened empty and the declared channels created again; then `config:changed` is sent. |
| `Removal(agent)`, `DeleteAgent(agent, {sandbox, folder})` | Deleting an agent (issue #128). `Removal` says what may go with it: `sandbox` (its `runtime.lifecycle` has a remove command) and `folder` (its folder when it is directly in `agentsFolder` — the lifecycle folder, else the workspace — i.e. made by an assistant; otherwise `""`). `DeleteAgent` stops it, runs the remove command when `sandbox`, deletes its direct conversation and takes it out of the channels in the history, removes its entry from the configuration and from the `agents` of the channels the file declares (comments kept), and puts its folder in the trash when `folder`. Returns `{problems[]}`: what could not be done; only the configuration failing is an error. Its name is then free again. |

## `CreatorService`

The assistant that creates a mini-me agent (issue #94, [How to create a mini-me agent](../how-to/create-a-mini-me-agent.md)). Sidekicks is the ACP client of `mm --acp-create --project yes --output .mm/agent.yaml` (mini-me 1.0.9 and later): mm's `mm init` wizard, with the `.mm` layout imposed and neither of those two questions asked. Sidekicks advertises `clientCapabilities.elicitation.form` and shows each `elicitation/create` form of mm (fields in the order of `required`; `string` with `enum` → choice, `boolean`, `array` → several choices, `number`, other `string` → text). The wizard works in a temporary folder `<agentsFolder>/.sidekicks-new-agent-…`, because the agent's name, which names its folder, comes near the end. One wizard at a time.

| Method | Effect |
| --- | --- |
| `Start()` | Runs `mm --version` (`mini-me (mm) is not installed`; `mini-me (mm) 1.0.8 is too old: version 1.0.9 or later is needed`; a version mm cannot tell is accepted), closes a wizard left open, creates the temporary folder (and removes those older than a day), starts mm there and sends `/start`. Returns `{view, agentsFolder, version, taken[]}` (`taken`: the names of the agents and of the folders of the agents' folder, issue #99). |
| `Answer(answer)` | Answers the form shown: `{action: "accept", content: {name: value…}}`, `decline` or `cancel`. Returns the next `view`. |
| `Send(text)` | Sends a message to mm (`/back`, `/restart`, `/start`…); refused while a form waits (decline it first). Returns the next `view`. |
| `Finish({name, title, icon, environment})` | Renames the temporary folder `<agentsFolder>/<name>` (mode 0755), then, for `container` or `sbx`, starts mm again in it and sends `/dockerinit` or `/sbxinit`; adds the agent with `mm --acp --config <folder>/.mm/agent.yaml`, through `docker exec -i <container>` or `sbx exec -i <sandbox>` with the lifecycle commands of the `compose.yaml` or `sbxenv.yaml` (as the "add an agent" assistant does with a dropped file), its title `title`, else `acp.title`. Returns `{problem, problems[], name, folder, messages[]}`: `problem` is `nameTaken`, `folderExists` or `invalidName` when nothing was changed and another name can be tried; `problems` are the configuration's. An existing folder is never touched. |
| `Cancel()` | Stops mm; before `Finish`, removes the temporary folder. Also done when Sidekicks quits. |

A `view` is `{messages[], form, written, name, title}`: mm's messages since the last call (each one whole), the form waiting (`{message, fields[{name, title, description, type, options[], default, required}]}`, `null` when none), and, once `.mm/agent.yaml` exists, `written` with mm's `acp.name` (turned into a valid name) and `acp.title`. The page shows mm's `⚠️` messages and folds the others; a `model` field asked as text means that no model server answered.

## `SbxCreatorService`

The assistant that creates an agent in a Docker Sandbox (issue #96, [How to create a Claude, Antigravity, Codex, Vibe or Copilot agent in a sandbox](../how-to/create-an-agent-in-a-sandbox.md)). The kinds it offers are a catalogue (`internal/sbxcreate`; there is no template file — [How to add a kind of agent to the sandbox assistant](../how-to/add-a-kind-to-the-sandbox-assistant.md)): one entry per kind, with what its `sbxenv.yaml` holds, how Sidekicks starts it, and its default icon: its brand's logo (issue #100).

| Kind | `agent:` | Kit | Program in the sandbox | sbx secret |
| --- | --- | --- | --- | --- |
| `claude` (`logo:claude`) | `claude` | `docker.io/sbx/claude-acp:latest` | `claude-agent-acp` | `anthropic` |
| `antigravity` (`logo:antigravity`) | `antigravity` | `docker.io/sbx/antigravity:latest` | `agy acp` | `google` |
| `codex` (`logo:openai`) | `codex` | `docker.io/sbx/codex-acp:latest` | `codex-acp` | `openai` |
| `vibe` (`logo:mistral`) | `vibe` | `docker.io/sbx/vibe-kit:latest` | `vibe-acp` | `mistral` |
| `copilot` (`logo:copilot`) | `copilot` | `docker.io/sbx/copilot-kit:latest` | `copilot --acp --stdio` | `copilot` and `github` (the same GitHub token, issue #103) |

| Method | Effect |
| --- | --- |
| `Kinds()` | The catalogue, in order: `{id, title, icon, agent, kit, program, service, keyUrl, token, fromGh, signIn, oauth}` (`oauth`: the service also takes a sign-in with an account, `sbx secret set <service> --oauth` — Codex: ChatGPT, issue #107) (`signIn`: the program to run in the agent's terminal to sign in with an account — Claude: `claude`, then `/login`, issue #105; Antigravity: `agy`, issue #109) (`token`: the secret is a token of the user's account, not an API key — Copilot; the assistant says "token"; `fromGh`: it can come from `gh auth token`). A kind may give its secret to more sbx services (Copilot: `github` too, with `api.github.com` and `github.com` in its `bindings`). |
| `Check(kind)` | `sbx is not installed` when sbx cannot be found (`sbx` in PATH, `/usr/local/bin`, `/opt/homebrew/bin`). Returns `{hasKey, name, agentsFolder, taken[], gh, ghSignedIn}` (`hasKey`: every service of the kind holds a secret; `gh`, `ghSignedIn`: for a kind with `fromGh`, whether gh is installed and has a token) (`taken`: the names used by an agent, a folder or a sandbox, issue #99): whether `sbx secret ls --service <service>` shows a global secret, and the first free name among `<kind>`, `<kind>-2`… — free as an agent of the configuration, a folder of the agents' folder and a sandbox (`sbx ls -q`). |
| `SetKey(kind, key)` | `sbx secret set <service>` for each service of the kind, with the key on its standard input — never in its arguments, a file or a log; an error never repeats it. Global: every sandbox gets it. |
| `Login()` | Runs `sbx login` (issue #97) — or joins the one in progress — and returns once sbx printed its device code and URL, 20 seconds at most: `{code, url, done, user, error, output[]}`. The code is the first `XXXX-XXXX`, the URL the first `https://…` naming `login`; `output` keeps every line for when sbx prints something else. Its standard input is empty: a question asked on the keyboard gets no answer. |
| `LoginStatus()` | Waits, 20 seconds at most, for `sbx login` to end and returns the same state; `done` with `user` (from `Signed in as <user>.`) when signed in, else `error` (`cancelled` after `CancelLogin`). The interface calls it again until `done`. |
| `CancelLogin()` | Stops `sbx login`; also done when Sidekicks quits. |
| `UseGitHub(kind)` | For a kind with `fromGh` (issue #103): runs `gh auth token` and stores what it prints as with `SetKey` — as `sbx secret set <service> --command 'gh auth token'` would, for each service. `gh is not signed in to GitHub` when gh has no token, `gh is not installed` without gh (`gh` in PATH, `/opt/homebrew/bin`, `/usr/local/bin`). The token is never shown, written or logged. |
| `GitHubLogin()`, `GitHubLoginStatus()`, `CancelGitHubLogin()` | Like `Login`, `LoginStatus` and `CancelLogin`, for `gh auth login --web --hostname github.com --git-protocol https` (issue #103): its code (`XXXX-XXXX`), its URL (`https://github.com/login/device`), then `user` from `✓ Logged in as <user>`. |
| `OAuthLogin(kind)`, `OAuthLoginStatus()`, `CancelOAuthLogin()` | For a kind with `oauth` (issue #107): runs `sbx secret set <service> --oauth`, which opens a browser window; returns once it printed a page to open (`url`, or after 20 seconds), then like `LoginStatus`. `ok` when sbx ended without an error (it names nobody). |
| `Create({kind, name, title, icon})` | Writes `<agentsFolder>/<name>/sbxenv.yaml` (`name: <name>`, the kind's `agent:` and kit, `workspace: ./workspace`, `bindings` of its service, `pullPolicy: always`, English comments) and `workspace/`, then adds the agent: `sbx exec -i <name> <program>`, workspace `<folder>/workspace`, `runtime.lifecycle` in `<folder>` (`sbx env create --force`, `sbx stop <name>`, `sbx env rm --force`) — the sandbox is created at the first start. Returns `{problem, problems[], name, folder}`: `problem` is `invalidName` (lowercase letters, digits and `-`: no `_`, which sbx refuses), `nameTaken`, `folderExists` or `sandboxExists` when nothing was written. |

## Tools offered to the agents

Issues #90 and #91. Sidekicks offers every agent six tools, as [`agentTools`](configuration.md#agenttools) allows (all by default), with mini-me's protocol (`org.mini-me/tools`, ACP extension methods). An agent that knows it (`acp.clientTools` in an `mm` file) gives them to its model as `client_<name>`; the others ignore them. Few ACP agents discover a client's tools: among the agents Sidekicks documents, only mini-me does (not Claude, Codex, Gemini nor docker-agent).

| Tool (the model sees) | Method | Returns |
| --- | --- | --- |
| `memory_pressure` (`client_memory_pressure`) | `_com.rickub.sidekicks/system/memory` | `Memory pressure: warning (yellow). Used: 24.0 GB of 32.0 GB (75 %).`, as the **Log** panel shows it ([Watch the memory pressure](../how-to/watch-the-memory-pressure.md)); `The memory cannot be measured on this computer.` where it cannot be |
| `about_sidekicks` (`client_about_sidekicks`) | `_com.rickub.sidekicks/about` | Sidekicks' version (`info.version` of `build/config.yml`, `dev` for a development build), the system and architecture, what Sidekicks is, the agent's name in it, the releases page |
| `list_channels` (`client_list_channels`) | `_com.rickub.sidekicks/channels/list` | Every channel, oldest first, without the direct conversations: `#name: description. Members: @a (you), @b. 12 messages, the last on 2026-11-10 14:05.` |
| `list_agents` (`client_list_agents`) | `_com.rickub.sidekicks/agents/list` | Every agent of the configuration: `@name (you), title: description. Runs on the user's computer` (or `in a Docker container`, `in an sbx sandbox`) `; ready.` (its state: `stopped`, `starting`, `ready`, `busy`, `error`) |
| `search_messages` (`client_search_messages`) | `_com.rickub.sidekicks/messages/search` | The user and agent messages of a channel that contain `query`, case and accents ignored, the most recent first: `- 2026-11-10 14:05, @alice: …excerpt around the match…` (80 characters on each side). Parameters: `query` (required), `channel` (`general`, `#general`, or `@alice` for a direct conversation; default: the channel of the call's session), `limit` (default 10, at most 50). The whole stored history is read, not only the messages shown. An unknown channel is an error that lists the channels (a direct conversation is searched with `@agent`, it is not listed) |
| `current_channel` (`client_current_channel`) | `_com.rickub.sidekicks/channel/current` | `Channel #<name>.`, its description and its members (`you (@agent), @other, and the user.`), or `A direct conversation between the user and you (<agent>)…`. The channel is the one whose session (`_meta["org.mini-me/sessionId"]` of the call) the agent holds; a session of no channel is an error |

Only `search_messages` takes parameters; its `inputSchema` says `query` is required. `list_channels` and `search_messages` read **every** channel, not only the ones the agent is a member of (it already reads those): leave them out of `agentTools.offer` when that is not wanted. A tool left out, or every tool with `enabled: false`, is not announced, and its method answers `-32601`. The protocol:

| Step | What Sidekicks does |
| --- | --- |
| `initialize` | `clientCapabilities._meta["org.mini-me/tools"]` holds the list (`name, description, method`), or `true` when the agent's file says `acp.clientTools.discovery: request`. The file is the one after `--config` (or `-config`) in the agent's arguments, relative to its folder; without it, or unreadable, `meta`. `clientInfo.version` is Sidekicks' version |
| `_org.mini-me/tools/list` | answered with `{"tools": [...]}` |
| a tool's method | answered with `{"content":[{"type":"text","text":"…"}],"isError":false}`; a failure has `isError: true` and says why |
| any other `_…` method | JSON-RPC error `-32601` (Method not found) |

When an agent starts, its log gets `sidekicks: tools offered (meta|request): <names>`, or `sidekicks: no tool offered (agentTools)`. With `acp.clientTools.permissions: ask` (or `auto` without `yolo`), mm asks before each call: the permission card shows `client: <name>`.

## Stopping an agent

The agent's stdin is closed; after 5 s the agent and its children get SIGTERM (time for `scripts/agents.sh` to unload the model); after 3 more seconds, SIGKILL.