Documentation
¶
Overview ¶
Command local-dsh runs a local DSH brain on this computer for BMA: one executor connection (a BYO machine) that hosts bma-dsh-acp over ACP and runs its tools here, in the turn's working directory.
BMA_MACHINE_TOKEN=<machine token> BMA_LOCAL_MODEL_KEY=<your key> go run ./examples/local-dsh \ -base-url https://executor.example -machine-id mch_... -agent /path/to/bma-dsh-acp \ -model-base-url https://api.example/v1 -model my-model -work-root ~/bma-work
Events, approvals, cancel and turn ends go through BMA; the model is the node owner's endpoint (-model-base-url with BMA_LOCAL_MODEL_KEY), or the platform's per-turn model endpoint when turn.start carries one.
Claude Code instead of DSH: -profile claude-code with -agent set to the pinned official claude-agent-acp (node dist/index.js, see -node). It uses only your own Claude credentials, which are never sent to BMA: your Claude Code login (HOME), or ANTHROPIC_* / CLAUDE_CODE_* / AWS_* / GOOGLE_* variables of this process, which are handed to the agent as they are. -model-base-url and BMA_LOCAL_MODEL_KEY are not used.
-labels (comma separated) and -remote-brain are this machine owner's local choices: labels narrow where BMA may place sessions; -remote-brain lets a brain on another machine use this one as its hands (off unless given). -platform-tools lets this machine be the brain of a session whose hands are on another machine (platform credential brain_tools).
-cua-driver names the Cua Driver executable (https://github.com/trycua/cua, MIT): when its daemon runs in this user's desktop session, the local brain gets computer_observe and computer_action (each call approved on the platform by default); otherwise they are left out and a warning is logged. -cua-socket names the daemon a host app started for itself (`cua-driver serve --embedded --socket <path>`); -cua-serve instead starts that daemon here, on a private socket, for the executor's lifetime (an embedding app such as a desktop app passes it, so macOS attributes the Accessibility and Screen Recording grants to the app). -models (DSH only) is the JSON array of models a turn may choose, in the form of the contract's AgentModel: [{"id":"m","display_name":"M", "thinking_levels":["none","low","high"],"default_thinking_level":"low"}]; turn.start config.model must be one of them (refused otherwise, never substituted) and config.thinking_level one of that model's levels, sent to the model as reasoning_effort. Without it every turn runs on -model and config.model / config.thinking_level are ignored. -allowed-root (repeatable, absolute) adds a directory a turn's config.cwd may be in, besides -work-root (for example the folders the user picked as workspaces); a cwd outside them is refused. -ask-user-question offers ask_user_question: a question is a custom tool call of the session, answered on any client (user.custom_tool_result), and the same turn continues. Give it only when the clients answer custom tools.
Output is one JSON object per line on stderr (a supervisor such as a desktop app reads it): "executor registered" with executor_id, connection log lines, and "interaction requested" / "interaction ended" with the platform interaction id and its kind (permission, or question for ask_user_question with the custom tool call's event id), so a local UI can show the same card as every other client of the session and drop it when it is answered anywhere.