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?

CapabilityTrigger / priorityUseful behavior
Tool: hello—Greeting, delayed execution, heartbeats, and aborts.
Plugin: hello_plugin10Changes the first pending system turn.
Macro: hello.helloon_user / 10A small user-triggered greeting example.
Macro: hello.in30son_preplugin / 10Delayed leaf release fixture.
Macros: hello.assistant_debug, hello.assistant_debug_high, hello.assistant_debug_lowon_assistant / 10, 1, 10Assistant marker fixtures.
Macro: hello.idle_debugon_idleIdle marker fixture.
Macro: hello.assistant_erroron_assistant / 5Intentional 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?

QuestionDetail authority
Startup, metadata, handlers, delay/abort behaviorcmd/ez-agent-hello/main.go
Per-leaf deadline safety and resetcmd/ez-agent-hello/main_test.go
Typed provider connection and operationspkg/ezagentapi/conn.go, pkg/ezagentapi/operations.go
Exact lifecycle, tool, plugin, and macro framesAPI hub, JSONL API catalog, pkg/protocol/
Launch, registration, and routingpkg/service/process_pool.go, pkg/service/server.go, pkg/service/registry.go
Focused end-to-end behaviortests/suites/test_hello_tool.py, test_hello_plugin.py, test_macros.py, test_tool_exec.py

For test execution and retention policy, see tests.