Early access. Cloud sessions and managed agent runs are not open to every account yet: we are
letting accounts in gradually while we test. They run in a cloud sandbox operated by Mutagent, so
there is nothing to host. A sandbox with nothing to do for 15 minutes stops; send an interactive
session a message and it wakes up, delivers your message and carries on in the same conversation.
A
-p task run cannot be woken; run it again.client.environments. The token exchange, sandbox provider and preset calls
are on client.sandbox.
Get a sandbox token
With@mutagent/sdk 0.7 or later, the *WorkspaceEnvironment calls take your API key directly, with
no token exchange. With an organization key, also send the workspace as the x-workspace-id header:
createSandboxToken, which takes the API key as its first argument and
the workspace as its second. Then create a client that holds both.
workspaceId is the workspace’s ID; client.workspaces.listWorkspaces() returns it as
workspaces[].id. The API key must be allowed to create resources in that workspace, and a key limited
to one workspace or organization can only get a token inside it. Refusals: 401, 403, 422, 429.
List Environments
listEnvironments returns every Environment in the workspace.
A fingerprint is 8 hex characters the server computes from the value with a key only the server
holds. Two equal fingerprints mean the same value; a changed fingerprint means the value changed. You
cannot compute a fingerprint yourself, so hashing your local value will not match it. To be sure a
stored value is right, set it again.
Describe one Environment
getEnvironment returns one Environment in the same shape.
Create an Environment or set entries
updateEnvironment creates the Environment when it does not exist, and otherwise
changes only the entries you name. A string value sets an entry. null removes it. Entries you do not
name are kept.
getEnvironment does.
Replace an Environment
replaceEnvironment sets the whole Environment. Entries the body does not name are
deleted, secrets included.
Rules for both calls
Delete an Environment
deleteEnvironment deletes the Environment and its secrets.
{ deleted: true, name }. 404 when there is no Environment with that name, including a
delete you retry. Sessions already running keep the values they started with. A later launch that
names the deleted Environment is refused with 404.
List sandbox providers
listSandboxProviders lists the sandbox providers a launch can name, and the default.
Pass a name as
sandboxProvider when you launch a session.
The SDK has no call that adds or configures a sandbox provider. See
Sandbox providers.
List presets
listSandboxPresets lists the presets a launch can name as preset, and the default.
Errors
A refused call throws a subclass ofMutagentError. statusCode is the HTTP status and body is the
JSON the server returned, with error and message.