Agents
Ax programs make compact native tools for AI agents.
File digest
examples/agents/file_digest.ax reads bounded prefix, range, tail, text line, JSON line-window previews, and base64 file byte windows, writes artifacts, and hashes full files or byte ranges.FS journal
examples/agents/fs_journal.ax prepares nested artifact parents, appends and reads JSONL event logs, walks and filters artifacts with newline and JSON discovery APIs, records stat arrays, writes atomically, persists validated JSON state, cleans, and hashes outputs.Signed manifest
examples/agents/signed_manifest.ax hashes a file and signs compact JSON, whole files, and byte ranges with HMAC-SHA256.Secure token
examples/agents/secure_token.ax creates random hex and base64url tokens, UUID trace IDs, and checks signatures with constant-time compare.Env report
examples/agents/env_report.ax reads defaulted agent metadata and writes a prefix-scoped environment JSON snapshot.Process probe
examples/agents/process_probe.ax captures command output, status, line arrays, and merged diagnostic logs as structured JSON for native agent workflows.IO diagnostics
examples/agents/io_diagnostics.ax keeps stdout protocol output separate from stderr diagnostics with io.eprintln.CLI probe
examples/agents/cli_probe.ax reads flags, defaulted option values, structured argv JSON, and parsed option/flag manifests.JSON tool
examples/agents/json_tool.ax validates JSON, reads defaulted fields, queries nested paths, reads typed scalars, checks arrays, appends array manifests, builds valid JSON artifacts, and writes key manifests.String agent
examples/agents/string_agent.ax normalizes labels, checks byte positions and match counts, and writes a digest.Path manifest
examples/agents/path_manifest.ax normalizes source paths and writes a manifest digest.Time probe
examples/agents/time_probe.ax records seconds, milliseconds, UTC ISO timestamps, and a short native sleep.URL router
examples/agents/url_router.ax extracts URL parts, individual query values, and decoded query JSON for HTTP-facing tools.Tool server
examples/agents/tool_server.ax exposes native HTTP endpoints.HTTP fetch
examples/agents/http_fetch.ax calls local HTTP tool endpoints with body-only and structured bounded JSON GET/POST results.Async score
examples/agents/async_score.ax demonstrates async worker dispatch.Native HTTP Tool
&3010{G/health>#{ok:!1,service:"ax-agent-tool"} G/tools/*>"tool" P/echo>~}
Run
ax build examples/agents/tool_server.ax -o .ax-out/tool_server
.ax-out/tool_server
curl http://localhost:3010/health
HTTP Client
ax run examples/agents/http_fetch.ax
Environment Metadata
AX_AGENT_NAME=ax ax run examples/agents/env_report.ax
FS Journal
ax run examples/agents/fs_journal.ax
Signed Manifest
ax run examples/agents/signed_manifest.ax
Secure Token
ax run examples/agents/secure_token.ax
Process Capture
ax run examples/agents/process_probe.ax
IO Diagnostics
ax run examples/agents/io_diagnostics.ax
# stdout stays protocol-safe; io.eprintln writes diagnostics to stderr
CLI Arguments
ax run examples/agents/cli_probe.ax -- --input examples/agents/path_manifest.ax --mode digest --upper
JSON Payloads
ax run examples/agents/json_tool.ax
String Normalization
ax run examples/agents/string_agent.ax
Path Manifest
ax run examples/agents/path_manifest.ax
Time Probe
ax run examples/agents/time_probe.ax
URL Router
ax run examples/agents/url_router.ax