Skip to content

feat(agent): scaffold the Beyond agent harness core#5

Merged
jaredLunde merged 1 commit into
mainfrom
agent-core-scaffold
Jun 30, 2026
Merged

feat(agent): scaffold the Beyond agent harness core#5
jaredLunde merged 1 commit into
mainfrom
agent-core-scaffold

Conversation

@jaredLunde

Copy link
Copy Markdown
Contributor

What

First slice of the agent harness — M1. Adds two workspace crates modeled on Pi (pi-agent-core + the dialect half of pi-ai), ported to Rust:

  • beyond-ai-agent-core (lib agent_core) — runtime- and network-agnostic core:
    • message — the dialect-agnostic conversation model (Role, ContentBlock, Message, ToolDef, StreamEvent, StopReason). One internal representation; wire adapters (next milestone) map it to/from OpenAI & Anthropic shapes.
    • tool — the Tool trait + ToolRegistry. The extensibility seam: core tools (Read/Write/Edit/Bash) and Beyond primitives (fork/sync/logs) are all just registered tools.
    • transportModelRequest + the ModelTransport seam. The loop depends only on this; the real gateway client and the test MockTransport both implement it.
    • session, errorserde-able run state; loop vs. tool errors.
  • beyond-ai-agent (bin) — thin CLI shell exposing the eventual run (one-shot) and serve (headless control API) surface. Both scaffolded; tools is a working no-network demo proving the registry + async tool seam link end-to-end.

The Beyond twist

The model layer never manages provider keys/endpoints — it speaks OpenAI/Anthropic wire to the gateway, which owns routing/auth/metering. The agent crate has zero dependency on the gateway crate; its only contract is the HTTP wire.

Out of scope (next milestones)

Wire dialect adapters (M2), HTTP-to-gateway transport (M3), the agent loop (M4), real tools (M6), serve control API (M7). The run/serve commands print a scaffold notice for now.

Verification

cargo build · clippy --all-targets -D warnings · cargo fmt --all --check · dprint check · 9 agent-core unit tests · gateway 99 unchanged · cargo run -p beyond-ai-agent -- tools runs the demo. Added crates pinned to latest published (async-trait 0.1.89, futures 0.3.32).

🤖 Generated with Claude Code

Add two workspace crates that lay down the harness, modeled on Pi
(badlogic/pi-mono) and ported to Rust:

- beyond-ai-agent-core (lib `agent_core`): runtime- and network-agnostic
  core. The dialect-agnostic message model (Role/ContentBlock/Message/
  ToolDef/StreamEvent/StopReason), the `Tool` + `ToolRegistry` extensibility
  seam, the `ModelTransport` network seam, `Session` state, and errors.
  No HTTP/provider/executor code, so it unit-tests with no network.
- beyond-ai-agent (bin `beyond-ai-agent`): thin CLI shell. Targets the
  one-shot `run` and headless `serve` surface (both scaffolded); `tools`
  is a working no-network demo of the registry + async tool seam.

The Beyond twist: the model layer never manages provider keys/endpoints —
it speaks OpenAI/Anthropic wire to the gateway. The agent crate has no
dependency on the gateway crate; its only contract is the HTTP wire.

Workspace: add `async-trait` + `futures` to [workspace.dependencies]
(gateway's async-trait now inherits from the workspace). mise: build:agent,
run:agent, test:unit:agent.

Verified: build · clippy -D warnings · cargo fmt --all --check · dprint check
· 9 agent-core unit tests · gateway 99 unchanged · `beyond-ai-agent tools` demo.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant