Environments
Define a self-hosted execution queue and issue worker credentials.
An Environment is the durable queue and trust boundary used by operator-run workers. Mango currently supports one configuration:
{
"name": "Development workers",
"config": {"type": "self_hosted"}
}Omitting config creates the same self_hosted Environment. Provider names,
container images, networking policy, packages, and infrastructure credentials
are not Environment fields; those belong to the operator's launcher.
Create
POST /v1/environments
const environment = await client.environments.create({ name: 'Quickstart' });The request accepts name, optional description, metadata, scope, and
config. scope is organization by default; account is also accepted.
Any config type other than self_hosted, or extra config fields, returns an
invalid-request error.
The response includes the Environment ID, scope, normalized config, timestamps, and archive state.
Update, archive, and delete
POST /v1/environments/{environment_id}updates mutable metadata, scope, or the equivalentself_hostedconfig.POST /v1/environments/{environment_id}/archiveprevents new Session use and new Work claims while retaining the resource.DELETE /v1/environments/{environment_id}removes an unused Environment.
Existing Sessions keep their stored Environment snapshot. Deletion is rejected while the Environment is referenced.
Worker credentials
Issue an Environment-scoped API key through the operator CLI and configure it
as MANGO_ENVIRONMENT_KEY with this Environment's ID. The supervisor
polls and acknowledges Environment Work. After Ack, the Work item supplies a
short-lived Session credential for heartbeat, Session events, immutable inputs,
result submission, failure, and Stop.
The first-party Docker launcher keeps the Environment credential outside Session containers. See Environment Work and Self-hosted worker.