@jobmatchme/bee-pi-agent
v0.1.3
Published
Bee Dance speaking Unix socket agent runtime derived in part from pi-mom
Readme
@jobmatchme/bee-pi-agent
bee-pi-agent is a Bee Dance speaking worker runtime that executes coding-agent
turns over a local Unix socket.
It is intended to sit behind @jobmatchme/bee-worker-sidecar: the agent speaks
Bee Dance envelopes locally, while the sidecar handles NATS-facing transport and
subject routing.
What this package does
- listens on a Unix socket for framed Bee Dance envelopes
- responds to
protocol.hellowithprotocol.welcome - accepts
turn.startandturn.cancelcommands - executes turns with the familiar
pi-*coding-agent tool stack - emits Bee Dance event envelopes such as
run.started,item.appended,item.updated,run.completed, andrun.failed
What this package does not do
- no direct NATS connection
- no Slack transport or Slack formatting
- no gateway responsibilities
Design intent
The package is the local execution half of a two-container pod shape:
bee-pi-agentowns agent execution and local statebee-worker-sidecarowns NATS connectivity and Bee subject routing
That keeps the agent reusable for deployments that want Bee Dance semantics without forcing every worker implementation to speak NATS directly.
Upstream provenance
This package is derived in part from
pi-mom by Mario
Zechner. The upstream package is MIT licensed, and selected files in this
package were copied or adapted under that license.
See UPSTREAM.md for file-level provenance details.
Socket protocol
bee-pi-agent exchanges framed Bee Dance envelopes over a Unix socket. The
expected local flow is:
- sidecar sends
protocol.hello - agent replies with
protocol.welcome - sidecar sends
turn.start - agent streams event envelopes back on the same socket
- sidecar may send
turn.cancel
The default socket path is /var/run/bee/worker.sock.
Run locally
npm install
npm run build
BEE_PI_AGENT_WORKSPACE_ROOT=/workspace \
BEE_PI_AGENT_SOCKET=/tmp/bee-pi-agent.sock \
node dist/main.jsEnvironment
Primary variables:
BEE_PI_AGENT_WORKSPACE_ROOTrequired workspace root for this worker instanceBEE_PI_AGENT_WORKSPACE_CWDoptional working directory inside the workspaceBEE_PI_AGENT_STATE_DIRoptional worker state directoryBEE_PI_AGENT_MEMORY_FILEoptional memory file pathBEE_PI_AGENT_SKILLS_DIRoptional skills directory pathBEE_PI_AGENT_SANDBOXoptionalhostordocker:<container>BEE_PI_AGENT_DOCKER_WORKSPACE_ROOToptional visible workspace root inside docker, default/workspaceBEE_PI_AGENT_SYSTEM_PROMPT_APPENDoptional additional fixed instructionsBEE_PI_AGENT_BLOB_STORE_ROOToptional blob-store root for attachments and artifactsBEE_PI_AGENT_AUTH_FILEoptional auth file overrideBEE_PI_AGENT_MODEL_PROVIDERoptional provider overrideBEE_PI_AGENT_MODEL_IDoptional model overrideBEE_PI_AGENT_TOOL_MODULESoptional comma-separated extra tool modulesBEE_PI_AGENT_SOCKEToptional Unix socket path, default/var/run/bee/worker.sock
For OAuth-backed OpenAI usage with a pi-ai auth.json, use
BEE_PI_AGENT_MODEL_PROVIDER=openai-codex. Plain openai expects an API key
based provider flow instead.
For migration convenience, the older PI_AGENT_WORKER_* variables are still
accepted as fallbacks.
Docker image
A Dockerfile is included for runtime image builds. Build it locally with:
docker build -t bee-pi-agent:local .The image is designed to be paired with bee-worker-sidecar in the same pod.
Helm chart
A reusable Helm chart is included under charts/bee-pi-agent.
The chart deploys:
- one
bee-pi-agentcontainer - one
bee-worker-sidecarcontainer - one shared socket volume mounted at
/var/run/bee
It also supports the same workspace, auth, and git bootstrap patterns that were
used in the earlier pi-agent-worker deployment.
License
MIT
