brokerclient

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package brokerclient holds the low-level transport for talking to the boid broker over its UNIX socket, plus a self-contained JobDone helper.

It is a leaf package: it deliberately does NOT import internal/sandbox so that both the sandbox CLI shim (internal/sandbox/boid_shim.go) and the go-native sandbox runner (internal/sandbox/runner) can share the transport without an import cycle. The wire structs below mirror the JSON shapes the broker decodes (internal/sandbox/protocol.go: ExecRequest / ExecResponse / BoidRequest) field-for-field; keep the json tags in sync.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JobDone

func JobDone(socket, token, jobID, cwd string, exitCode int, output []byte) error

JobDone posts a `boid job done` builtin request to the broker. It replaces the former EXIT-trap `boid job done --exit-code … --output-file …` CLI fork-exec: the go runner calls this directly from runner-inner-child.

cwd must be the sandbox working directory (the same cwd the EXIT trap ran in) because the broker validates it against the token's project/worktree root (validateBoidBuiltinCwd). output carries the agent's payload_patch.json (or the stdout-capture fallback); an empty output is valid and matches the bare `boid job done --exit-code` form.

func SendJSON

func SendJSON(socket string, req any, resp any) error

SendJSON dials the broker UNIX socket, JSON-encodes req, and decodes a single JSON response into resp. It is the extraction of the former sandbox.sendExecRequest transport so the shim and the runner share one implementation.

Types

This section is empty.

Jump to

Keyboard shortcuts

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