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:

ruby
1require "ez_agent/api" # typed client and capability providers
2require "ez_agent/webfetch" # HTTP(S) and WebSockets through Go
3require "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

NeedStart here
Connect to the daemon; use sessions, prompts, events, or maintenanceAPI — calls
Provide tools, plugins, or macrosAPI — providers
Declare agents, queries, fanout, commands, selection, assertions, or structured outputWorkflow
Read historical notes for removed Workflow APIsRemoval notes
Fetch HTTP(S) or WebSocket resources through the standalone transportWebFetch
Inspect frame contractsJSONL API reference
Package scripts with the private runtimeWrapper 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.

RoleKey source
Public loaderslib/ez_agent/api.rb, lib/ez_agent/webfetch.rb, lib/ez_agent/workflow.rb
Transport and request correlationlib/ez_agent/api/client.rb, event.rb
Typed operations and valueslib/ez_agent/api/sessions.rb, values.rb
Tool/plugin/macro providerslib/ez_agent/api/capabilities.rb
Prepared graph and evaluatorlib/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 close releases 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. eval is 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.rb and ez-agent-ruby/test/webfetch_test.rb.
  • Workflow behavior: Workflow reference, then lib/ez_agent/workflow/ and ez-agent-ruby/test/workflow_test.rb.
  • Frame names and payloads: JSONL API reference.