Packages

Autonoma SDK — automate the Autonoma Environment Factory endpoint

Current section

Files

Jump to
autonoma AGENTS.md
Raw

AGENTS.md

<!-- Generated by scripts/build-sdk-docs.mjs from docs/languages/elixir/AGENTS.md. Edit the source, not this copy. -->
<!-- BEGIN:autonoma-agent-rules -->
# Autonoma SDK: read the bundled docs before wiring the endpoint
This package implements the **Autonoma Environment Factory** - a backend endpoint that creates and tears down isolated test data. If you are integrating it, the accurate, version-matched docs ship inside this package. Read them before writing code; your training data may describe an older, adapter-based API that no longer exists.
**Start here:** `docs/implement.md` (in `deps/autonoma/docs/implement.md` once the Hex dependency is fetched).
Reading order:
1. `docs/overview.md` - what the Environment Factory is and why it is factory-driven.
2. `docs/implement.md` - step-by-step setup: deps, factories, handler, auth, validate.
3. `docs/factories.md` - the `Autonoma.Factory.define_factory/1` contract in Elixir.
4. `docs/scenarios.md` - the `create` data format (`_alias`/`_ref`).
5. `docs/protocol.md` - the HTTP wire protocol and error codes.
6. `docs/validation.md` - dry-running scenarios with `Autonoma.Check.check_scenario/2`.
Key facts that differ from older docs: the SDK is **factory-driven** (register factories with `Autonoma.Factory.define_factory/1`; there is no Ecto adapter and no SQL fallback). The Hex package is `autonoma`; add `{:autonoma, "~> 0.2"}` to `mix.exs`. The main entry is `Autonoma.Handler.handle/2`, wrapped by the server adapter `Autonoma.Plug.Handler` (a Plug with `init/1` + `call/2`; `:plug` is an optional dependency). The config is a plain map with `:scope_field`, `:shared_secret`, `:signing_secret`, `:factories`, and `:auth`. The auth callback is `fn user, ctx -> map end` returning a map with any of `"cookies"`, `"headers"`, `"credentials"` - there is no top-level `token` field. The endpoint is always enabled and HMAC signing is the gate; the old `:allow_production` flag is deprecated and ignored.
<!-- END:autonoma-agent-rules -->