Agent Quickstart / agent serve¶
The entry command is trust-runtime agent serve, so this is also the right
page when you are searching for agent serve.
What an agent needs first¶
At minimum, an agent should know how to:
- inspect project shape
- read and write files
- run diagnostics
- preview formatting
- build or test
- close the diagnose -> build -> reload loop
Start agent serve¶
trust-runtime agent serve --project ./my-plc
Transport details:
- JSON-RPC 2.0
- stdio only in v1
- one request per line
- one response per line
Five-minute Example¶
1. Describe the agent API¶
printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"agent.describe","params":{}}' \
| trust-runtime agent serve --project ./examples/memory_marker_counter
2. Inspect the project¶
printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"workspace.project_info","params":{}}' \
| trust-runtime agent serve --project ./examples/memory_marker_counter
3. Read diagnostics¶
printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"lsp.diagnostics","params":{}}' \
| trust-runtime agent serve --project ./examples/memory_marker_counter
4. Preview formatting without mutating disk¶
printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"lsp.format","params":{"path":"src/Main.st"}}' \
| trust-runtime agent serve --project ./examples/memory_marker_counter
5. Close the write -> validate -> reload loop¶
printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"runtime.compile_reload","params":{}}' \
| trust-runtime agent serve --project ./examples/memory_marker_counter
Methods most agents use first¶
agent.describeworkspace.project_infoworkspace.readworkspace.writelsp.diagnosticslsp.formatruntime.buildruntime.testruntime.compile_reload
Deterministic execution¶
Use the harness APIs when you need programmable cycle control:
- Harness protocol
harness.loadharness.cycleharness.set_inputharness.get_outputharness.run_until