docs/cmd/ez-agent-hello.md
ez-agent-hello — reference capability provider
This is the reference capability provider: a standalone binary speaking JSONL
over stdio. It announces one tool (hello), one plugin (hello_plugin), and
seven macros; it is not the daemon, client, or shipped builtin provider.
Not this page if you need: shipped capabilities or authoring guidance → ez-agent-builtin; provider/process configuration → service configuration and ez-agent-service; wire-frame contracts → API hub and JSONL API catalog; macro invocation from the CLI/TUI → ez-agent.
Build with just build; the executable is build/ez-agent-hello.
What does it demonstrate?
| Capability | Trigger / priority | Useful behavior |
|---|---|---|
Tool: hello | — | Greeting, delayed execution, heartbeats, and aborts. |
Plugin: hello_plugin | 10 | Changes the first pending system turn. |
Macro: hello.hello | on_user / 10 | A small user-triggered greeting example. |
Macro: hello.in30s | on_preplugin / 10 | Delayed leaf release fixture. |
Macros: hello.assistant_debug, hello.assistant_debug_high, hello.assistant_debug_low | on_assistant / 10, 1, 10 | Assistant marker fixtures. |
Macro: hello.idle_debug | on_idle | Idle marker fixture. |
Macro: hello.assistant_error | on_assistant / 5 | Intentional error fixture. |
How does a provider connect, and who owns what?
The service launches this configured direct child over stdin/stdout. The provider
sends a protocol-version-1 hello, waits for hello_ack, announces capabilities,
and then answers metadata requests and calls. Configuration must name the service
as direct JSONL and list the tools, plugins, or macros that it may route; an
announcement alone is not the complete routing contract.
Ownership split: the provider owns capability behavior; the daemon owns child lifecycle, metadata, routing, and client-facing results. The client and TUI consume those results; see ez-agent-service for the daemon boundary.
What should callers expect from hello?
The public schema declares a required string name, plus a Go-duration string
delay; metadata advertises a 10-second timeout and 60-second maximum. This is
deliberately an example of tolerant implementation behavior: an omitted or empty
name still returns Hello, world!; a supplied value returns Hello, <name>!.
A valid delay keeps the call alive with heartbeats about every two seconds. An
invalid duration returns an error result. Abort is acknowledged, and an aborted
delayed call can return an is_error result whose text contains aborted.
Effective timeouts can be changed by service configuration, so provider metadata
is not necessarily the runtime limit.
What do the plugin and macros do?
hello_plugin appends (with hello support) only to the first pending system
turn. With no system turn it returns pending turns unchanged; an unknown plugin
is an error.
hello.hello accepts its plain parameter string, defaults an empty parameter to
world, and returns a greeting. hello.in30s holds its leaf's turns for about
30 seconds using process-local, per-leaf state, then releases them; exact poll
and reset semantics live in main.go and main_test.go. The other macros are
diagnostic markers or an intentional error fixture, as summarized above.
Provider macro replies are internal macro_result_ipc frames; the daemon turns
them into client-facing macro_result frames. Do not treat provider metadata or
IPC envelopes as the client API.
Where do I change or verify this?
| Question | Detail authority |
|---|---|
| Startup, metadata, handlers, delay/abort behavior | cmd/ez-agent-hello/main.go |
| Per-leaf deadline safety and reset | cmd/ez-agent-hello/main_test.go |
| Typed provider connection and operations | pkg/ezagentapi/conn.go, pkg/ezagentapi/operations.go |
| Exact lifecycle, tool, plugin, and macro frames | API hub, JSONL API catalog, pkg/protocol/ |
| Launch, registration, and routing | pkg/service/process_pool.go, pkg/service/server.go, pkg/service/registry.go |
| Focused end-to-end behavior | tests/suites/test_hello_tool.py, test_hello_plugin.py, test_macros.py, test_tool_exec.py |
For test execution and retention policy, see tests.