third-party-brain

command
v1.23.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command third-party-brain is the smallest brain a third party can write against the SDK and the executor contract alone (ADR-0029): it takes a turn, decides what to do, asks the user's approval, runs the tool wherever the session's hands are, and reports events.

There is no model in it. The "model loop" is one line: a prompt of the form

bash: <command>

is a request to run that command; anything else is answered with text. A real brain replaces decide() with its model and keeps the rest.

What the SDK does for the brain:

  • turn.start, turn.input, turn.cancel and session.close, event ids and sequences, acknowledgements and resend after a reconnect;
  • the tool route (AgentTurn.Tools): when the session's hands are on another machine the platform hands the turn its tools endpoint, and every call goes there through the platform's gateway, which re-checks policy and approval, runs it at most once and runs it on the hands. The brain never learns where the hands are, and none of its calls can run on this machine by mistake. Tools() is nil when the hands are this machine: this example has no local tools and says so.

Declaring platform_credentials brain_tools (below) is what lets the platform give this machine a session whose hands are elsewhere.

BMA_MACHINE_TOKEN=<machine token> go run ./examples/third-party-brain \
  -base-url https://executor.example -machine-id mch_...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL