docs/ez-agent-ruby/lib/ez_agent.md
Ruby libraries: extend and orchestrate EzAgent
These standard-library-only libraries provide typed daemon access, a process adapter to the standalone Go webfetch executable, and prepared append-only orchestration with scheduler-owned settled tails:
| 1 | require "ez_agent/api" # typed client and capability providers |
| 2 | require "ez_agent/webfetch" # HTTP(S) and WebSockets through Go |
| 3 | require "ez_agent/workflow" # API plus prepared Workflow graph |
require "ez_agent/incident" provides the internal incident-only audit writer.
It is independent of these public libraries and creates no files on healthy
execution. Its Go/Ruby API and schema are shared by
the service and Ruby instrumentation owners.
Choose a surface
| Need | Start here |
|---|---|
| Connect to the daemon; use sessions, prompts, events, or maintenance | API — calls |
| Provide tools, plugins, or macros | API — providers |
| Declare agents, queries, fanout, commands, selection, assertions, or structured output | Workflow |
| Read historical notes for removed Workflow APIs | Removal notes |
| Fetch HTTP(S) or WebSocket resources through the standalone transport | WebFetch |
| Inspect frame contracts | JSONL API reference |
| Package scripts with the private runtime | Wrapper and runtime packaging |
Ownership
The public loaders are lib/ez_agent/api.rb, lib/ez_agent/webfetch.rb, and lib/ez_agent/workflow.rb.
API owns the initiating AF_UNIX client, typed services, immutable values/events,
request correlation, and capability-provider runtime. WebFetch owns executable
discovery, direct process invocation, bounded capture, and framed local message
records. It does not implement HTTP, TLS, or RFC 6455. Workflow builds an
in-memory prepared graph over that typed API; eval freezes the initial shape
and only scheduler-owned on_done callbacks may append finite atomic tails.
It does not parse frames, own daemon or database state, persist a workflow
ledger, or resume an evaluator process.
| Role | Key source |
|---|---|
| Public loaders | lib/ez_agent/api.rb, lib/ez_agent/webfetch.rb, lib/ez_agent/workflow.rb |
| Transport and request correlation | lib/ez_agent/api/client.rb, event.rb |
| Typed operations and values | lib/ez_agent/api/sessions.rb, values.rb |
| Tool/plugin/macro providers | lib/ez_agent/api/capabilities.rb |
| Prepared graph and evaluator | lib/ez_agent/workflow/ |
Extension rules
- Keep daemon access typed; do not add a public raw-frame escape hatch.
- Validate required fields while preserving unknown string-keyed extensions in immutable projections.
- API
closereleases local resources and does not stop the daemon. - Provider registration is local and cumulative; duplicate capability names fail.
require "ez_agent/api"must not load Workflow.- Workflow construction must remain service-free.
evalis the service and execution boundary. - Workflow replay keys are caller-owned invalidation boundaries, not persisted prompt/config/dependency signatures.
Detail authorities
- API behavior: API reference, then
lib/ez_agent/api/and Ruby API source tests. - WebFetch behavior: WebFetch reference, then
lib/ez_agent/webfetch.rbandez-agent-ruby/test/webfetch_test.rb. - Workflow behavior: Workflow reference, then
lib/ez_agent/workflow/andez-agent-ruby/test/workflow_test.rb. - Frame names and payloads: JSONL API reference.