Help us shape the future of Go! Take the 2026 Go Developer Survey

omp

package
v0.101.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package omp finds the omp (oh-my-pi) agents running on the machine and what they are doing, from what is on disk: the omp processes (their working directory, and for an agent beekeeper started its environment) and the session files omp writes under ~/.omp/agent/sessions, one JSON line per entry: a title line (rewritten in place), the session header (id, cwd), model changes, and messages of the roles user, assistant and toolResult.

omp keeps no record of which process runs which session file and holds none open: a process runs the session file of its working directory that it created (the header's time is the first one at or after its start), else the one written last since it started (a resumed session).

Index

Constants

View Source
const (
	EnvAgent = "BEEKEEPER_OMP_AGENT"
	EnvName  = "BEEKEEPER_AGENT_NAME"
)

The environment beekeeper starts an omp agent with: its start id and its roster name, which no session file carries.

View Source
const (
	StateBusy  = "busy"
	StateIdle  = "idle"
	StateEnded = "ended"
)

The session states: busy while a turn runs, idle while it waits for a message, ended when no process runs the session.

View Source
const Comm = "omp"

Comm is the omp binary's process name.

View Source
const Harness = "omp"

Harness is the harness name omp sessions carry (claude.Session.Harness).

View Source
const HostPrefix = "omp_"

HostPrefix makes a start id the agent's host session id on the roster: omp_<start id>.

Variables

View Source
var ErrNotRunning = errors.New("no omp process reads its inbox")

ErrNotRunning is a message to an agent whose inbox no process reads.

Functions

func Discover

func Discover(sessionsDir string, t *proc.Table, now time.Time) []*claude.Session

Discover returns the running omp sessions, newest first. A session's process may not have written its session file yet (omp creates it with the first message): it is listed without a transcript. A process that another omp process started (a subagent) belongs to that session.

func Ended

func Ended(sessionsDir string, running []*claude.Session, since time.Time) []*claude.Session

Ended returns the omp sessions written to since since that no running session runs, most recently active first.

func Follow added in v0.61.0

func Follow(path string, n int) ([]claude.Turn, error)

Follow is Tail with the agent's tool calls among the turns, as claude.Follow returns them.

func InboxPath

func InboxPath(stateDir, id string) string

InboxPath is the inbox of the agent started under id, in beekeeper's state folder.

func MakeInbox

func MakeInbox(path string) error

MakeInbox creates the inbox FIFO at path, keeping one that exists.

func ReadTranscript

func ReadTranscript(path string, now time.Time) (claude.Work, claude.Activity)

ReadTranscript reads an omp session file's window for the issues and repositories it is about and its activity: turns (the person's messages), tool calls and failed ones, tokens and cost as omp counted them, and the context its last reply had.

func RemoveInbox added in v0.60.0

func RemoveInbox(path string) (removed bool, err error)

RemoveInbox removes the inbox at path and its lock file; removed is false when there was none. A process that still reads the inbox keeps its open end, but no message reaches it any more.

func Send

func Send(path, msg string) error

Send writes msg to the inbox at path as one steer command. It never blocks on an inbox no process reads: that refuses it (ErrNotRunning). Writes are serialized by a lock file beside the inbox (macOS locks no FIFO), so two senders' lines never interleave, whatever their length.

func ShellArgv

func ShellArgv(path string, argv ...string) []string

ShellArgv runs argv, omp's command line, with its stdin on the inbox at path: opened for reading and writing, so the inbox never reaches its end while the agent runs, whoever writes to it. omp's protocol output goes nowhere; its log is omp's own (~/.omp/logs) and the unit's journal keeps its errors.

func Tail

func Tail(path string, n int) ([]claude.Turn, error)

Tail returns the last n turns of an omp session file: the person's and beekeeper's messages and the agent's words, without thinking, tool calls and tool results.

Types

This section is empty.

Jump to

Keyboard shortcuts

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