# Agent

> Agents: hosted agents you message by name.

## noclick.Agent

```python
class Agent
```

A hosted agent. `Agent.from_name("host", create_if_missing=True, instructions=...)` is lazy; `agent.message("hi").text` talks to it.

An account-level agent is shared: each user that messages it (via
`as_user` or `user=`) gets its own conversations. A user's own
agent always acts for that user.

The agents built in the NoClick app are listed and messaged here too
(`origin` `app`, an id like `node:<workflow>:<node>`): `send` and
`message` reach them, and what they are is changed in the app.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |
| `origin` | `str | None` | `api` for an agent made through the API, `app` for one built in the NoClick app. |
| `name` | `str` |  |
| `model` | `str | None` | The model it runs, as its harness names it (`sonnet`, `openrouter/...`). |
| `harness` | `str | None` | What runs it: `sdk`, `claude_code`, `codex`, `opencode`, `hermes` or `openclaw`. |
| `model_connection` | `str | None` | The connection whose key or plan it thinks with, by name (`None` on `sdk` without one). Hidden, like `instructions`, from a user's session reading an account agent. |
| `instructions` | `str | None` |  |
| `tools` | `list[Any]` | What it can use, as listed: refs, `{tool, bind}` for an operation with arguments bound and `{human, tools}` for a person. |
| `tool_rules` | `dict[str, str]` | What it may do with each app it reaches, `{key: 'allow' | 'ask' | 'off'}` (empty: everything its tools give is allowed). See `create`. |
| `can_request` | `list[str]` | What it may ask its user to connect at run time. |
| `user_id` | `str | None` |  |
| `workflow_id` | `str | None` |  |
| `node_id` | `str | None` | An app agent's step in its workflow (None for an API agent). |
| `workflow_name` | `str | None` | An app agent's workflow, by name. |
| `access` | `str | None` | An app agent's workflow as you hold it: `owner`, or `editor` or `viewer` when it was shared with you (only an owner's or an editor's takes messages). |
| `enabled` | `bool | None` | Whether an app agent is switched on; a disabled one takes no messages. |
| `app_url` | `str | None` | Where an app agent is changed: its workflow in the NoClick app. |
| `parent_id` | `str | None` |  |
| `ttl_s` | `int | None` | Its time to live, in seconds (None if it isn't temporary); `expires_at` is when it runs out, sooner for a temporary parent's child. |
| `expires_at` | `Any` | When a temporary agent's `ttl_s` runs out (None if it isn't temporary): then `expired`, taking no turns, readable for 30 days. |
| `budget_usd_per_month` | `float | None` |  |
| `budget_restore` | `dict[str, Any] | None` | While a budget set for one run holds (`update(budget_for_run=True)`), the budget that comes back as that run ends and after which run: `{budget_usd_per_month, operation_id}` (`operation_id` None: its next turn). None otherwise. |
| `region` | `str | None` | The region its sandboxes run in (`noclick.regions()`), fixed when it was created; `None`: wherever NoClick has capacity. |
| `machine_id` | `str | None` | The `Machine` its harness runs on (None: a sandbox of its own; invite-only beta). |
| `created_at` | `Any` |  |
| `browser_profile_id` | `str | None` | The browser profile its `browser` tool signs in with, of its own scope. |
| `card_id` | `str | None` | The `Card` it holds and pays with (None: none of its own; a spawned child may pay with its parent's; invite-only beta). |
| `volumes` | `dict[str, str] | None` | The volumes its shell mounts, by mount path: `{path: volume id}`. |
| `memory_id` | `str | None` | Its own memory (`agent.memory`) as a `Memory` id, to attach to other agents. |
| `skills` | `list[dict[str, Any]] | None` | Its skills: each `{id, pin}`. |
| `memories` | `list[dict[str, Any]] | None` | The memories it reads besides its own, in order: each `{id, writes}` (None for a user's session reading an account agent). |
| `secret_ids` | `list[str] | None` | The secrets in its shell's environment, in order (a later one's key wins). |
| `timezone` | `str | None` | The IANA timezone each turn is told the date and time in (`None`: the acting user's, else UTC). |
| `repos` | `list[dict[str, Any]] | None` | Repositories cloned into its workspace at a conversation's first turn: a `connection` and `repository`, a NoClick `repo_id` or a git `url` (signed in with a secret's `secret_key`), each with its `branch`, `path` and the branch globs it may `push` to. |
| `setup` | `list[str]` | Commands its sandbox (its container, on a machine) runs as it starts (a coding harness only). |
| `docker` | `bool` | Whether Docker runs in its sandbox, a VM of `sandbox_size` (a coding harness only). |
| `sandbox_size` | `str | None` | The VM a Docker agent works in: `small` (2 CPUs, 4 GB), `medium` (4 CPUs, 8 GB) or `large` (8 CPUs, 16 GB); None without Docker. |
| `app_testing` | `str` | How a coding agent may turn app testing on (Docker in its sandbox for a task that needs it): `by_itself`, `ask_first` or `never`. |
| `app_testing_usd_per_hour` | `float | None` | What an hour of app testing costs where its sandbox runs; None without a sandbox of its own (an `sdk` agent, one on a machine). |
| `model_switching` | `dict[str, Any]` | Its owner's rule for moving to another model connection when its plan runs out or it's told to: `{"mode": "switch"|"stay", "allowed": [names]|None}` (`ModelSwitching`). In `switch` (the default) any of the owner's own plans is free and a paid key needs their say-so; `stay` keeps it on its connection; `allowed` names the ones it moves between freely. |
| `switched_from` | `dict[str, Any] | None` | While a plan's limit has it on another connection, the one it left (`connection`, `name`, `window`, `resets_at`): its first turn after that goes back there. None otherwise. |
| `moved_from` | `dict[str, Any] | None` | Where a move from a laptop made it (`move_id`, `host`, `folder`, `at`); else None. |
| `network` | `Any` | What its shell and code reach: `True` (anywhere), `False` (only what it needs to work) or the hosts it may reach besides, as sent. |
| `shell` | `bool | None` | Whether it has a shell, the `code` capability (`False` only on `sdk`). |
| `turn_limits` | `dict[str, Any] | None` | How far one of its turns goes, as set: `steps`, `usd` and `minutes` (`None`, or a limit left out: 200 steps, $1 and 30 minutes). |
| `effort` | `str | None` | Its conversations' reasoning effort (`None`: the model's own). |
| `speed` | `str | None` | `fast`: its conversations run in fast mode. |
| `permission_mode` | `str | None` | Its conversations' permission mode unless one sets its own. |
| `approvals` | `dict[str, dict[str, Any]]` | What its own calls wait for a person on in place of the account's, by kind of hold (`disposition`, `under_usd`, `until`, `effective_at`, `pending`), and `routing`: who answers its held calls first (`approver`, `on_timeout`, `expires_in_s`); empty where it sets none (a child follows its parent's). |
| `status` | `str | None` | `working` (a turn queued or running), `waiting` (its turns wait on a person: a question, a held call), `idle`, or `expired` (past its `ttl_s`: no turns, readable for 30 days). Pausing stops triggers, not work, so a paused agent can be `working`; `paused` says it's paused. None, like the activity fields below, for a user's session reading an account agent. |
| `last_active_at` | `Any` | When one of its turns last started or ended (`None`: it never ran, or hidden like `status`). |
| `running_turns` | `int | None` | How many of its turns are queued, running or waiting on a person, any conversation (hidden like `status`). |
| `child_count` | `int | None` | How many live (not expired) children it has; `children()` lists them (hidden like `status`). |
| `job_id` | `str | None` | The task it was spawned with, an `agent.task` operation (`None` if `spawn` didn't make it). |
| `used_by` | `list[dict[str, Any]]` | The apps that bind it: `kind` (`project`), `id`, `name` and the `binding` name (None for a user's session reading an account agent). |
| `paused` | `bool` | Whether `pause()` stopped its triggers (`False` too for a user reading an account agent). |
| `helper` | `bool` | Whether it's one of NoClick's helpers, made for NoClick's own work rather than one of your agents: an app's coding agent (which NoClick hands each change to that app's code), or a child one of NoClick's own agents spawned. |
| `noclick` | `bool` | Whether it's a NoClick, your account's own or one of your spaces', rather than one of your agents: NoClick's own app shows it as NoClick, never by the name it's found by (a space's is `noclick-<the space's id>`). |
| `former_names` | `list[str]` | The names it went by before it was renamed, the latest first. Each still reaches it (`agent:<old name>`, `from_name`, an @mention in a channel) and stays reserved for it: no other agent of its scope takes one. |
| `job` | `Job | None` | The task it was spawned with, as a `Job` (`wait()` gives its last reply); `None` for an agent `spawn` didn't start. |
| `trigger_kinds` | `list[str]` | Its triggers' kinds (`cron`, `webhook`, `event`, `platform`, `queue`, `email`, `call`): a listing tells automations (with `cron`) apart. Empty for a user reading an account agent. |
| `console_url` | `str | None` | This agent in the developer console (None off the hosted API). |
| `a2a_url` | `str` | The A2A JSON-RPC endpoint (`message/send`, `tasks/get`); callers authenticate with a platform key as a bearer token. |
| `memory` | `AgentMemory` | What it remembers across conversations: `list`, `search`, `read`, `save` and `delete` named entries (see `AgentMemory`). |

### Agent.create

```python
noclick.Agent.create(
    name, *, instructions, model=None, harness=None, model_connection=None, tools=None,
    tool_rules=None, ttl_s=None, parent_id=None, budget_usd_per_month=None,
    can_request=None, triggers=None, browser_profile=None, card=None, volumes=None,
    secrets=None, timezone=None, repos=None, network=None, shell=None, region=None,
    machine=None, memories=None, skills=None, turn_limits=None, effort=None,
    speed=None, permission_mode=None, setup=None, docker=None, sandbox_size=None,
    app_testing=None, model_switching=None, approvals=None, allow_existing=False,
    user=..., client=None
) -> Agent
```

Create an agent (names are unique per account and user; a
duplicate raises `noclick.Conflict` with `existing_id`). With
`allow_existing=True` a taken name returns the agent already there, as it is:
nothing about it changes, so it's made once and left alone after.

`harness` is what runs it: `"sdk"` (the default), NoClick's own agent
loop, or a coding agent in a sandbox of its own with a shell and files:
`"claude_code"`, `"codex"`, `"opencode"`, `"hermes"` or `"openclaw"`
(`Agent.harnesses()` lists them). `model` is the harness's own: an
OpenRouter id with the `openrouter/` prefix on `sdk`, an alias such as
`"sonnet"` on `claude_code`, a `provider/model` on `opencode`, `hermes`
and `openclaw`; omitted, the harness's default. `model_connection` is the
connection whose key or plan it thinks with (a `Connection` of a
`kind="model"` integration such as `anthropic`, or its name, in the
agent's own scope; a lazy `create_if_missing` one is created first): every
CLI harness needs one, and it may still be pending. On `sdk` it's optional,
and lets `model` name `anthropic/...` or `openai/...` on your own key.
A `Connection` object from another scope, such as your account's key for a
user's agent, stays that connection (invite-only beta): only a key
acting for the whole account may set one, and it must hold a key, since a
person's Claude or ChatGPT plan is never shared. `model_connection="noclick"` runs a `codex` or
`opencode` agent on NoClick's own key, at the model's cost (`HarnessInfo.noclick_key`).

`effort` is how hard its model reasons in every conversation (one of its harness's
`efforts`); `speed="fast"` runs its model in its harness's fast mode where it has one (`speeds`).
`permission_mode` is how far its coding harness goes before asking a person in a conversation that sets
none (one of its harness's `permission_modes`; a conversation's `set_permission_mode` wins).
`setup` is commands a coding agent's sandbox (its container, on a machine) runs as it starts, in order, after
its `repos` and with its `secrets` in the environment (a CLI installed, a config file written).
`docker=True` runs Docker in a coding agent's sandbox, which is then a VM of `sandbox_size` (`"small"`,
2 CPUs and 4 GB, unless it says `"medium"` or `"large"`), with dockerd running before its first turn:
`docker`, `docker compose` and testcontainers work as on any Linux machine. The VM is billed at its cost
for all of its size while it's up.
`app_testing` is how a coding agent may turn Docker on for a task that needs it, without `docker`:
`"by_itself"` (the default) turns it on when a task does and off once it's done, saying each in its chat;
`"ask_first"` asks the account's owner in the chat each time; `"never"`.
`model_switching` is how it moves to another of the owner's model connections when its plan runs out or
it's told to (`ModelSwitching`, or `{"mode": ..., "allowed": [...]}`): left out, it switches by itself
to any of the owner's own plans and asks before a paid key.

`tools` left out gives it everything in its scope (`"everything"`): every connection,
ones connected later too, operations that need no account, the web and NoClick itself,
plus the account's owner to notify and ask for an account agent. A list narrows it to
connections (a `Connection`, or its name: every operation), one
operation of one (`"gmail.send_email_message"`), the capabilities `"search"` and
`"fetch"`, a `Toolkit`, or a `Database` (its `query`, `execute` and
`schema`, or `db.only(...)`; invite-only beta), or a browser (`"browser"`, or
`"browser.act"` and the like), or a person (a `Human`, or `human.only(...)`:
tools that notify them, ask them and wait for the answer, or hand them the
conversation), or the `agents` capability (`"agents"`, or `noclick.Agents.only(...)`:
tools to spawn, message, ask and keep track of other agents), or NoClick itself (`"noclick"`, or
`noclick.Platform.only(...)`: your account's API as tools, a purchase or a deletion waiting for
your approval): at most 64 tools in all. A string names
a connection in the agent's own user (the account for an account agent, whose
`"credential:<id>"` names an account connected in the NoClick app), else an
integration's operations that need no account (on NoClick's key), so
`tools=["exa.search"]` (or `"exa"`, all of them) needs no connection. A
`Connection` object from another scope, another user's or the
account's, stays that connection (a key acting for the whole account only).
A lazy `create_if_missing` connection is created first. Every agent can also
run shell commands (the `code` capability; a policy that denies
`code` refuses them, and `shell=False` removes it). `ttl_s` makes it temporary:
once that many seconds have passed it's `expired`, taking no turns (its pending
wake-ups are canceled) and readable for 30 days, then deleted; `parent_id` (an `Agent` or id) makes it a
child of that agent, with nothing started (`parent.spawn` also starts a task);
`budget_usd_per_month` caps its spend: a child's is held out of what its parent
has left, and a child without one draws on its parent's budget as it spends.

`tool_rules` says what it may do with each app it reaches, `{key: "allow" | "ask" | "off"}`: a key is
an app as `tools` names it (a connection's name, `"credential:<id>"`, an integration's, `"noclick"`,
`"search"`, `"fetch"`), one action of it (`"work-gmail.delete_email_message"`; NoClick's are its
groups, `"noclick.spend"`), or `"*"` for whatever the rest don't name. The most specific key naming a
call decides it: `allow` runs it, `ask` holds it for the owner's yes, `off` refuses it; with none, it's
allowed. With everything, `{"*": "off", ...}` keeps it to the apps the rules turn on, so an account
connected later starts off. `tool_access()` shows them app by app. `"noclick.spend": "allow"` and
`"noclick.delete": "allow"` also set its `approvals` for `purchase` and `delete` to allow.

`approvals` are what its own calls wait for a person on, in place of the account's, by kind of hold
(`noclick.ApprovalPolicy.get()` lists the settable ones): `"allow"`, `"ask"`, `"deny"`, or a dict
with `disposition` (a purchase also takes `under_usd`: allowed at or under it, asked above; any kind
`until`). Never looser than the account's ceiling for the kind (raise it with
`ApprovalPolicy.set(ceilings=...)`), a child's never looser than its parent's (which it follows where it
sets none), and a purchase or a deletion past the default needs a monthly cap on the account. Loosening is
the owner's: signed in, their own message to one of their agents, or a key naming `approvals:policy`
(after a 10-minute undo window); an agent acting on its own waits for the owner's yes. `"routing"` among
them names who answers its held calls first, in place of its parent's or the account's approver (finally the
owner), as `ApprovalPolicy.set`'s `routing` takes it: its parent may approve its calls, never the agent
itself nor one of its children.

`can_request` lets it ask its user to connect accounts at run time
(a `request_connection` tool): integration names, single
`"integration.operation"`s, or `"*"`. What the user connects is a
grant (`grants()`), kept apart from the agent's fields.

`triggers` wake it without a message: `noclick.OnWebhook`, `OnEvent`, `OnPlatformEvent`,
`Cron` and `OnQueue` (see `triggers()`).

`timezone` (an IANA name) is the zone every turn is told the date and time in;
without one, the acting user's `timezone`, else UTC. An account's own agent made
without one starts in its owner's, where their NoClick assistant tells the time.

`region` (`noclick.regions()`) is where its sandboxes run, for good: a coding
harness runs there whole, and an `sdk` agent's shell does while its loop runs in
NoClick's own service. Without one it takes its parent's, else your account's
default region, else runs wherever NoClick has capacity. `region=db.region` keeps
an agent beside its data. `machine` (a `Machine` or id; invite-only
beta) runs its harness on an always-on machine instead: no sandbox per
conversation, nothing reaped when it's quiet, no per-minute sandbox charge,
and it runs in the machine's region. A coding harness there reaches its model
through NoClick's credential proxy, so its `model_connection` holds a
Claude, ChatGPT or OpenRouter key, or your account's own plan: a Claude plan
on `claude_code` or a ChatGPT plan on `codex`, its sign-in kept in that
agent's own container (the answer's `notes` say so). Anyone else's plan
raises `noclick.NotAvailable`; a machine runs at most 50 agents.

`volumes` mounts `Volume`s (or their ids or names: its user's own,
then the account's) read-write in its shell at absolute paths
(`{"/data": vol}`), in every conversation, up to 5; not at
`/workspace`, `/root` or a system folder. An `sdk` agent's shell
sees each as it was when the turn started and saves its writes when the
turn ends; a coding harness's sandbox, from when it starts until it stops.

`memories` are the `Memory`s it reads besides its own (`agent.memory`), in order, up to 10:
a `Memory`, its id or name (its user's own, then the account's), or another agent's `memory`.
Each is read-only to it unless given as `memory.writable()`; a user's agent reads the account's
memories but never writes them, and never another user's. Every turn starts with each entry's name
and description, its own memory's first.

`skills` are the `Skill`s it uses, in order, up to 20: a `Skill` (`skill.pinned(n)` to hold
one version), its id or name (its user's own, then the account's). A coding harness finds them where
it reads skills; an `sdk` agent sees each one's name and description every turn and reads one with
`skill__read`.

`repos` clones repositories into its workspace, `/workspace/<name>`, at a
conversation's first turn: `connection.checkout(...)` for one a `github`
connection of its own scope reaches, or `repo.checkout(...)` for a NoClick `Repo` of
its own scope, up to 10 (none with `shell=False`). Its `git` reaches those
repositories only, through NoClick, with a key made for its sandbox; the
connection's token never enters it. A push goes through only to the branches
the checkout's `push` globs name (none: read-only): NoClick judges each push
on its way to the git host, because a harness's own `git push` is no tool
call your policy could judge. `gh` only reads a git host's there; pull requests and
issues are the connection's operations, in `tools`.

`secrets` (`Secret`s, ids or names; up to 20) become environment
variables in its shell on every turn, a later secret's key winning a clash
(a change reaches its next turn): its user's and the account's, an account
agent's the account's only. Its shell takes no model provider's key
(`OPENAI_API_KEY` and the like belong on `model_connection`): a secret
holding one raises `noclick.InvalidRequest`.

`shell=False` takes the shell (the `code` capability) away from an `sdk`
agent, and from the children it spawns; a CLI harness refuses it with
`noclick.InvalidRequest`, since its shell is the harness.

`turn_limits` is how far one turn of an `sdk` agent goes before it wraps up:
`{"steps": 100, "usd": 2, "minutes": 45}`, each left out at its default ($1 of
model calls and 30 minutes, with 200 model calls as a backstop; at most 200, $25
and 60). A turn its steps end stops there saying nothing and carries on by itself
in a follow-up turn on the same conversation, up to 3 in a row, unless a message
comes first; one its spend or minutes end says where the work stands and waits
to be asked (`reply.ended_by` names the limit). A coding harness ends its own
turns, and refuses it with `noclick.InvalidRequest`.

`network` says what its shell and code may reach: `True` (the default:
anywhere), `False`, or up to 50 hosts (`"pypi.org"`, or `"*.example.com"`
for a domain and its subdomains), over HTTPS on port 443 only. What it needs
to work stays reachable, and `False` leaves only that: an `sdk` agent's
shell reaches NoClick's git proxy when it has `repos` (its model and tools run
on NoClick); a coding harness reaches NoClick's API, NoClick's proxy for its
model on a key and for git, and on a Claude or ChatGPT plan that provider's own
hosts. Its tools run on NoClick, outside the limit. Without one it takes its
parent's, else anywhere, and the children it spawns take its. Where NoClick
can't keep to a limited network (a coding harness on a key other than
Claude, ChatGPT or OpenRouter, say), it raises `noclick.NotAvailable`
rather than widen it.

`browser_profile` (a `BrowserProfile` or id of its own user's, or your
account's for an account agent) signs its `browser` tool in with that
person's logins: each conversation gets a browser of its own for a turn, a
step only a person can do holds the turn `awaiting_human`, and its calls
follow policy as `browser.*`.

Invite-only beta: `card` (a `Card` or id of its own scope: a
user's agent pays with that user's cards, an account agent with your account's;
giving one takes the key's `cards` scope) is what it pays with: it holds the card
(a card has one agent at a time) and gets the tools `card__status` (what it can
spend now) and `card__purchase` (approve before paying: above the card's threshold
the turn waits for a person, and their answer is its next turn), which policy names
`card.status` and `card.purchase`. It never sees the number, and a turn answering
someone outside its scope, or a test run, can't buy anything. A child it spawns pays
with the same card only when given `"card"` (or one of the tools) in its `tools`.

Parameters:

- `name` (`str`, required)
- `instructions` (`str`, required)
- `model` (`str | None`, default `None`)
- `harness` (`str | None`, default `None`)
- `model_connection` (`Any`, default `None`)
- `tools` (`Sequence[Any] | None`, default `None`)
- `tool_rules` (`Mapping[str, str] | None`, default `None`)
- `ttl_s` (`int | None`, default `None`)
- `parent_id` (`Any`, default `None`)
- `budget_usd_per_month` (`float | None`, default `None`)
- `can_request` (`Sequence[Any] | None`, default `None`)
- `triggers` (`Sequence[Any] | None`, default `None`)
- `browser_profile` (`Any`, default `None`)
- `card` (`Any`, invite-only beta, default `None`)
- `volumes` (`Mapping[str, Any] | None`, default `None`)
- `secrets` (`Sequence[Any] | None`, default `None`)
- `timezone` (`str | None`, default `None`)
- `repos` (`Sequence[Any] | None`, default `None`)
- `network` (`bool | Sequence[str] | None`, default `None`)
- `shell` (`bool | None`, default `None`)
- `region` (`str | None`, default `None`)
- `machine` (`Any`, invite-only beta, default `None`)
- `memories` (`Sequence[Any] | None`, default `None`)
- `skills` (`Sequence[Any] | None`, default `None`)
- `turn_limits` (`Mapping[str, Any] | None`, default `None`)
- `effort` (`str | None`, default `None`)
- `speed` (`str | None`, default `None`)
- `permission_mode` (`str | None`, default `None`)
- `setup` (`Sequence[str] | None`, default `None`)
- `docker` (`bool | None`, default `None`)
- `sandbox_size` (`str | None`, default `None`)
- `app_testing` (`str | None`, default `None`)
- `model_switching` (`Any`, default `None`)
- `approvals` (`Mapping[str, Any] | None`, default `None`)
- `allow_existing` (`bool`, default `False`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `Agent` The new agent, loaded.

Usage:

Outside `as_user` the agent is your account's, shared by every user that messages it:

```python
support = noclick.Agent.create(
    "support",
    instructions="You answer questions about our product. Search the docs before answering.",
    tools=["search", "fetch"],
    budget_usd_per_month=50,
)
```

Inside `as_user` it's that user's own, and uses the user's connections:

```python
with noclick.as_user("user_42"):
    gmail = noclick.Connection.from_name("gmail", integration="gmail", create_if_missing=True)
    assistant = noclick.Agent.create("assistant", instructions="You help the user with their email.", tools=[gmail])
```

An operation that needs no account needs no connection, for any agent, a user's included:

```python
with noclick.as_user("user_42"):
    scout = noclick.Agent.create("scout", instructions="You research companies for the user.", tools=["exa.search"])
```

Run it on Claude Code, thinking with your Claude key. Its reply arrives whole, and a
conversation's first turn starts its sandbox:

```python
claude = noclick.Connection.from_name("claude", integration="anthropic", create_if_missing=True)
coder = noclick.Agent.create(
    "coder",
    instructions="You maintain our docs repo.",
    harness="claude_code",
    model="sonnet",
    model_connection=claude,
    tools=["github", "search"],
)
if not claude.connected:
    print(claude.connect_url)   # where someone pastes a Claude key
```

Make it once, and leave it alone after: a run that finds it returns it untouched, so an edit
someone made in the app stays:

```python
support = noclick.Agent.create(
    "support", instructions="You answer questions about our product.", allow_existing=True,
)
```

Give a coding agent a repository to work in, branches of its own to push to, and a
clock in your team's timezone:

```python
github = noclick.Connection.from_name("github", integration="github", create_if_missing=True)
fixer = noclick.Agent.create(
    "fixer",
    instructions="You fix failing tests in acme/web, push the fix to a branch and open a pull request.",
    harness="claude_code",
    model_connection="claude",
    timezone="Europe/Berlin",
    tools=[github.only("create_pull_request")],
    repos=[github.checkout("acme/web", push=["agent/*"])],
)
```

Keep a coding agent's sandbox in Europe, with everything it works on:

```python
reviewer = noclick.Agent.create(
    "reviewer",
    instructions="You review pull requests for our EU customers' code.",
    harness="codex",
    model_connection="openai",
    region="eu",
)
```

An agent that builds whole sites in one go, with room for more steps a turn:

```python
builder = noclick.Agent.create(
    "builder",
    instructions="You build and ship the sites you're asked for.",
    tools=["noclick"],
    turn_limits={"steps": 100},
)
```

An agent that only answers from its tools, with no shell:

```python
faq = noclick.Agent.create("faq", instructions="You answer from our help center.", tools=["search"], shell=False)
```

Keep its shell to the package index it installs from, beside its data:

```python
analyst = noclick.Agent.create(
    "analyst",
    instructions="You answer questions about our orders with pandas, from the data in /data.",
    volumes={"/data": noclick.Volume.from_name("orders", create_if_missing=True)},
    network=["pypi.org", "files.pythonhosted.org"],
)
```

### Agent.from_name

```python
noclick.Agent.from_name(
    name, *, create_if_missing=False, instructions=None, model=None, harness=None,
    model_connection=..., tools=None, tool_rules=None, ttl_s=None, parent_id=None,
    budget_usd_per_month=..., can_request=None, triggers=None, browser_profile=...,
    card=..., volumes=None, secrets=None, timezone=..., repos=None, network=None,
    shell=None, region=None, machine=None, memories=None, skills=None, turn_limits=...,
    effort=..., speed=..., permission_mode=..., setup=None, docker=None,
    sandbox_size=None, app_testing=None, model_switching=None, user=..., client=None
) -> Agent
```

A lazy reference to the agent called `name` in the current (or given) user:
inside `as_user` only their own, never an account agent of that name (reach that
outside `as_user` and message it for them). Given fields, it's two steps, taken the first time the reference is used: get the
agent, then set the fields you pass. `create_if_missing` only decides what happens when
there's none: `True` creates it with the fields `Agent.create` takes (`instructions`
is required then), else it raises `noclick.NotFound`. So every run of your code sets
them: on an existing agent, instructions, model, harness, `model_connection`, tools,
`tool_rules`, `can_request`, budget, `timezone`, `volumes`, `memories`, `secrets`, `repos`,
`network`, `shell`, `turn_limits`, `effort` or `speed` that differ are set to yours (the grants its user gave it are kept; a new `harness` without a
`model` takes that harness's default model, and its conversations carry on
on the new harness). So are its `triggers`: a trigger
your code no longer lists is removed and a new one added, while one that
stays keeps its webhook URL; mail and call triggers are never touched. So are its
`browser_profile`, and its `card` (invite-only beta). A field you leave
out is never changed, and `None` clears `model_connection`, `budget_usd_per_month`,
`browser_profile`, `card`, `timezone`, `turn_limits`, `effort` or `speed`, as in `update()`: moving an agent back to `sdk` takes
`harness="sdk", model_connection=None`. `region`, `ttl_s` and `parent_id` are set when
it's created, for good: an existing agent with another raises `noclick.Conflict` naming
the field and its value.

Setting fields is a write, every time it runs: do it at startup or in a setup script, and
take the bare `Agent.from_name("support")` in request handlers, or two versions of your
server would keep overwriting each other's values. To make an agent once and leave it alone
after, use `Agent.create(..., allow_existing=True)`.

Parameters:

- `name` (`str`, required)
- `create_if_missing` (`bool`, default `False`)
- `instructions` (`str | None`, default `None`)
- `model` (`str | None`, default `None`)
- `harness` (`str | None`, default `None`)
- `model_connection` (`Any`, default: unchanged)
- `tools` (`Sequence[Any] | None`, default `None`)
- `tool_rules` (`Mapping[str, str] | None`, default `None`)
- `ttl_s` (`int | None`, default `None`)
- `parent_id` (`Any`, default `None`)
- `budget_usd_per_month` (`Any`, default: unchanged)
- `can_request` (`Sequence[Any] | None`, default `None`)
- `triggers` (`Sequence[Any] | None`, default `None`)
- `browser_profile` (`Any`, default: unchanged)
- `card` (`Any`, invite-only beta, default: unchanged)
- `volumes` (`Mapping[str, Any] | None`, default `None`)
- `secrets` (`Sequence[Any] | None`, default `None`)
- `timezone` (`Any`, default: unchanged)
- `repos` (`Sequence[Any] | None`, default `None`)
- `network` (`bool | Sequence[str] | None`, default `None`)
- `shell` (`bool | None`, default `None`)
- `region` (`str | None`, default `None`)
- `machine` (`Any`, invite-only beta, default `None`)
- `memories` (`Sequence[Any] | None`, default `None`)
- `skills` (`Sequence[Any] | None`, default `None`)
- `turn_limits` (`Any`, default: unchanged)
- `effort` (`Any`, default: unchanged)
- `speed` (`Any`, default: unchanged)
- `permission_mode` (`Any`, default: unchanged)
- `setup` (`Sequence[str] | None`, default `None`)
- `docker` (`bool | None`, default `None`)
- `sandbox_size` (`str | None`, default `None`)
- `app_testing` (`str | None`, default `None`)
- `model_switching` (`Any`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `Agent` An agent that loads (or is created, or has your fields set) the first time it's used.
Nothing is sent yet.

Usage:

Refer to an agent by name without a request:

```python
support = noclick.Agent.from_name("support")
print(support.model)   # loads it now; noclick.NotFound if there's none
```

Set new instructions on the agent that's there (`noclick.NotFound` if there's none):

```python
support = noclick.Agent.from_name("support", instructions="You answer billing questions too.")
support.hydrate()
```

Or get it, creating it if it's missing, and set its fields. `instructions` is
required then, and a field you leave out is never changed on an agent that already exists:

```python
with noclick.as_user("user_42"):
    assistant = noclick.Agent.from_name(
        "assistant",
        create_if_missing=True,
        instructions="You help the user run their day. Ask for access to an account when you need it.",
        tools=["search"],
        can_request=["google_calendar", "gmail"],
    )
    reply = assistant.message("Put lunch with Bo on my calendar for Friday at noon")
```

An automation is an agent with a schedule among its triggers:

```python
digest = noclick.Agent.from_name(
    "digest",
    create_if_missing=True,
    instructions="You summarize yesterday's support tickets for the team.",
    tools=["search", "slack.send_message_to_channel"],
    triggers=[noclick.Cron("0 8 * * 1-5", tz="Europe/London", message="Post the overnight summary in #support")],
)
```

Give its shell a dataset and an API key:

```python
analyst = noclick.Agent.from_name(
    "analyst",
    create_if_missing=True,
    instructions="You answer questions about our orders. The data is in /data; call the warehouse "
                 "API with $WAREHOUSE_TOKEN for stock levels.",
    volumes={"/data": noclick.Volume.from_name("datasets", create_if_missing=True)},
    secrets=["warehouse"],
)
```

### Agent.from_id

```python
noclick.Agent.from_id(agent_id, *, client=None, user=...) -> Agent
```

A lazy reference to an agent by NoClick id.

Parameters:

- `agent_id` (`str`, required)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `Agent` An agent that loads the first time it's used. Nothing is sent yet.

Usage:

```python
agent = noclick.Agent.from_id("7b1e4f2a-3c9d-4e8b-a5f6-0d2c8e9b1a47")
reply = agent.message("Hi")
```

### Agent.get

```python
noclick.Agent.get(agent_id, *, user=..., client=None) -> Agent
```

Load an agent by NoClick id now; an unknown id raises `noclick.NotFound`.

Parameters:

- `agent_id` (`str`, required)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `Agent` The agent, loaded.

Usage:

```python
agent = noclick.Agent.get("7b1e4f2a-3c9d-4e8b-a5f6-0d2c8e9b1a47")
print(agent.name, agent.model, agent.user_id)
```

### Agent.list

```python
noclick.Agent.list(
    *, name=None, status=None, active_since=None, parent=None, temporary=None,
    harness=None, order=None, origin=None, limit=None, user_filter=None, user=...,
    client=None
) -> list[Agent]
```

The agents the current user can message: inside `as_user` their own and the
account's (messaged, not changed; `user_id` `None`), so a `name` may match
one of each; outside it, the account's. `user_filter` lists exactly whose agents instead: a `User` or your
id for one (only theirs), `noclick.NO_USER` (the account's) or `noclick.ALL_USERS`.

After the account's API agents come the ones built in the NoClick app, which are
the account's too (`origin="api"` or `"app"` lists only one kind). Of the
filters below, only `name` and `harness` apply to them; the others leave them out.

Expired agents are listed for the 30 days they're kept. `status` keeps the
`working`, `waiting`, `idle` or `expired` ones; `active_since` (an aware `datetime`)
those with a turn since then; `parent` (an `Agent` or id) its children;
`temporary` those with (or, False, without) a `ttl_s`; `harness` those on one
harness; and `order="last_active"` puts the most recently active first, those that
never ran last (`"created"`, the default, the newest first). These reads are cheap:
`last_active_at` is a column stamped as turns start and end, and the counts read
partial indexes.

Parameters:

- `name` (`str | None`, default `None`)
- `status` (`str | None`, default `None`)
- `active_since` (`Any`, default `None`)
- `parent` (`Any`, default `None`)
- `temporary` (`bool | None`, default `None`)
- `harness` (`str | None`, default `None`)
- `order` (`str | None`, default `None`)
- `origin` (`str | None`, default `None`)
- `limit` (`int | None`, default `None`): Return at most this many.
- `user_filter` (`Any`, default `None`): Which users a read covers: `noclick.ALL_USERS`, `noclick.NO_USER`, a `User`, or your id for one. It filters without acting as that user.
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `list[Agent]` Every matching agent, newest first (or most recently active first), fetched page by page.

Usage:

The agents the current user can message, then one name across every user:

```python
for agent in noclick.Agent.list():
    print(agent.name, agent.user_id)   # user_id is None for an account agent

assistants = noclick.Agent.list(name="assistant", user_filter=noclick.ALL_USERS)   # every user's, and the account's
```

What's busy right now, and what ran in the last hour:

```python
from datetime import datetime, timedelta, timezone

for agent in noclick.Agent.list(status="working"):
    print(agent.name, agent.running_turns, agent.last_active_at)
hour_ago = datetime.now(timezone.utc) - timedelta(hours=1)
recent = noclick.Agent.list(active_since=hour_ago, order="last_active", temporary=False)
```

The agents built in the app, and a message to one:

```python
for agent in noclick.Agent.list(origin="app"):
    print(agent.name, agent.workflow_name, agent.enabled, agent.app_url)
triage = noclick.Agent.list(origin="app", name="Triage")[0]
print(triage.message("Anything urgent in the queue this morning?").text)
```

### Agent.list_page

```python
noclick.Agent.list_page(
    *, cursor=None, limit=None, name=None, status=None, active_since=None, parent=None,
    temporary=None, harness=None, order=None, origin=None, user_filter=None, user=...,
    client=None
) -> Page
```

One page of agents; pass `next_cursor` back as `cursor`. Takes `list`'s
filters and `order`.

Parameters:

- `cursor` (`str | None`, default `None`): The `next_cursor` of the page before; omit it for the first page.
- `limit` (`int | None`, default `None`): Return at most this many.
- `name` (`str | None`, default `None`)
- `status` (`str | None`, default `None`)
- `active_since` (`Any`, default `None`)
- `parent` (`Any`, default `None`)
- `temporary` (`bool | None`, default `None`)
- `harness` (`str | None`, default `None`)
- `order` (`str | None`, default `None`)
- `origin` (`str | None`, default `None`)
- `user_filter` (`Any`, default `None`): Which users a read covers: `noclick.ALL_USERS`, `noclick.NO_USER`, a `User`, or your id for one. It filters without acting as that user.
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `Page` A page whose `data` holds the agents and whose `next_cursor` is `None` on the last page.

Usage:

```python
page = noclick.Agent.list_page(limit=50)
while True:
    for agent in page.data:
        print(agent.name)
    if page.next_cursor is None:
        break
    page = noclick.Agent.list_page(limit=50, cursor=page.next_cursor)
```

### Agent.coding

```python
noclick.Agent.coding(*, user_filter=None, user=..., client=None) -> CodingAgents
```

Every coding agent, and what each is doing. An agent on `claude_code`, `codex`, `opencode`,
`hermes` or `openclaw` (an app's own coding agent among them), with its `state` (`working`,
`waiting` on a person, `warm`, `paused` and why, `stopped`), where it runs, on whose model credential,
its current job, each conversation that's up (`runs`, a sandbox's with what it reserved) and its spend
since the first of the month; then counts by harness, model, state and place. Read from the turns, containers
and sandboxes themselves.
`user_filter` narrows it to whose (a `User` or your id for one, `noclick.NO_USER`,
`noclick.ALL_USERS`); omitted, every one of the account's for an account's key, a user's own for theirs.

Parameters:

- `user_filter` (`Any`, default `None`): Which users a read covers: `noclick.ALL_USERS`, `noclick.NO_USER`, a `User`, or your id for one. It filters without acting as that user.
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `CodingAgents` A `CodingAgents`.

Usage:

```python
coding = noclick.Agent.coding()
for agent in coding.agents:
    print(agent.name, agent.state, agent.job.title if agent.job else None)
```

### Agent.states

```python
noclick.Agent.states(
    *, workspace=None, user_filter=None, user=..., client=None
) -> list[AgentStateRow]
```

Every agent's state, for a list of agents. On any harness: what it's doing, the tool call it runs now, what
waits on a person and when, read from its turns, asks and held calls. `workspace` (a `Workspace` or id)
keeps a workspace's agents.

Parameters:

- `workspace` (`Any`, default `None`)
- `user_filter` (`Any`, default `None`): Which users a read covers: `noclick.ALL_USERS`, `noclick.NO_USER`, a `User`, or your id for one. It filters without acting as that user.
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `list[AgentStateRow]` An `AgentStateRow` per agent.

Usage:

```python
for row in noclick.Agent.states():
    print(row.name, row.state, (row.now or {}).get("line"), row.waiting["total"])
```

### Agent.harnesses

```python
noclick.Agent.harnesses(*, client=None) -> list[HarnessInfo]
```

What can run an agent. `sdk` is NoClick's own agent loop; the coding
agents each run in a sandbox of their own (`claude_code`, `codex`,
`opencode`, `hermes`, `openclaw`). On a CLI harness a reply arrives whole
rather than streaming, a conversation's first turn starts its sandbox (it stays
warm about a minute between turns), and the sandbox's uptime is billed.

Parameters:

- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `list[HarnessInfo]` Each harness's `name` (what `harness=` takes) and `default_model`, whether it
needs a `model_connection` and which model providers' `integrations` serve it,
whether its reply streams (`streaming`) and whether its `shell` is built in.
`models()` on one searches the models it offers.

Usage:

Pick a harness, then search the models it offers:

```python
for harness in noclick.Agent.harnesses():
    print(harness.name, harness.default_model)
[codex] = [h for h in noclick.Agent.harnesses() if h.name == "codex"]
print([m.id for m in codex.models(search="gpt-5")])
```

Or find which model providers can run Codex, to make its connection:

```python
[codex] = [h for h in noclick.Agent.harnesses() if h.name == "codex"]
print(codex.integrations, codex.notes)   # ['openai'] [...]
```

### Agent.harness_info

```python
noclick.Agent.harness_info(name, *, client=None) -> HarnessInfo
```

One of `harnesses()` by the name `harness=` takes; an unknown name raises
`noclick.NotFound`, naming the ones there are.

Parameters:

- `name` (`str`, required)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `HarnessInfo` The harness: its `default_model`, whether it needs a `model_connection`, the model
providers' `integrations` that serve it, and `models()` to search what it offers.

Usage:

```python
opencode = noclick.Agent.harness_info("opencode")
print(opencode.default_model, [m.id for m in opencode.models(search="claude", limit=5)])
```

### Agent.upload

```python
agent.upload(file, *, name=None, mime_type=None, voice=False, peaks=None) -> Attachment
```

Store a file to send this agent with a message: a path, bytes or a binary file object. It's kept as an account file, capped as those are: 10 MB an image (JPEG,
PNG, WebP or GIF), 15 MB a document, 20 MB audio or video. `voice=True`
marks a recorded clip (audio), which may carry its waveform `peaks`.
`message(files=[...])` uploads paths for you; upload first to send bytes
or a file object you name, or a voice clip.

Parameters:

- `file` (`Any`, required)
- `name` (`str | None`, default `None`)
- `mime_type` (`str | None`, default `None`)
- `voice` (`bool`, default `False`)
- `peaks` (`Sequence[float] | None`, default `None`)

Returns: `Attachment` The attachment; send it with `message(files=[...])`. An upload is sent once; sent, it's one of
the account's files (`noclick.attachments()`), which the account sends again.

Usage:

```python
support = noclick.Agent.from_name("support")
clip = support.upload(recording, name="question.webm", voice=True)
reply = support.message("Here's my question.", files=[clip])
```

### Agent.send

```python
agent.send(
    text=None, *, conversation=None, files=(), user=..., command=None, delivery=None
) -> Operation
```

Start a turn without waiting; `.wait()` returns the `AgentReply`.
`files` go with the message, as `message` sends them.

Args:
command: One of the conversation's harness's own commands, `{"name": ..., "arguments": ...}`, run in
place of `text` as that command (`commands` lists them), never parsed from text.
delivery: For a message sent while the agent works on a turn (it takes one at a time): `"steer"` puts
it into that turn when it's in the same conversation (else it's an ordinary message), `"queue"` (or
omitted) runs it as the agent's next turn. A command is never steered.

Parameters:

- `text` (`str | None`, default `None`)
- `conversation` (`str | None`, default `None`)
- `files` (`Sequence[Any]`, default `()`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `command` (`Mapping[str, str] | None`, default `None`)
- `delivery` (`str | None`, default `None`)

Returns: `Operation` The turn's operation, started. Keep its `id` to pick the reply up later, from anywhere.

Usage:

```python
support = noclick.Agent.from_name("support")
turn = support.send("Summarize this customer's open tickets")
print(turn.id)                                      # save it; then, later, anywhere:
reply = noclick.Operation.from_id(turn.id).wait()   # an AgentReply
print(reply.text)

coder = noclick.Agent.from_name("coder")
coder.send(conversation="main", command={"name": "compact"})
coder.send("also update the README", conversation="main", delivery="steer")
```

### Agent.commands

```python
agent.commands(conversation, *, user=...) -> AgentCommands
```

What the conversation's harness offers a person to run. Send one with `send(command=...)`.

Parameters:

- `conversation` (`str`, required)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `AgentCommands` Its commands and skills as the harness itself last listed them, what NoClick can and can't run there
(`capabilities`, `not_supported`), and how fresh the list is (`as_of`, `read_from`).

Usage:

```python
coder = noclick.Agent.from_name("coder")
for command in coder.commands("main").commands:
    print(f"/{command.name} {command.argument_hint}", command.description)
```

### Agent.set_permission_mode

```python
agent.set_permission_mode(conversation, mode, *, user=...) -> ConversationSettings
```

Set how far the conversation's coding harness goes before asking a person. `approval-required` asks
before commands and edits, `auto-accept-edits` runs edits and asks about commands, `auto` has its own
review approve routine work, and `full-access` (the default) asks nothing. Questions reach a person in every
mode. Its next message runs in it.

Parameters:

- `conversation` (`str`, required)
- `mode` (`str`, required)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `ConversationSettings` The conversation's settings: the mode set, the mode its harness runs (`effective_permission_mode`), the
modes it enforces and what it can't do.

Usage:

```python
coder = noclick.Agent.from_name("coder")
coder.set_permission_mode("main", "approval-required")
```

### Agent.requests

```python
agent.requests(conversation, *, status=None, user=...) -> list[HarnessRequest]
```

What the conversation's coding harness asked a person, newest first. `status` keeps `pending`,
`answered`, `expired` or `canceled` ones.

Parameters:

- `conversation` (`str`, required)
- `status` (`str | None`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `list[HarnessRequest]` Each `HarnessRequest`: an approval (what it would do) or a question, and where it stands.

Usage:

```python
for asked in coder.requests("main", status="pending"):
    print(asked.title or asked.questions)
```

### Agent.answer

```python
agent.answer(
    conversation, request_id, decision, *, note=None, answers=None, user=...
) -> HarnessRequest
```

Answer what the conversation's coding harness asks. The `decision` is `allow_once`, `allow_always`
(for the rest of the session, where the harness can), `reject_once` (with a `note` the agent reads; a
question: skip it) or `cancel` (the turn stops). A question is answered with `answers` ({question: [labels] or your own
words}) and `allow_once`. A person's answer: never through an MCP connection.

Parameters:

- `conversation` (`str`, required)
- `request_id` (`str`, required)
- `decision` (`str`, required)
- `note` (`str | None`, default `None`)
- `answers` (`Mapping[str, Any] | None`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `HarnessRequest` The request as it stands now (`answered`; a `cancel` stops the turn, which ends it `canceled`).

Usage:

```python
[asked] = coder.requests("main", status="pending")
coder.answer("main", asked.id, "reject_once", note="Push to a branch, not main.")
```

### Agent.message

```python
agent.message(
    text, *, conversation=None, files=(), timeout=None, user=...
) -> AgentReply
```

Send `text` and wait for the reply. Without `conversation` it goes to the
agent's session, the one conversation everyone talking to it shares (`session()`);
pass the reply's `conversation` back to stay in that thread. A channel's conversation
(`channel:<its id>`) raises `noclick.InvalidRequest`: only the channel starts
turns there, so post in the channel instead. `files` (at most 100) are
paths, which are uploaded first, attachments from `upload`, or (for the
account) its files from `noclick.attachments()`: the turn reads them as
the agent's media digest does, a document's text, a voice clip's
transcript, an image as an image.

Parameters:

- `text` (`str`, required)
- `conversation` (`str | None`, default `None`)
- `files` (`Sequence[Any]`, default `()`)
- `timeout` (`float | None`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `AgentReply` The reply: its `text`, the `conversation` it belongs to and the `tool_calls` the turn made.

Usage:

Ask, then keep talking in the same thread by passing its conversation back:

```python
support = noclick.Agent.from_name("support")
reply = support.message("Why was I charged twice in March?")
print(reply.text)
follow_up = support.message("Can you refund one of them?", conversation=reply.conversation)
```

Or name the thread yourself, with your own ticket id, say (1 to 128 letters,
digits and `. _ : @ + -`):

```python
support = noclick.Agent.from_name("support")
reply = support.message("Where's my refund?", conversation="ticket-1841")
```

A shared account agent talks to each of your users in threads of their own:

```python
support = noclick.Agent.from_name("support")
reply = support.message("Where's my invoice?", user="user_42")
```

With files:

```python
analyst = noclick.Agent.from_name("analyst")
reply = analyst.message("What stands out this quarter?", files=["q3-report.pdf", "chart.png"])
```

### Agent.history

```python
agent.history(conversation, *, limit=None, before=None, user=...) -> list[Message]
```

The messages of one conversation, oldest first. Every one, or the `limit` newest (1-200), just
before `before` (a `next_cursor` of `history_page`).

Parameters:

- `conversation` (`str`, required)
- `limit` (`int | None`, default `None`): Return at most this many.
- `before` (`str | None`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `list[Message]` Its messages, each with its `role`, `text`, `created_at`, the `files` it carried, how it
arrived (`via`, for a text, a call or an email) and, a reply, the `tool_calls` its turn made; a
`note` has its `data`.

Usage:

Read a whole thread:

```python
support = noclick.Agent.from_name("support")
for message in support.history("ticket-1841"):
    print(message.role, message.via or "api", message.text)
```

Or only its last few messages:

```python
support = noclick.Agent.from_name("support")
latest = support.history("ticket-1841", limit=20)
```

### Agent.history_page

```python
agent.history_page(conversation, *, limit=None, before=None, user=...) -> Page
```

A page of `history`, to read a long thread back. The `limit` newest messages
(1-200), just before `before`, oldest first.

Parameters:

- `conversation` (`str`, required)
- `limit` (`int | None`, default `None`): Return at most this many.
- `before` (`str | None`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `Page` A page whose `data` holds the messages and whose `next_cursor`, while older ones remain, is the
`before` of the page before it (None once it reaches the first message).

Usage:

Read a thread back, 50 messages at a time:

```python
support = noclick.Agent.from_name("support")
page = support.history_page("ticket-1841", limit=50)
while True:
    for message in reversed(page.data):
        print(message.role, message.text)
    if page.next_cursor is None:
        break
    page = support.history_page("ticket-1841", limit=50, before=page.next_cursor)
```

### Agent.note

```python
agent.note(conversation, text, *, data=None, key=None, user=...) -> bool
```

Add a line to a conversation without starting a turn. It shows in
`history` and `watch` as a `note` with its `data`, and the agent
reads both when its next turn starts, once.

Args:
conversation: The current user's conversation (the account's, outside `as_user`).
text: The line, 1-4,000 characters.
data: JSON your app reads back with it (at most 4,096 bytes).
key: Adds it once: a second note with the same key adds nothing.

Parameters:

- `conversation` (`str`, required)
- `text` (`str`, required)
- `data` (`dict[str, Any] | None`, default `None`)
- `key` (`str | None`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `bool` `True` when it was added, `False` when a note with `key` already was.

Usage:

```python
support = noclick.Agent.from_name("support")
support.note("ticket-1841", "Ada upgraded to the Pro plan.", data={"plan": "pro"}, key="plan:pro")
```

### Agent.withdraw_question

```python
agent.withdraw_question(conversation, note, *, question_id=None) -> list[str]
```

Withdraw the question the agent asked your account's owner once it no longer needs them. It was
answered or handled another way, in one of the account's conversations. Its page
and card then refuse a late answer, the turn that asked ends, and the agent reads `note` (1-4,000
characters: who answered, what was already sent) at its next turn there. `question_id`
names the question (its `HumanRequest.request_id`, as `noclick.HumanRequest.list` lists
it) when more than one waits there; the others keep waiting. It acts as the account, which
alone withdraws one, never a user. With none waiting, or several and none named, it raises
`noclick.Conflict`.

Parameters:

- `conversation` (`str`, required)
- `note` (`str`, required)
- `question_id` (`str | None`, default `None`)

Returns: `list[str]` The text of each question withdrawn.

Usage:

The owner answered by phone, so the agent's question waits no longer:

```python
support = noclick.Agent.from_name("support")
support.withdraw_question("ticket-1841", "Ana approved the refund on the phone; it's issued.")
```

### Agent.conversation

```python
agent.conversation(name, *, user=...) -> AgentConversation
```

One of its conversations, as a chat reads and changes it. Its settings, a fork, a revert, its context and
usage, a command, resuming it as the agent's session; sends nothing yet.

Parameters:

- `name` (`str`, required)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `AgentConversation` An `AgentConversation`.

Usage:

```python
chat = noclick.Agent.from_name("coder").conversation("main")
chat.update(effort="high")
```

### Agent.start_conversation

```python
agent.start_conversation(*, conversation=None, title=None, user=...) -> Conversation
```

Start a new session (a chat's `/new` or `/clear`), as `clear` does, with `conversation` naming its
key (one that already has messages raises `noclick.Conflict`); omitted, NoClick makes one. Everyone talking
to the agent shares it from now on, and the one it leaves is kept, listed and can be resumed. Raises
`noclick.Conflict` while the agent is working on a turn.

Parameters:

- `conversation` (`str | None`, default `None`)
- `title` (`str | None`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `Conversation` The new `Conversation`, `active`.

Usage:

```python
coder = noclick.Agent.from_name("coder")
fresh = coder.start_conversation(conversation="retries", title="Retries")
coder.message("Look at the retry worker")   # goes to the new session
```

### Agent.clear

```python
agent.clear(*, title=None, user=...) -> Conversation
```

Start a new session, like `/clear` in a terminal: everyone talking to the agent shares it from now on.
The one it leaves is kept, listed and can be resumed (`conversation(name).resume()`), and the agent's files
stay as they are. Raises `noclick.Conflict` while the agent is working on a turn.

Parameters:

- `title` (`str | None`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `Conversation` The new `Conversation`, `active`.

Usage:

```python
coder = noclick.Agent.from_name("coder")
before = coder.session()
coder.clear()
coder.message("Start on the billing page")   # the new session
coder.conversation(before.conversation).resume()
```

### Agent.session

```python
agent.session(*, user=...) -> Conversation | None
```

The agent's session: the one conversation everyone talking to it shares, where a message without a
`conversation` goes (the current user's, or the account's outside `as_user`).

Parameters:

- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `Conversation | None` Its `Conversation` (`active`), or `None` before the agent has one.

Usage:

```python
support = noclick.Agent.from_name("support")
current = support.session()
for message in support.history(current.conversation, limit=20):
    print(message.role, message.text)
```

### Agent.conversations

```python
agent.conversations(
    *, limit=None, user_filter=None, user=..., archived=None
) -> list[Conversation]
```

Its conversations, most recent first. The current user's, or those `user_filter` covers; `archived`
keeps the archived ones (`True`) or the others (`False`).
`user_filter` reads across users without the user header, which only the signed-in owner
may do on a user's own agent; with a secret key, read such an agent's threads without it.

Parameters:

- `limit` (`int | None`, default `None`): Return at most this many.
- `user_filter` (`Any`, default `None`): Which users a read covers: `noclick.ALL_USERS`, `noclick.NO_USER`, a `User`, or your id for one. It filters without acting as that user.
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `archived` (`bool | None`, default `None`)

Returns: `list[Conversation]` Every matching conversation (or the first `limit`), fetched page by page. `cost_usd`
is `None` for a thread with no recorded turns.

Usage:

Read the current user's threads (the account's, outside `as_user`):

```python
support = noclick.Agent.from_name("support")
for convo in support.conversations(limit=10):
    print(convo.conversation, convo.title, convo.turns, convo.cost_usd)
```

Or every user's threads with a shared agent, each naming its `user_id`
(`None` for the account's), and read one:

```python
support = noclick.Agent.from_name("support")
for convo in support.conversations(user_filter=noclick.ALL_USERS, limit=20):
    messages = support.history(convo.conversation, user=convo.user_id)
```

### Agent.conversations_page

```python
agent.conversations_page(*, cursor=None, limit=None, user_filter=None, user=...) -> Page
```

One page of its conversations; pass `next_cursor` back as `cursor`.

Parameters:

- `cursor` (`str | None`, default `None`): The `next_cursor` of the page before; omit it for the first page.
- `limit` (`int | None`, default `None`): Return at most this many.
- `user_filter` (`Any`, default `None`): Which users a read covers: `noclick.ALL_USERS`, `noclick.NO_USER`, a `User`, or your id for one. It filters without acting as that user.
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `Page` A page whose `data` holds the conversations and whose `next_cursor` is `None` on the last page.

Usage:

```python
support = noclick.Agent.from_name("support")
page = support.conversations_page(limit=50)
while True:
    for convo in page.data:
        print(convo.conversation, convo.last_activity)
    if page.next_cursor is None:
        break
    page = support.conversations_page(limit=50, cursor=page.next_cursor)
```

### Agent.hand_back

```python
agent.hand_back(conversation, *, user=...) -> None
```

Give a conversation back to the agent after it handed it to a person (its
`hand_off` tool). The person's replies stay in its history, and the agent answers
again from the next message. The person can hand it back from their page too.

Parameters:

- `conversation` (`str`, required)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Usage:

```python
support = noclick.Agent.from_name("support")
for convo in support.conversations(user_filter=noclick.ALL_USERS):
    if convo.status == "handed_off":
        support.hand_back(convo.conversation, user=convo.user_id)
```

### Agent.take_over

```python
agent.take_over(
    conversation, *, interrupt=False, cols=None, rows=None, user=...
) -> Terminal
```

Take over a coding agent's conversation. Its harness's own terminal (Claude Code, Codex, OpenCode, Hermes
Agent or OpenClaw) on the session the agent works in, for the account's owner. The turn in flight finishes
first unless `interrupt` stops it (its delivery fails, saying the owner took over); messages wait until it's
handed back. Needs the account's secret key with the `agents:terminal` scope: a terminal shows the sandbox's
keys and tokens. Asked again while it's taken over, it returns a new token (a reload, a second tab). Raises
`noclick.Conflict` when nothing of the conversation is running (send it a message first).

Args:
conversation: The current user's conversation (the account's, outside `as_user`).
interrupt: Stop its turn in flight now instead of letting it finish.
cols: The terminal's width in columns.
rows: The terminal's height in rows.

Parameters:

- `conversation` (`str`, required)
- `interrupt` (`bool`, default `False`)
- `cols` (`int | None`, default `None`)
- `rows` (`int | None`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `Terminal` A `Terminal`: its `url` and `token` open it (see `noclick.terminal`).

Usage:

```python
coder = noclick.Agent.from_name("coder")
terminal = coder.take_over("main", cols=120, rows=36)
send_to_browser(terminal.url, terminal.token)
```

### Agent.terminal

```python
agent.terminal(conversation, *, user=...) -> Terminal
```

Where a coding agent's conversation's terminal stands (`Terminal.state`), with no token. Open it with
`take_over`, give it back with `Terminal.hand_back`.

Parameters:

- `conversation` (`str`, required)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `Terminal` A `Terminal` with its `state`, and no `url` or `token`.

Usage:

```python
coder = noclick.Agent.from_name("coder")
if coder.terminal("main").state == "person":
    coder.terminal("main").hand_back()
```

### Agent.spawn

```python
agent.spawn(
    task, *, updates=None, conversation=None, instructions=None, tools=None,
    budget_usd=None, ttl_s=None, model=None, harness=None, model_connection=None,
    name=None, workstream=None, approvals=None, user=...
) -> Agent
```

Make a child agent and start `task` (its first message, up to 16,000
characters) at once. `child.job` is that task: a `Job` that runs while the
child works on it, across as many turns as it takes, and finishes when the child
stops with nothing left to continue it.

The child lives where its parent does and runs on the parent's harness, model and
model connection unless `harness`, `model` or `model_connection` say otherwise.
It gets only tools its parent has: `tools` names some of them (a narrower
`only(...)` of one of the parent's connections is fine, and `"card"` gives it the
card its parent pays with; anything the parent lacks raises `noclick.InvalidRequest`),
and without `tools` it has none of them (nor its parent's `can_request`). Like every agent it has its shell (none when its parent
has `shell=False`) and `wake_me`, and as a spawned child `tell_parent`, to reach its
parent whenever its instructions say to. A person among the parent's tools passes down
only with the tools the parent has of them, and a bound operation only as bound or
narrower. `instructions` are its
standing instructions: what its updates should say and when to reach out on its
own; NoClick adds a short brief saying it works on one task for its parent.
`budget_usd` is held out of what the parent's monthly budget has left (without
one, the child draws on the parent's as it spends), and `ttl_s` makes it
temporary. `name` defaults to `<parent>-<random>`. `workstream` is the line of
work the task belongs to (`noclick.Workstream`): one of yours, matched whatever its
case, or a new name, which makes one; every charge of the job, and of what it starts,
is counted under it.

`updates` is only when NoClick makes it report: `"done"` (always on: the job
finished, any outcome), `"blocked"` (it started waiting on a person),
`noclick.Before(*tools)` (before a matching tool call runs) and
`noclick.Every(interval)` (at least that often while it works). Each update is a
wake-up for the parent in `conversation`, the parent's conversation it belongs to
(`user=` says whose, as for `message`: your key acting for a user spawns from an
account agent in that user's thread, and the child is the account's; a user's own
session can't); updates that come while the parent is mid-turn arrive together in its
next turn. Without `conversation`, updates wake nobody and wait on the job
(`job.updates()`, and your webhooks' `agent.job.update` event).
A coordinator spawns the same way with its `agents` tools, its children's updates
waking it in the conversation it spawned from. An agent holds up to 20 live
children, and children spawn children up to 3 levels below an agent with no parent
(`noclick.QuotaExceeded`). `Agent.create(..., parent_id=)` still makes a child
without starting anything. The child follows its parent's `approvals`; its own (as `create` takes them)
only tighten them, and one looser than its parent's raises `noclick.InvalidRequest`.

Parameters:

- `task` (`str`, required)
- `updates` (`Sequence[Any] | None`, default `None`)
- `conversation` (`str | None`, default `None`)
- `instructions` (`str | None`, default `None`)
- `tools` (`Sequence[Any] | None`, default `None`)
- `budget_usd` (`float | None`, default `None`)
- `ttl_s` (`int | None`, default `None`)
- `model` (`str | None`, default `None`)
- `harness` (`str | None`, default `None`)
- `model_connection` (`Any`, default `None`)
- `name` (`str | None`, default `None`)
- `workstream` (`str | None`, default `None`)
- `approvals` (`Mapping[str, Any] | None`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `Agent` The child, loaded, with `parent_id` set to this agent and `job` its running task.

Usage:

Hand a coordinator's research to a helper and hear back in the launch conversation:

```python
planner = noclick.Agent.from_name("planner")
researcher = planner.spawn(
    "Find three recent launches in our category and summarize what worked.",
    instructions="Report each launch as you finish it with tell_parent. Cite your sources.",
    tools=["search", "fetch"],
    updates=["blocked", noclick.Every(900)],
    conversation="launch-plan",
    budget_usd=0.50,
    ttl_s=3600,
    workstream="Q3 launch",
)
print(researcher.job.status)   # running
```

From your own code, wait for the task the way you'd wait for a message:

```python
planner = noclick.Agent.from_name("planner")
reviewer = planner.spawn("Review the draft in /workspace/launch.md and list what's missing.")
reply = reviewer.job.wait(timeout=600)
print(reply.text)
```

Hear before money moves (the call still runs; a policy rule is what holds one):

```python
support = noclick.Agent.from_name("support")
refunder = support.spawn(
    "Refund order 1841 if it's within 30 days, then tell the customer.",
    tools=["stripe.create_refund", "gmail.send_email_message"],
    updates=[noclick.Before("stripe.create_refund")],
    conversation="ticket-1841",
    user="user_42",
)
```

### Agent.children

```python
agent.children(*, status=None, limit=None) -> list[Agent]
```

Its children, any status (an expired one for its 30 days), newest first:
`Agent.list(parent=self)`, read where this agent lives.

Parameters:

- `status` (`str | None`, default `None`)
- `limit` (`int | None`, default `None`): Return at most this many.

Returns: `list[Agent]` Each child with its `status`, `last_active_at`, `running_turns` and, if `spawn`
made it, the `job` it was started with.

Usage:

```python
planner = noclick.Agent.from_name("planner")
for child in planner.children(status="working"):
    print(child.name, child.running_turns, child.last_active_at)
```

### Agent.jobs

```python
agent.jobs(
    *, status=None, kind=None, agent=None, conversation=None, limit=None
) -> list[Job]
```

The jobs it started: the tasks of the children it spawned (`kind="task"`) and
the messages it sent with its `agents` tools (`kind="message"`, whose only update
is `done`). `status` takes operation statuses, or `"live"` for
every unfinished one; `agent` (an `Agent` or id) keeps the ones one agent does;
`conversation` the ones started from one of its conversations. Read where this agent
lives: an account agent's are every user's.

Parameters:

- `status` (`str | Sequence[str] | None`, default `None`)
- `kind` (`str | Sequence[str] | None`, default `None`)
- `agent` (`Any`, default `None`)
- `conversation` (`str | None`, default `None`)
- `limit` (`int | None`, default `None`): Return at most this many.

Returns: `list[Job]` Every matching job (or the first `limit`), newest first, each with its `status`, `step` and
`latest_update`; `wait()` on one gives its reply.

Usage:

```python
coordinator = noclick.Agent.from_name("coordinator")
for job in coordinator.jobs(status="live"):
    update = job.latest_update
    print(job.agent_id, job.status, job.step, update.text if update else "")
```

### Agent.ask

```python
agent.ask(
    question, *, conversation=None, interject=False, timeout=None, user=...
) -> AgentReply
```

Ask it something without stopping it. By default its model answers from a
snapshot of `conversation` as it stands: its instructions, the conversation, and
what a running turn has done so far, with no tools. The question and answer aren't
added to the conversation and the agent never sees them; a running turn carries on
untouched. The ask is recorded in its activity as an `agent.ask` operation and
billed like a short turn. On a coding harness the snapshot is what NoClick holds:
the conversation up to its last finished turn, plus what the running turn has done
so far: its NoClick tool calls and its own commands (with their output), edits and
reads, as its sandbox reported them; its model answers on its connection's key. An agent that
thinks with a Claude or ChatGPT plan raises `noclick.NotAvailable`: a plan runs
only in its harness, and answering in a one-off harness session is in invite-only
beta (`interject=True` works).

`interject=True` puts the question into the running turn instead (the harness's
own steering on a coding harness; before its next model call on `sdk`): the
agent sees it, may change course, and answers in that turn, which stays in the
conversation. With no turn running, it's an ordinary message. `conversation`
defaults to its session. Asked from another agent's turn, it's an ordinary
message: a job of the asker's whose reply wakes it.

Parameters:

- `question` (`str`, required)
- `conversation` (`str | None`, default `None`)
- `interject` (`bool`, default `False`)
- `timeout` (`float | None`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `AgentReply` The answer as an `AgentReply`; with `interject`, the reply the turn it joined ended with.

Usage:

Check on a child without interrupting it:

```python
planner = noclick.Agent.from_name("planner")
for child in planner.children(status="working"):
    print(child.name, child.ask("In one line: where are you, and what's left?").text)
```

Steer a coding agent mid-task:

```python
fixer = noclick.Agent.from_name("fixer")
reply = fixer.ask("Skip the flaky e2e suite; the unit tests are enough.", conversation="issue-1841",
                  interject=True)
```

### Agent.a2a_card

```python
agent.a2a_card() -> dict[str, Any]
```

The agent's A2A agent card (the JSON other agents discover it by).

Returns: `dict[str, Any]` The card as a dict: the agent's `name`, its JSON-RPC `url` and the `skills` it offers.

Usage:

```python
planner = noclick.Agent.from_name("planner")
card = planner.a2a_card()
print(card["url"], [skill["name"] for skill in card["skills"]])
```

### Agent.update

```python
agent.update(
    *, instructions=..., model=..., tools=..., tool_rules=..., name=..., harness=...,
    model_connection=..., budget_usd_per_month=..., budget_for_run=False,
    can_request=..., timezone=..., repos=..., network=..., shell=...,
    browser_profile=..., card=..., machine=..., memories=..., skills=...,
    turn_limits=..., effort=..., speed=..., permission_mode=..., setup=..., docker=...,
    sandbox_size=..., app_testing=..., model_switching=..., secrets=..., approvals=...
) -> Agent
```

Change fields. Grants its user gave it are kept. A new `harness` without
a `model` takes that harness's default model, and each conversation carries
on on the new harness, with its own memory and the memories it attaches, from
its next turn. `memories` are as in `create` (`[]` detaches them all), and `skills` too (a coding
harness's running sandbox restarts with them).
`model_connection=None` removes
an `sdk` agent's own model key. `timezone` is as in `create`, and
`timezone=None` goes back to the acting user's zone. `repos` are as in
`create`, from its next turn (a running sandbox restarts with them; a
clone already in a conversation's workspace stays as it is). `shell` is as in
`create`, and `network` too, from its next turn (a coding harness's running
sandbox restarts with it). `browser_profile` signs its browser in with
another profile of its scope, from its next browser, and `None` signs it out.
`card` (invite-only beta) gives it a card in
place of the one it holds, as in `create`, and `card=None` takes its card back.
`machine` (invite-only beta) moves it onto a
`Machine`, or with `None` back to a sandbox of its own; it moves between
turns and keeps its files. `turn_limits` is as in
`create`, from its next turn, and `None` goes back to the defaults. `effort`, `speed` and
`permission_mode` are as in `create`, and `None` clears one (`full-access` for the mode).
`docker` and `sandbox_size` are as in `create`, from its next turn (a running sandbox restarts with them):
`docker=False` drops its size, and `sandbox_size=None` is `"small"` again. `app_testing` is as in
`create`; `"never"` turns off what's on now, from its next turn. `model_switching` is as in `create`;
`None` goes back to the default rule. Letting it switch more freely is the owner's own call.
`secrets` are the secrets in its shell, as in `create`, in place of those it has (`[]` takes them all
away). `tool_rules` are as in `create`, in place of the ones it has (`{}` clears them). `name`
renames it, unique among its scope's agents: its old name keeps reaching it and stays reserved for it
(`former_names`), and a NoClick keeps its name. `approvals` changes the kinds it names, as in `create`
(`None` for a kind puts back the account's, a child's its parent's); what changed is in
`agent.raw["approval_changes"]`. Anyone who may change the agent tightens them; an agent loosening its own
or another's on its own initiative waits for the owner, and on the owner's own word it applies at once.
`budget_for_run=True` with `budget_usd_per_month` sets that budget for one run alone (its turn under
way, else its next one): the budget it replaced comes
back once that run ends, however it ends, and `budget_restore` says what comes back meanwhile. A budget
set without it stands until changed.

Parameters:

- `instructions` (`Any`, default: unchanged)
- `model` (`Any`, default: unchanged)
- `tools` (`Any`, default: unchanged)
- `tool_rules` (`Any`, default: unchanged)
- `name` (`Any`, default: unchanged)
- `harness` (`Any`, default: unchanged)
- `model_connection` (`Any`, default: unchanged)
- `budget_usd_per_month` (`Any`, default: unchanged)
- `budget_for_run` (`bool`, default `False`)
- `can_request` (`Any`, default: unchanged)
- `timezone` (`Any`, default: unchanged)
- `repos` (`Any`, default: unchanged)
- `network` (`Any`, default: unchanged)
- `shell` (`Any`, default: unchanged)
- `browser_profile` (`Any`, default: unchanged)
- `card` (`Any`, invite-only beta, default: unchanged)
- `machine` (`Any`, invite-only beta, default: unchanged)
- `memories` (`Any`, default: unchanged)
- `skills` (`Any`, default: unchanged)
- `turn_limits` (`Any`, default: unchanged)
- `effort` (`Any`, default: unchanged)
- `speed` (`Any`, default: unchanged)
- `permission_mode` (`Any`, default: unchanged)
- `setup` (`Any`, default: unchanged)
- `docker` (`Any`, default: unchanged)
- `sandbox_size` (`Any`, default: unchanged)
- `app_testing` (`Any`, default: unchanged)
- `model_switching` (`Any`, default: unchanged)
- `secrets` (`Any`, default: unchanged)
- `approvals` (`Any`, default: unchanged)

Returns: `Agent` This agent, updated. A field you leave out is unchanged, and changes apply from its next turn.

Usage:

Let it buy what costs $20 or less without asking (the account's ceiling must allow it):

```python
noclick.Agent.from_name("buyer").update(approvals={"purchase": {"disposition": "allow", "under_usd": 20}})
```

Change what it does and what it can use:

```python
support = noclick.Agent.from_name("support")
support.update(
    instructions="You answer billing questions and can refund a charge.",
    tools=["stripe.list_invoices", "stripe.create_refund", "search"],
)
```

Move it to Codex, on a ChatGPT connection:

```python
openai = noclick.Connection.from_name("openai", integration="openai", create_if_missing=True)
support = noclick.Agent.from_name("support")
support.update(harness="codex", model_connection=openai)
print(support.model)   # codex's default model
```

Tell it the time in New York:

```python
support = noclick.Agent.from_name("support")
support.update(timezone="America/New_York")
```

Keep its shell off the open internet:

```python
support = noclick.Agent.from_name("support")
support.update(network=["api.stripe.com"])
```

Let it read what another agent remembers:

```python
sales = noclick.Agent.from_name("sales")
noclick.Agent.from_name("support").update(memories=[sales.memory])
```

Give its turns more room, and keep each to $3:

```python
noclick.Agent.from_name("builder").update(turn_limits={"steps": 150, "usd": 3})
```

Hold its next job to $2, then give it its budget back:

```python
coder = noclick.Agent.from_name("coder")
coder.update(budget_usd_per_month=2, budget_for_run=True)
print(coder.budget_restore)   # {'budget_usd_per_month': 10.0, 'operation_id': None}
```

### Agent.grants

```python
agent.grants() -> list[AgentGrant]
```

The connections its user gave it at run time (requested or active), oldest first.

Returns: `list[AgentGrant]` Each grant with the `connection` it names, its `integration`, its `status` and the
`operations` it covers (`None`: every one).

Usage:

```python
assistant = noclick.Agent.from_name("assistant", user="user_42")
for grant in assistant.grants():
    print(grant.connection, grant.integration, grant.status, grant.operations)
    # google_calendar  google_calendar  active  None
```

### Agent.tool_access

```python
agent.tool_access() -> AgentToolAccess
```

What it may do with each app it reaches, app by app.

Returns: `AgentToolAccess` Each connection of its scope (connected later ones too), any app its rules name, NoClick and the web:
whether it's `on`, each action with what its rules say of it (`verdict`) and how often each ran in
the last 7 days (`calls`). `mode` is `restricted` when it's kept to the apps its rules turn on.

Usage:

```python
support = noclick.Agent.from_name("support")
for app in support.tool_access().apps:
    print(app.label, app.on, app.calls)
support.update(tool_rules={"work-gmail.delete_email_message": "off", "stripe.create_refund": "ask"})
```

### Agent.switch_model

```python
agent.switch_model(
    connection, *, reason=None, evidence=None, scope='once'
) -> dict[str, Any]
```

Move it onto another model connection (`Connection`, its name, or `"noclick"` for NoClick's key): its
harness and model too where that one runs another, its conversations carrying over from their next turn. The
same call its own `switch_model` tool makes, by its `model_switching` rule.

Any of the owner's own plans is allowed. A paid key is allowed on the owner's own call (their key or
session), or with `evidence` citing where they said so (`{"channel_id", "message_id", "quote"}`),
which NoClick checks is theirs, for this switch or, `scope="standing"`, whenever a plan runs out. Without
it, NoClick asks them with one tap.

Parameters:

- `connection` (`Any`, required)
- `reason` (`str | None`, default `None`)
- `evidence` (`Mapping[str, Any] | None`, default `None`)
- `scope` (`str`, default `'once'`)

Returns: `dict[str, Any]` `status`: `switched`, `unchanged`, or `asked` with its `request_id`.

Usage:

```python
atlas = noclick.Agent.from_name("atlas")
atlas.switch_model("claude-personal", reason="work plan used up")
```

### Agent.model_grants

```python
agent.model_grants() -> list[ModelSwitchGrant]
```

The owner's say-so for its paid keys, newest first.

Returns: `list[ModelSwitchGrant]` Each `ModelSwitchGrant`: which keys, once or standing, and how, where and when the owner gave it.

Usage:

```python
for grant in noclick.Agent.from_name("atlas").model_grants():
    print(grant.scope, grant.evidence.get("quote"))
```

### Agent.grant_model_switch

```python
agent.grant_model_switch(connections=None, *, scope='standing') -> ModelSwitchGrant
```

Let it move onto paid keys by itself (`connections`, or any): the owner's own call.

Parameters:

- `connections` (`Sequence[Any] | None`, default `None`)
- `scope` (`str`, default `'standing'`)

Returns: `ModelSwitchGrant` The `ModelSwitchGrant` kept.

Usage:

```python
noclick.Agent.from_name("scout").grant_model_switch(["kestrel-api"])
```

### Agent.revoke_model_grant

```python
agent.revoke_model_grant(grant) -> ModelSwitchGrant
```

Take back the owner's say-so (a `ModelSwitchGrant` or its id).

Parameters:

- `grant` (`Any`, required)

Returns: `ModelSwitchGrant` The grant, with `revoked_at`.

Usage:

```python
atlas = noclick.Agent.from_name("atlas")
for grant in atlas.model_grants():
    atlas.revoke_model_grant(grant)
```

### Agent.revoke_grant

```python
agent.revoke_grant(grant) -> None
```

Take back a grant (an `AgentGrant` or its id): its tools leave the
agent; the connection stays the user's.

Parameters:

- `grant` (`Any`, required)

Usage:

```python
assistant = noclick.Agent.from_name("assistant", user="user_42")
for grant in assistant.grants():
    if grant.integration == "slack":
        assistant.revoke_grant(grant)
```

### Agent.delete

```python
agent.delete() -> TrashItem
```

Delete the agent and the sub-agents under it: they go to the trash, restorable for 30 days. Its
pending wake-ups and jobs end now and stay ended if it's restored.

Returns: `TrashItem` Its `TrashItem`: `restore()` brings it and its sub-agents back.

Usage:

```python
noclick.Agent.from_name("support").delete()
```

### Agent.wake

```python
agent.wake(
    conversation, *, note, at=None, after=None, when=None, filters=None, every=None,
    user=...
) -> Wakeup
```

Have it take a turn later in `conversation`, told `note` (up to 4,000
characters) and what woke it. Exactly one of: `at` (an aware `datetime`),
`after` (seconds, or a `timedelta`), `when`: an `Operation` (a `Job`,
a `HumanRequest`, a `ConnectLink`, ...: it wakes when that settles, with its
outcome; one already settled wakes it at once), a list of them (up to 20: it wakes
once, when the last settles, told what each came to, and a child's `done` update
for one of those jobs comes in that turn), or a NoClick event type
(`"connection.connected"`, `"human.answered"`; `*` matches the rest of a name),
narrowed by `filters`, dotted paths into the event's `data` and the values they
must have: the first matching event after it was set wakes it, with the event; or
`every`, a `noclick.Cron`: a routine that wakes the conversation at each of its
times until it's canceled (`tz="user"` follows the conversation's user). A
user's conversation hears that user's events; one of your account's own hears every
event, your users' included. `user=` says whose conversation it is, as for
`message`.

A turn already running in the conversation goes first: the wake-up waits for it,
never `Conflict`. A channel's conversation raises `noclick.InvalidRequest`, as for
`message`. It survives restarts, starts its turn once, and is billed and
capped like any turn; when the turn can't be paid for, the wake-up fails with the
reason. A recurring one stays `pending`, due at its schedule's next time after each
turn, so times it missed (held, or late) fold into one turn. Every agent can also wake
itself with its `wake_me` tool, and list, change and cancel its own (`list_wakeups`,
`cancel_wakeup`), in the conversation it's in or, with `conversation`, another of its
own (never a channel's, nor from a conversation with someone outside its scope), so work
nobody is waiting on runs apart from the thread a person reads. An agent holds up to 100
pending wake-ups and 20 recurring ones
(`noclick.QuotaExceeded`); a time is 1 minute to 365 days ahead, a schedule comes
round at most every minute (every 15 for one the agent sets itself), and one
conversation's wake-ups at a time are delivered at least a minute apart (news, an
operation it waited on or a child's update, comes as soon as the conversation is free).

Parameters:

- `conversation` (`str`, required)
- `note` (`str`, required)
- `at` (`Any`, default `None`)
- `after` (`Any`, default `None`)
- `when` (`Any`, default `None`)
- `filters` (`dict[str, Any] | None`, default `None`)
- `every` (`Any`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `Wakeup` The wake-up, `pending`; `update()` changes it, `cancel()` calls it off.

Usage:

Pick a conversation up tomorrow morning, Berlin time:

```python
from datetime import datetime
from zoneinfo import ZoneInfo

support = noclick.Agent.from_name("support")
support.wake("ticket-1841", at=datetime(2026, 10, 2, 9, 0, tzinfo=ZoneInfo("Europe/Berlin")),
             note="Check whether the replacement shipped, and tell the customer.")
```

Carry on once the user has connected their calendar:

```python
with noclick.as_user("user_42"):
    assistant = noclick.Agent.from_name("assistant")
    calendar = noclick.Connection.from_name("calendar", integration="google_calendar", create_if_missing=True)
    link = calendar.connect_link(reason="to book your flights")
    assistant.wake("trip-planning", when=link, note="The calendar is connected: book the flights now.")
```

Or when the user's connection named gmail connects:

```python
with noclick.as_user("user_42"):
    assistant = noclick.Agent.from_name("assistant")
    assistant.wake("inbox-zero", when="connection.connected", filters={"name": "gmail"},
                   note="Gmail is connected: sort the inbox as we discussed.")
```

Keep a routine: every weekday at 8, in the user's own timezone:

```python
with noclick.as_user("user_42"):
    assistant = noclick.Agent.from_name("assistant")
    briefing = assistant.wake("briefing", every=noclick.Cron("0 8 * * 1-5", tz="user"),
                              note="Brief me on today's calendar and anything urgent in my inbox.")
```

### Agent.wakeups

```python
agent.wakeups(
    conversation=None, *, status=None, limit=None, user=..., user_filter=None
) -> list[Wakeup]
```

Its wake-ups in the acting user's conversations (or one `conversation`), or in
those of the users `user_filter` covers. They're those your code set, those it set itself
with `wake_me`, and NoClick's own: a child's update (`update`), the link it asked its
user to connect an account with being done (`answer`) and a decided approval
(`approval`). `status` keeps `pending`, `delivered`,
`canceled` or `failed` ones. `user_filter` (`noclick.ALL_USERS`,
`noclick.NO_USER`, a `User` or your id for one) reads across users without the user
header, as `conversations` does: an account agent's wake-ups in every user's threads.

Parameters:

- `conversation` (`str | None`, default `None`)
- `status` (`str | Sequence[str] | None`, default `None`)
- `limit` (`int | None`, default `None`): Return at most this many.
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `user_filter` (`Any`, default `None`): Which users a read covers: `noclick.ALL_USERS`, `noclick.NO_USER`, a `User`, or your id for one. It filters without acting as that user.

Returns: `list[Wakeup]` Every matching wake-up (or the first `limit`), newest first, each with its `source`, when it's
due (`at`) or what it waits for (`when`), whose thread it's in (`user_id`) and, once delivered,
the turn it started. `cancel()` acts in that wake-up's own thread.

Usage:

What will wake it in the acting user's threads:

```python
support = noclick.Agent.from_name("support")
for wakeup in support.wakeups(status="pending"):
    print(wakeup.conversation, wakeup.source, wakeup.at or wakeup.when, wakeup.note)
```

Or what will wake a shared agent in any of its users' threads:

```python
support = noclick.Agent.from_name("support")
for wakeup in support.wakeups(status="pending", user_filter=noclick.ALL_USERS):
    print(wakeup.user_id, wakeup.conversation, wakeup.at, wakeup.note)
```

### Agent.triggers

```python
agent.triggers() -> list[AgentTrigger]
```

What wakes it besides a message: schedules, webhooks, app and NoClick
events, queues, and the inboxes and numbers that hand it mail and calls.

Returns: `list[AgentTrigger]` Each trigger with its `kind`, its `spec`, its `status` (`paused` while the agent is),
the `url` a webhook listens at, when a schedule's `next_run` is and when it
`last_fired_at`. An `error` says why one can't fire.

Usage:

```python
support = noclick.Agent.from_name("support")
for trigger in support.triggers():
    print(trigger.kind, trigger.status, trigger.url or trigger.spec)
```

### Agent.add_trigger

```python
agent.add_trigger(trigger) -> AgentTrigger
```

Add a trigger: a `noclick.OnWebhook`, `OnEvent`, `OnPlatformEvent`, `Cron`
or `OnQueue`. An agent holds up to 20. (On an agent whose `from_name(..., triggers=...)`
sets its triggers, that code sets the list instead, and removes one added here the next time
it runs.)

Parameters:

- `trigger` (`Any`, required)

Returns: `AgentTrigger` The trigger as added; a webhook's `url` is where to send its POSTs. An event
trigger whose connection isn't connected yet is `error` until it is.

Usage:

Give an agent a URL your systems can wake it at:

```python
fulfilment = noclick.Agent.from_name("fulfilment")
orders = fulfilment.add_trigger(noclick.OnWebhook(name="orders"))
print(orders.url)
```

Or wake it on each new HubSpot contact:

```python
sales = noclick.Agent.from_name("sales")
sales.add_trigger(noclick.OnEvent("hubspot", "contact_created", message="Research this contact."))
```

Or put it on a schedule, which makes it an automation:

```python
support = noclick.Agent.from_name("support")
support.add_trigger(noclick.Cron("0 17 * * 5", tz="America/New_York", message="Send the weekly ticket report"))
```

### Agent.update_trigger

```python
agent.update_trigger(
    trigger, *, cron=None, message=..., conversation=..., filters=..., mode=None
) -> AgentTrigger
```

Change a trigger in place: it keeps its id, its history, and a webhook its URL. `cron`, a
`noclick.Cron`, moves a schedule to its time in its `tz` at once (and changes its
`message` when the `Cron` has one); `message` changes what any trigger's turn is
told, and `conversation` the template a webhook, event or queue trigger keys its
conversations by (`None` clears either); `filters` replaces an app event's or a NoClick
event's filters (it hears by them from the next delivery); `mode` (`"mentions"` or
`"all"`) changes the mode of a channel the agent sits in, for every agent in it (your key
needs `channels`). A webhook's name, an event's connection and event, and a queue stay:
remove it and add another for that. `trigger` is an `AgentTrigger`, its id, or the
definition you added, as for `remove_trigger`. Checked and registered as `add_trigger`
does; a paused schedule takes its new time when it resumes.

Parameters:

- `trigger` (`Any`, required)
- `cron` (`Cron | None`, default `None`)
- `message` (`Any`, default: unchanged)
- `conversation` (`Any`, default: unchanged)
- `filters` (`Any`, default: unchanged)
- `mode` (`str | None`, default `None`)

Returns: `AgentTrigger` The trigger as it is now, with its new `next_run_at`.

Usage:

```python
digest = noclick.Agent.from_name("digest")
[schedule] = [t for t in digest.triggers() if t.kind == "cron"]
digest.update_trigger(schedule, cron=noclick.Cron("30 7 * * 1-5", tz="Europe/London"))
```

### Agent.pause_trigger

```python
agent.pause_trigger(trigger) -> AgentTrigger
```

Pause one trigger, the agent running on. A schedule is skipped (its `next_run_at`
still reads), a webhook's calls and app or NoClick events are acknowledged and dropped, a
queue's messages wait on the queue. `pause()` stops everything that wakes the agent.

Parameters:

- `trigger` (`Any`, required)

Returns: `AgentTrigger` The trigger as it is now (`paused` is `True`).

Usage:

```python
support = noclick.Agent.from_name("support")
[orders] = [t for t in support.triggers() if t.spec.get("name") == "orders"]
support.pause_trigger(orders)
```

### Agent.resume_trigger

```python
agent.resume_trigger(trigger) -> AgentTrigger
```

Resume a trigger paused on its own, or one its failures stopped. It wakes the agent
again (a schedule at its next run), unless the agent itself is paused.

Parameters:

- `trigger` (`Any`, required)

Returns: `AgentTrigger` The trigger as it is now (`state` is `live` unless the agent is paused).

Usage:

```python
support = noclick.Agent.from_name("support")
for trigger in support.triggers():
    if "resume" in trigger.actions:
        support.resume_trigger(trigger)
```

### Agent.remove_trigger

```python
agent.remove_trigger(trigger) -> None
```

Remove a trigger: an `AgentTrigger`, its id, or the definition you added
(`noclick.NotFound` if none matches; an `OnWebhook` by its unique
`name`). Mail and call triggers change on their inbox or number.

Parameters:

- `trigger` (`Any`, required)

Usage:

```python
support = noclick.Agent.from_name("support")
for trigger in support.triggers():
    if trigger.kind == "webhook":
        support.remove_trigger(trigger)
```

### Agent.tool_servers

```python
agent.tool_servers(*, conversation=None) -> list[AgentToolServer]
```

Its MCP servers, each a step of its automation, with each one's state: how it lets its client in
(`sign_in`), its `status` and `problem`, the `tools` its last run found, its `host` and `icon`.
With `conversation`, each as that conversation's coding harness last said it where that's newer (`status`
`connecting` too), and whether it can connect one again in place now (`reconnectable`:
`agent.conversation(name).reconnect_tool_server(server.name)`).

Parameters:

- `conversation` (`str | None`, default `None`)

Returns: `list[AgentToolServer]` A list of `AgentToolServer`, in the order they were added.

Usage:

```python
for server in noclick.Agent.from_name("coder").tool_servers():
    print(server.name, server.status, [tool.name for tool in server.tools])
    if server.status == "needs_sign_in":
        print("Sign in:", server.connect_link().url)
```

### Agent.add_tool_server

```python
agent.add_tool_server(
    url, *, name=None, transport='http', credential=None, headers=None
) -> AgentToolServer
```

Give it an MCP server's tools from its next turn. The server is a step of its automation, reached at
its public https URL (`transport` `sse` for one that speaks only the older SSE), named `name`, else
after the URL's host (`mcp.linear.app` is `linear`). `credential` is the account's own sign-in to it,
which NoClick's MCP sign-in makes, or `headers` carry the key it takes instead (`{"Authorization": "Bearer <key>"}`): kept as a credential, sent on every request, never read back. A server that asks its
client to sign in, given neither, is added waiting for a person (`status` `needs_sign_in`):
`server.connect_link()` signs them in. Up to 20.

Parameters:

- `url` (`str`, required)
- `name` (`str | None`, default `None`)
- `transport` (`str`, default `'http'`)
- `credential` (`str | None`, default `None`)
- `headers` (`dict[str, str] | None`, default `None`)

Returns: `AgentToolServer` The `AgentToolServer` as added: its `id` (what `remove_tool_server` takes), `name`, `url`,
how it lets its client in (`sign_in`), its `status` and its `headers`' names.

Usage:

```python
coder = noclick.Agent.from_name("coder")
docs = coder.add_tool_server("https://mcp.example.com/mcp", name="docs",
                             headers={"X-Api-Key": os.environ["DOCS_KEY"]})
print(docs.id)
```

### Agent.update_tool_server

```python
agent.update_tool_server(server, *, headers) -> AgentToolServer
```

Replace an MCP server's headers. From its next turn it sends `headers` (a new key; `{}`: none), and
those given before are deleted.

Parameters:

- `server` (`str | AgentToolServer`, required)
- `headers` (`dict[str, str]`, required)

Returns: `AgentToolServer` The `AgentToolServer` as it stands, its `headers` naming the new ones.

Usage:

```python
coder = noclick.Agent.from_name("coder")
coder.update_tool_server("mcp_docs", headers={"X-Api-Key": os.environ["DOCS_KEY"]})
```

### Agent.remove_tool_server

```python
agent.remove_tool_server(server) -> None
```

Take an MCP server away (by `AgentToolServer` or `id`). Its tools stop from its next turn and
the headers given it go; its sign-in stays connected.

Parameters:

- `server` (`str | AgentToolServer`, required)

Usage:

```python
coder = noclick.Agent.from_name("coder")
coder.remove_tool_server("mcp_docs")
```

### Agent.rehearse_trigger

```python
agent.rehearse_trigger(trigger, *, sample=None) -> Operation
```

A test run of the turn a trigger would start now, without a real delivery. The agent
reads what `sample` would hand it (a webhook's body; an app event's or a NoClick event's
data; a queue message's body; an email's `{"from", "subject", "text"}`; a channel post's
text or `{"text", "from"}`), else a sample of its own (a schedule's or a recurring
wake-up's run; an app event's values placeholders in the shape it has reached your account
in, no data until one has; a NoClick event's from the event catalog), under the trigger's
`message`, its tool calls answered by a simulated world as in `rehearse`, so nothing is
sent. A call and an approval can't be tested. `trigger` is an `AgentTrigger`, its id,
or the definition you added.

Parameters:

- `trigger` (`Any`, required)
- `sample` (`Any`, default `None`)

Returns: `Operation` The run's operation (kind `agent.rehearse`); `.wait()` gives the `Rehearsal`.

Usage:

```python
whatsapp = noclick.Connection.from_name("whatsapp", integration="whatsapp")
inbox = noclick.Agent.from_name("inbox")
run = inbox.rehearse_trigger(noclick.OnEvent(whatsapp, "receive_message"))
print(run.wait().reply)
```

### Agent.inboxes

```python
agent.inboxes() -> list[Inbox]
```

The inboxes whose mail wakes it (created or updated with `agent=` it).

Returns: `list[Inbox]` Every such inbox, newest first, each with its `address`.

Usage:

```python
support = noclick.Agent.from_name("support")
print([inbox.address for inbox in support.inboxes()])
```

### Agent.pause

```python
agent.pause() -> Agent
```

Stop every trigger from waking it: scheduled runs are skipped (not made up),
webhook calls get a 409 their sender can retry, and app events, mail and
calls meanwhile don't wake it. Messages your code sends still run.

Returns: `Agent` This agent, with `paused` true.

Usage:

```python
digest = noclick.Agent.from_name("digest")
digest.pause()
print(digest.paused)   # True
```

### Agent.resume

```python
agent.resume() -> Agent
```

Let its triggers wake it again, including one that stopped after failing
the same way five times; a schedule picks up at its next run.

Returns: `Agent` This agent, with `paused` false.

Usage:

```python
digest = noclick.Agent.from_name("digest")
digest.resume()
```

### Agent.workspace

```python
agent.workspace(conversation=None, *, user=...) -> AgentWorkspace
```

The files it works on: its one `/workspace` (`AgentWorkspace`; a `conversation` is accepted and
ignored). Sends nothing yet.

Parameters:

- `conversation` (`str | None`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `AgentWorkspace` Its workspace, whose `files`, `read`, `write` and `url` reach its files.

Usage:

```python
support = noclick.Agent.from_name("support")
workspace = support.workspace(user="user_42")
for file in workspace.files():
    print(file.path, file.size_bytes)
```

### Agent.sandbox

```python
agent.sandbox(conversation=None, *, user=...) -> AgentSandbox
```

The machine it works on, one whoever it answers. An `AgentSandbox`: what it is and costs, its files, and
your own commands on it beside its work. Without a `conversation` it's read through its session. Sends
nothing yet.

Parameters:

- `conversation` (`str | None`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `AgentSandbox` Its sandbox, whose `get`, `files`, `read` and `exec` reach it.

Usage:

```python
coder = noclick.Agent.from_name("coder")
machine = coder.sandbox()
if machine.get().status == "running":
    print(machine.exec("git log --oneline -5").stdout)
```

### Agent.share

```python
agent.share() -> ShareLink
```

Turn on its public chat page, or read it if it's on: anyone with the
link talks to the agent, no sign-in, each visitor in their own
conversations. Their turns bill to you, against its budget, rate limited
per visitor.

Returns: `ShareLink` The link: its `url`, and `disable()` and `rotate()` to turn it off or change it.

Usage:

```python
support = noclick.Agent.from_name("support")
link = support.share()
print(link.url)   # https://noclick.com/a/...
```

### Agent.share_link

```python
agent.share_link() -> ShareLink | None
```

Its chat page as it is, without turning it on (`share()` does that).

Returns: `ShareLink | None` The link, `enabled` or not, or `None` if the agent has never been shared.

Usage:

```python
support = noclick.Agent.from_name("support")
link = support.share_link()
print(link.url if link and link.enabled else "Not shared")
```

### Agent.stream

```python
agent.stream(text, *, conversation=None, files=(), user=...) -> Iterator[AgentEvent]
```

Send `text` (and any `files`) and watch the turn as it happens: the
reply as it's written, each tool call and result, each file, approval and
long action, then the whole reply. The same turn as `message`, billed the
same.

Parameters:

- `text` (`str`, required)
- `conversation` (`str | None`, default `None`)
- `files` (`Sequence[Any]`, default `()`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `Iterator[AgentEvent]` `AgentEvent` values in order, ending with one whose `type` is `done` and whose `reply` is the
`AgentReply`. A turn that fails raises its error instead.

Usage:

Print the reply as it's written:

```python
support = noclick.Agent.from_name("support")
for event in support.stream("Where's my refund?", conversation="ticket-1841"):
    if event.type == "text":
        print(event.text, end="", flush=True)
    elif event.type == "tool_call":
        print(f"\n[{event.tool}]")
```

In async code, relay it to your own UI:

```python
support = noclick.Agent.from_name("support")
async for event in support.stream.aio("Where's my refund?", user="user_42"):
    await websocket.send_json(event.raw)
```

### Agent.watch

```python
agent.watch(conversation, *, user=..., replay=False) -> Iterator[AgentEvent]
```

Follow one conversation live, whoever moves it (a trigger, an answered `ask`,
an approved held call, another client, a person after a hand-off), your own turns
too (by `operation_id`). It
runs until you stop reading or the conversation is deleted. `replay` starts
with the last hour's kept moments, so a turn joined halfway is seen whole.

Parameters:

- `conversation` (`str`, required)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `replay` (`bool`, default `False`)

Returns: `Iterator[AgentEvent]` `AgentEvent` values as they happen: `message` (a whole message, with its `role`:
`user`, `assistant` or `person`, and its `files`), `text` as a reply is written,
`tool_call` (`held` names the approval when policy holds it), `tool_result`, `file`,
`approval` and `operation` (from its `"noclick"` tools), and `status` when the
conversation starts waiting on a person, is handed off or becomes `active`. A coding
harness's turn adds `output` and `diff` (`AgentEvent`).

Usage:

Push what happens in a support thread to your own UI:

```python
support = noclick.Agent.from_name("support")
for event in support.watch("ticket-1841", user="user_42"):
    if event.type == "message":
        print(event.role, event.text)
    elif event.type == "tool_call" and event.held:
        print("Waiting for approval:", event.held["url"])
```

In async code:

```python
support = noclick.Agent.from_name("support")
async for event in support.watch.aio("ticket-1841"):
    await websocket.send_json(event.raw)
```

### Agent.rehearse

```python
agent.rehearse(message, *, scenario=None, user=...) -> Operation
```

A test run of this agent against a simulated world. A real turn (its model, instructions and tools)
where that world answers every tool call, so nothing is sent, no
account is touched and its connections needn't be connected yet (its model
connection must be). `scenario` says what that world is like; the world
keeps to it, and without one it's an ordinary busy day. The run is billed
like a turn, counts toward the agent's budget, and is no turn in any of its
conversations. An account has up to 10 runs queued or running at once
(`noclick.QuotaExceeded` past that).

Parameters:

- `message` (`str`, required)
- `scenario` (`str | None`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `Operation` The run's operation (kind `agent.rehearse`); `.wait()` gives the `Rehearsal`: the `reply`, and
the `tool_calls` it made with what the world answered.

Usage:

```python
support = noclick.Agent.from_name("support")
run = support.rehearse(
    "Order 1841 arrived broken. I want my money back.",
    scenario="Order 1841 was delivered on Sep 2 and paid by card; the customer has asked once before.",
).wait()
print(run.reply)
for call in run.tool_calls:
    print(call["tool"], call["arguments"])
```

## noclick.AgentConversation

```python
class AgentConversation
```

One conversation with an agent, as a chat reads and changes it (`agent.conversation(name)`): its settings, a
fork, a revert, resuming it as the agent's session, its context and usage, a command. Sends nothing until you call
one.

| Attribute | Type | Description |
| --- | --- | --- |
| `name` | `str` | The conversation's key. |

### AgentConversation.settings

```python
agent_conversation.settings() -> ConversationSettings
```

What its next turn runs on, and what its harness and accounts offer.

Returns: `ConversationSettings` A `ConversationSettings`.

Usage:

```python
chat = noclick.Agent.from_name("coder").conversation("main")
settings = chat.settings()
print(settings.model, settings.effort, settings.efforts)
```

### AgentConversation.update

```python
agent_conversation.update(**changes) -> ConversationSettings
```

Change it from its next message: `permission_mode`, `title` (a rename) and `archived`. `model`,
`effort`, `speed` and `model_connection` change the agent itself, for every conversation, as
`Agent.update` does (`None` clears `effort`, `speed` or `model_connection`). Its harness stays the
agent's.

Parameters:

- `changes` (`Any`)

Returns: `ConversationSettings` Its `ConversationSettings` after the change.

Usage:

```python
chat = noclick.Agent.from_name("coder").conversation("main")
chat.update(model="opus", effort="high")   # the agent's, for everyone
chat.update(permission_mode="approval-required", title="Retries")
```

### AgentConversation.fork

```python
agent_conversation.fork(*, message=None, title=None) -> Conversation
```

Copy it into a new conversation, up to and with a message's turn (a `Message.id`; the whole thread when
omitted), with the same permission mode. Its agent reads the copy in its own history (`agent_reads`
`native`), or, where it can't, as context its first turn carries.

Parameters:

- `message` (`str | None`, default `None`)
- `title` (`str | None`, default `None`)

Returns: `Conversation` The new `Conversation`, with `forked_from`.

Usage:

```python
coder = noclick.Agent.from_name("coder")
last = coder.history("main")[-1]
fork = coder.conversation("main").fork(message=last.id)
coder.message("Try the other approach", conversation=fork.conversation)
```

### AgentConversation.resume

```python
agent_conversation.resume() -> Conversation
```

Make it the agent's session again, like `claude --resume`: everyone talking to the agent shares it from
now on, and a message without a `conversation` goes to it. The agent's files stay as they are. Raises
`noclick.Conflict` while the agent is working on a turn, and `noclick.NotFound` for a conversation the
agent never had.

Returns: `Conversation` Its `Conversation`, `active`.

Usage:

```python
coder = noclick.Agent.from_name("coder")
earlier = [c for c in coder.conversations(limit=20) if not c.active][0]
coder.conversation(earlier.conversation).resume()
```

### AgentConversation.revert

```python
agent_conversation.revert(message, *, files=False) -> ConversationRevert
```

Go back to before a message you sent (a `Message.id`): it and everything after it leave the thread and
what the agent reads; `files=True` also puts the files its edits since changed back as they were, before its
next turn. Raises `noclick.Conflict` while a turn runs or the agent waits on an answer there.

Parameters:

- `message` (`str`, required)
- `files` (`bool`, default `False`)

Returns: `ConversationRevert` A `ConversationRevert`, whose `text` is the message's.

Usage:

```python
coder = noclick.Agent.from_name("coder")
mine = [m for m in coder.history("main") if m.role == "user"][-1]
undone = coder.conversation("main").revert(mine.id, files=True)
print(undone.files["restored"])
```

### AgentConversation.context

```python
agent_conversation.context() -> ConversationContext
```

How full the model's context was at its last turn, against its window (a chat's `/context`).

Returns: `ConversationContext` A `ConversationContext`.

Usage:

```python
used = noclick.Agent.from_name("coder").conversation("main").context()
print(f"{used.percent}% of {used.window_tokens}")
```

### AgentConversation.usage

```python
agent_conversation.usage() -> ConversationUsage
```

What it cost and what pays for its model (a chat's `/usage`).

Returns: `ConversationUsage` A `ConversationUsage`.

Usage:

```python
spent = noclick.Agent.from_name("coder").conversation("main").usage()
print(spent.cost_usd, spent.pays_with)
```

### AgentConversation.tool_servers

```python
agent_conversation.tool_servers() -> ToolServers
```

The MCP servers its coding harness reaches its tools on: connected, connecting or failed, with their tools.

Returns: `ToolServers` A `ToolServers`.

Usage:

```python
for server in noclick.Agent.from_name("coder").conversation("main").tool_servers().servers:
    print(server.name, server.status, server.error)
```

### AgentConversation.reconnect_tool_server

```python
agent_conversation.reconnect_tool_server(name) -> ToolServers
```

Do one tool server's handshake again, where its harness can (`tool_servers().reconnect`): Claude Code and
OpenCode reconnect that server, Codex reloads all of them. Hermes Agent and OpenClaw connect theirs at every
turn, so this raises `noclick.Conflict` saying the next message reconnects them.

Parameters:

- `name` (`str`, required)

Returns: `ToolServers` A `ToolServers`, as it stands after the reconnect started.

Usage:

```python
noclick.Agent.from_name("coder").conversation("main").reconnect_tool_server("linear")
```

### AgentConversation.message_subagent

```python
agent_conversation.message_subagent(call_id, text) -> Operation
```

Tell one of its coding harness's own subagents something while it works: the `Task` (Claude Code) or
`task` (OpenCode) call `call_id` in the conversation's running turn, as its events name it. No harness
takes a message into its subagent, so it joins the main session's turn, which reads whom it's for and passes
it on; the thread keeps it as yours, its `subagent` naming the call. Raises `noclick.Conflict` once that
turn or the subagent has ended. A NoClick agent it started takes messages itself (`Agent.send`).

Parameters:

- `call_id` (`str`, required)
- `text` (`str`, required)

Returns: `Operation` Its `agent.ask` `Operation`, answered with the reply of the turn it joined.

Usage:

```python
chat = noclick.Agent.from_name("coder").conversation("main")
chat.message_subagent("toolu_01", "Also check the admin routes.").wait()
```

### AgentConversation.run_command

```python
agent_conversation.run_command(
    name, arguments='', *, delivery=None
) -> CommandResult | Operation
```

Run a command typed in a chat. One NoClick has a control for (`/model opus`, `/effort high`, `/fast`,
`/new`, `/context`, `/usage`, `/btw <question>`) comes back as that control's `CommandResult`; any
other runs as the harness's own command, its turn's `Operation`.

Parameters:

- `name` (`str`, required)
- `arguments` (`str`, default `''`)
- `delivery` (`str | None`, default `None`)

Returns: `CommandResult | Operation` A `CommandResult`, or the command's `Operation`.

Usage:

```python
chat = noclick.Agent.from_name("coder").conversation("main")
chat.run_command("effort", "high")
chat.run_command("compact").wait()
```

## noclick.AgentStateRow

```python
class AgentStateRow
```

One agent as a list shows it (`Agent.states()`): its `state` (`needs_you`: something waits on a person,
its harness's request included; `working`; `with_you`: a person has one of its conversations; `waking`: a
turn of its own is about to start; `failed`: its last turn failed; `idle`), the `conversation` that's in, the
tool call it runs `now` (`{tool, kind, line, since, running}`), what `waiting` counts (`asks`,
`held_calls`, `requests`, `total`) and when.

| Attribute | Type | Description |
| --- | --- | --- |
| `agent_id` | `str` |  |
| `name` | `str` |  |
| `harness` | `str` |  |
| `state` | `str` |  |
| `conversation` | `str | None` |  |
| `now` | `dict[str, Any] | None` |  |
| `waiting` | `dict[str, int]` |  |
| `turn_started_at` | `Any` |  |
| `last_active_at` | `Any` |  |
| `failed` | `dict[str, Any] | None` |  |
| `waking` | `dict[str, Any] | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.CommandResult

```python
class CommandResult
```

What a command NoClick has a control for came to: its `control` (`model`, `effort`, `new`, `context`,
`usage`, `ask`…) and that control's answer (`result`: the conversation's settings, a new conversation, its
context or usage, or an operation).

| Attribute | Type | Description |
| --- | --- | --- |
| `control` | `str` |  |
| `command` | `dict[str, str]` |  |
| `result` | `dict[str, Any]` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.ConversationContext

```python
class ConversationContext
```

How full the model's context was at the conversation's last turn: `used_tokens` of `window_tokens`
(`percent`), as its coding harness reported them (`source` `harness`) or as NoClick's runtime sent its last
call (`noclick`), and where it folds the thread by itself (`auto_compacts_at`, a share of the window). `None`
figures before a first turn.

| Attribute | Type | Description |
| --- | --- | --- |
| `model` | `str | None` |  |
| `used_tokens` | `int | None` |  |
| `window_tokens` | `int | None` |  |
| `percent` | `float | None` |  |
| `auto_compacts_at` | `float | None` |  |
| `source` | `str | None` |  |
| `as_of` | `Any` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.ConversationRevert

```python
class ConversationRevert
```

A revert: the message it went back to before (its `text`, to send again), how many turns left the thread,
what the agent reads (`agent_reads`: `native` in its own history, `context` carried by its next turn), and the
files: `files["restored"]` are put back before its next turn (in its sandbox, where they are), `kept` (with
`files=False`), `not_restored` (`{path, why}`: an edit too large to have been kept whole) and
`commands_not_undone`.

| Attribute | Type | Description |
| --- | --- | --- |
| `conversation` | `str` |  |
| `message` | `str` |  |
| `text` | `str` |  |
| `dropped_turns` | `int` |  |
| `files` | `dict[str, Any]` |  |
| `files_applied` | `str | None` |  |
| `agent_reads` | `str` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.AgentToolServer

```python
class AgentToolServer
```

An MCP server an agent has as tools: a step of its automation (`id`, what `remove_tool_server` takes),
reached at its `url` (on `host`) over `transport` (`http` or `sse`), letting its client in as
`sign_in` says (`none`, `key`: the `headers` named, whose values are never read back, or `browser`: a
person's sign-in, `signed_in` once one is set). Its `status`: `connected`, `needs_sign_in` (nothing lets
it in yet), `signed_out` (its sign-in was refused or revoked), `failed` (its last run found no tools),
`unchecked` (no run since it was last let in) or, read for a conversation, `connecting` (its harness's handshake
hasn't finished), with what's wrong in `problem`; the `tools` it offered and when that was found
(`checked_at`); whether that conversation's harness can connect it again in place now (`reconnectable`); and
what draws it (`icon`: `{"integration": name}`, `{"mark": "noclick"}`, or `None`: draw its name's first
letter). Listed in the order they were added.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |
| `name` | `str` |  |
| `url` | `str | None` |  |
| `transport` | `str` |  |
| `signed_in` | `bool` |  |
| `headers` | `list[str]` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |
| `agent_id` | `str | None` |  |
| `host` | `str | None` |  |
| `sign_in` | `str` |  |
| `status` | `str` |  |
| `problem` | `ToolServerProblem | None` |  |
| `tools` | `list[ToolServerTool]` |  |
| `icon` | `dict[str, str] | None` |  |
| `checked_at` | `Any` |  |
| `reconnectable` | `bool` |  |

### AgentToolServer.connect_link

```python
agent_tool_server.connect_link(
    *, redirect_url=None, reason=None, send_to=None
) -> ConnectLink
```

Mint a link where someone signs in to this server (`sign_in` `browser`), the first time or again:
NoClick's MCP sign-in for it, which becomes the server's sign-in once it lands. `send_to` ("user",
"owner" for your account's owner, an email, or a dict) also delivers it. A server that takes a key raises
`noclick.Conflict`: give it headers with `agent.update_tool_server`.

Parameters:

- `redirect_url` (`str | None`, default `None`)
- `reason` (`str | None`, default `None`)
- `send_to` (`Any`, default `None`)

Returns: `ConnectLink` The link: its `url`, when it `expires_at`, and where it went when you set `send_to`. It's also the
operation that finishes once they've signed in: `link.wait()` returns this `AgentToolServer` as it
stands then.

Usage:

```python
for server in noclick.Agent.from_name("coder").tool_servers():
    if server.status in ("needs_sign_in", "signed_out"):
        print(server.name, server.connect_link().url)
```

## noclick.ConversationUsage

```python
class ConversationUsage
```

What a conversation cost: `cost_usd` (what its turns were charged), its model calls on your own key or plan
(`model_usage`, `None` on NoClick's key), its `turns`, what pays for its model (`pays_with`: `noclick`,
`key` or `plan`) and, on a plan, its limits where its harness reported them (`plan_limits`, each `{label, used_percent, resets_at}`).

| Attribute | Type | Description |
| --- | --- | --- |
| `cost_usd` | `float` |  |
| `model_usage` | `dict[str, Any] | None` |  |
| `turns` | `int` |  |
| `pays_with` | `str` |  |
| `plan_limits` | `list[dict[str, Any]]` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.ToolServer

```python
class ToolServer
```

One MCP server a conversation's coding harness reaches its tools on: `status` `connected`, `connecting`
(its handshake hasn't finished) or `failed` (`error` says why), how many tools it offers the model where the
harness says (`tool_count`), and each of them (`tools`) where it lists them (Claude Code and Codex do; else
`None`).

| Attribute | Type | Description |
| --- | --- | --- |
| `name` | `str` |  |
| `status` | `str` |  |
| `tool_count` | `int | None` |  |
| `error` | `str | None` |  |
| `tools` | `list[ToolServerTool] | None` |  |

## noclick.ToolServerProblem

```python
class ToolServerProblem
```

What's wrong with an agent's MCP server, as a connection's `disconnected` says it: `reason`
(`needs_sign_in`, `signed_out`, `refused`, `revoked` or `failed`), NoClick's one line (`message`), the
server's own words where it said any (`provider_said`), since when (`since`, unknown for a server never
signed in to) and what to do (`next_step`).

| Attribute | Type | Description |
| --- | --- | --- |
| `reason` | `str` |  |
| `message` | `str` |  |
| `provider_said` | `str | None` |  |
| `since` | `Any` |  |
| `next_step` | `str | None` |  |

## noclick.ToolServers

```python
class ToolServers
```

A conversation's tool servers: read live from its running harness (`source` `live`), else as its last turn
found them (`last_turn`), else none yet (`none`). `reconnect` is `{available, scope, why}`: whether one
server's handshake can be done again in place (`scope` `server`), only all of them at once (`all`), or not
and why not.

| Attribute | Type | Description |
| --- | --- | --- |
| `servers` | `list[ToolServer]` |  |
| `source` | `str` |  |
| `checked_at` | `Any` |  |
| `reconnect` | `dict[str, Any]` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.ToolServerTool

```python
class ToolServerTool
```

A tool an MCP server offers: its `name` and `description`, as the server lists it.

| Attribute | Type | Description |
| --- | --- | --- |
| `name` | `str` |  |
| `description` | `str | None` |  |

## noclick.AgentCommand

```python
class AgentCommand
```

One command a conversation's harness offers: its `name` (without the slash), what it does, what its
arguments look like (`argument_hint`), where it comes from (`source`: `harness`, `custom`, `skill` or
`mcp`) and the other names it answers to.

| Attribute | Type | Description |
| --- | --- | --- |
| `name` | `str` |  |
| `description` | `str` |  |
| `argument_hint` | `str` |  |
| `source` | `str` |  |
| `aliases` | `list[str]` |  |

## noclick.AgentCommands

```python
class AgentCommands
```

What a conversation's harness offers a person to run, read from the harness itself: its `commands` and
`skills` (each `{name, description}`); `capabilities` (`commands`, `skills`, `compact`, `review`,
`goal`, `init`, `steer`, `queue`); `not_supported`, what NoClick can't run there and why; `withheld`,
the commands NoClick never runs from a chat (those that change what NoClick sets up and guards for the agent: its
MCP servers, permissions, credentials, model provider, process or settings files); `mapped`, the harness's
commands NoClick has a control of its own for, each `{name, to}` (`to`: `model`, `effort`, `new`,
`usage`, `context`, `plan`, `delivery` or `ask`), which a page offers in their place; and how fresh the
list is: `as_of` (when it was
read) and `read_from` (`this_conversation` or `another_conversation`: it's kept per agent and harness, so a
stopped sandbox's last list still answers), both None before its sandbox ever started.

| Attribute | Type | Description |
| --- | --- | --- |
| `harness` | `str` |  |
| `commands` | `list[AgentCommand]` |  |
| `skills` | `list[dict[str, str]]` |  |
| `capabilities` | `dict[str, bool]` |  |
| `not_supported` | `dict[str, str]` |  |
| `withheld` | `list[str]` |  |
| `mapped` | `list[dict[str, str]]` |  |
| `as_of` | `Any` |  |
| `read_from` | `str | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.AgentGrant

```python
class AgentGrant
```

A connection the agent's user gave it at run time (it asked with its
`request_connection` tool, within `can_request`). `status` is
`requested` until the user connects, then `active`; `operations` None
means every operation.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |
| `connection` | `str` |  |
| `integration` | `str` |  |
| `operations` | `list[str] | None` |  |
| `status` | `str` |  |
| `reason` | `str | None` |  |
| `conversation` | `str | None` |  |
| `created_at` | `Any` |  |
| `granted_at` | `Any` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.ConversationSettings

```python
class ConversationSettings
```

What a conversation's next turn runs on: the agent's `model`, `effort`, `speed` and `model_connection`
(an agent is one session, so every conversation runs on them); the `efforts` and `speeds` its harness takes on
that model; what can pay for it (`accounts`); its permission mode (`permission_mode`,
`effective_permission_mode`: the strictest its harness enforces when it can't enforce the one set,
`permission_modes`, `not_supported`); its `title`, whether it's `archived` and what it was forked from.

| Attribute | Type | Description |
| --- | --- | --- |
| `permission_mode` | `str` |  |
| `effective_permission_mode` | `str` |  |
| `permission_modes` | `list[str]` |  |
| `not_supported` | `dict[str, str]` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |
| `conversation` | `str | None` |  |
| `title` | `str | None` |  |
| `archived` | `bool` |  |
| `harness` | `str | None` |  |
| `model` | `str | None` |  |
| `effort` | `str | None` | How hard its model reasons (`None`: the model's own default, `default_effort` when the harness says it). |
| `efforts` | `list[str]` | The efforts its harness takes on its model, weakest first, in the harness's own words. |
| `default_effort` | `str | None` |  |
| `speed` | `str` |  |
| `speeds` | `list[str]` | `["standard", "fast"]` where its harness has a fast mode on its model; `[]` where it has none. |
| `model_connection` | `str | None` |  |
| `accounts` | `list[dict[str, Any]]` | What can pay for it: each `{name, integration, kind (key, plan or noclick), connected, usable, why}`. |
| `overridden` | `list[str]` | What the conversation sets itself: its `permission_mode`. |
| `forked_from` | `dict[str, Any] | None` | `{conversation, message, through}`: what it was forked from (`through`: its own last copied message). |

## noclick.HarnessRequest

```python
class HarnessRequest
```

What a coding harness asks a person mid-turn: an `approval` (`action`: `command`, `edit`, `plan`
(leaving Claude Code's plan mode, its `plan` text), `read`, `fetch` or `tool`; `title` in a line,
`detail` the command or the files) or a `question` (`questions`, each `{id, header, question, options, multi_select}`). `options` are ACP's (`allow_once`, `allow_always`, `reject_once`); `status` is
`pending` until it's `answered`, `expired` (nobody answered in time: declined) or `canceled` (its turn
stopped). Answer it with `Agent.answer`.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |
| `kind` | `str` |  |
| `status` | `str` |  |
| `action` | `str | None` |  |
| `title` | `str | None` |  |
| `detail` | `str | None` |  |
| `plan` | `str | None` |  |
| `questions` | `list[dict[str, Any]]` |  |
| `options` | `list[dict[str, str]]` |  |
| `answer` | `dict[str, Any] | None` |  |
| `operation_id` | `str | None` |  |
| `created_at` | `Any` |  |
| `expires_at` | `Any` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |
| `decision` | `str | None` | What it was answered with (`allow_once`, `reject_once`, …) and when; None until it's answered. |
| `answered_at` | `Any` |  |
| `canceled_reason` | `str | None` | Why it was closed unanswered: its turn ended first (failed, stopped, timed out). |

## noclick.AgentReply

```python
class AgentReply
```

The agent's answer to one message.

| Attribute | Type | Description |
| --- | --- | --- |
| `text` | `str` |  |
| `conversation` | `str | None` |  |
| `tool_calls` | `list[dict[str, Any]]` | The turn's tool calls, each `{tool, arguments, result, is_error, created_at}` as `history()` shows a reply's (a failed call's `result` is its error); a coding harness's own steps add `source: "harness"` and the rest of an `AgentStep` (its `id`, `kind`, `command`, `path`, `output`, `exit_code`, `duration_ms`, `diffs`), in the order they happened. |
| `operation_id` | `str | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |
| `model_usage` | `ModelUsage | None` | The turn's model calls on your own key or plan (`None` on NoClick's key, whose cost is its `cost_usd`). |
| `ended_by` | `str | None` | The limit that ended the turn before it finished (`"steps"`, `"spend"` or `"time"`: its `turn_limits`), its text then saying where the work stands; `None` when the agent answered. |
| `summary` | `TurnSummary | None` | What a coding harness's turn did (`None` for a turn with no harness steps). |
| `groups` | `list[StepGroup]` | Its harness steps' folds, in order. |
| `steps` | `list[AgentStep]` | `tool_calls` as `AgentStep`s. |

## noclick.AgentStep

```python
class AgentStep
```

One step of a turn as its reply keeps it (`Message.steps`, `AgentReply.steps`). `kind` is a coding
harness's shell `command`, file `edit`, `read` or `search`, or any other `tool` (NoClick's own among
them). A coding harness's own step (`source` `harness`) has the fields its live events showed as it ran, under
its `call_id`: its `tool_call` (`kind`, `tool`, `arguments`, `command`, `path`, `query`), its
command's `output` (the last 4,096 characters; what came before reads `[… N characters not shown …]`), its
`tool_result` (`exit_code`, `duration_ms`, `is_error`, `result`) and each `diff` (`diffs`). A turn keeps
at most 200 such steps and 256,000 characters of their output and diffs, the newest steps' first. NoClick's own tool
calls are `kind` `tool`, with no `call_id`.

What a harness's step did, in words, judged once by NoClick as it ran: its `category` (`read`, `search`,
`list`, `edit`, `test`, `install`, `run` or `tool`), its `label` (`StepLabel`) and where that came
from (`label_source`: the harness's own `description`, Codex's `actions`, or `derived` from the command),
the command as shown (`display_command`: no `cd` into where it runs, heredocs shortened), a read's `lines`
(`{from, to}`), the files a read or an edit named (`paths`), how many lines it printed (`output_lines`), a test run's `tests`, a count it reported
(`progress`), an edit's `diff_stat`, whether it `failed` (a search that found nothing didn't) and the
`group` it folds into (`StepGroup.id`).

| Attribute | Type | Description |
| --- | --- | --- |
| `kind` | `str` |  |
| `tool` | `str` |  |
| `call_id` | `str | None` |  |
| `source` | `str | None` |  |
| `arguments` | `dict[str, Any]` |  |
| `command` | `str | None` |  |
| `path` | `str | None` |  |
| `query` | `str | None` |  |
| `output` | `str | None` |  |
| `exit_code` | `int | None` |  |
| `duration_ms` | `int | None` |  |
| `is_error` | `bool` |  |
| `result` | `Any` |  |
| `diffs` | `list[AgentStepDiff]` |  |
| `created_at` | `Any` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |
| `category` | `str | None` |  |
| `label` | `StepLabel | None` |  |
| `label_source` | `str | None` |  |
| `display_command` | `str | None` |  |
| `lines` | `dict[str, Any] | None` |  |
| `output_lines` | `int | None` |  |
| `tests` | `StepTests | None` |  |
| `progress` | `StepProgress | None` |  |
| `diff_stat` | `DiffStat | None` |  |
| `failed` | `bool | None` |  |
| `group` | `str | None` |  |
| `paths` | `list[str]` | The files a read or an edit named, as it named them. |

## noclick.AgentStepDiff

```python
class AgentStepDiff
```

One file a step changed: a unified diff, or a new file's whole content (`change` `add`), at most 16,384
characters.

| Attribute | Type | Description |
| --- | --- | --- |
| `path` | `str` |  |
| `change` | `str | None` |  |
| `diff` | `str` |  |

## noclick.ChangedFile

```python
class ChangedFile
```

A file a turn changed: the lines its edits added and removed, and `how` where not by an edit tool
(`sed`, `script`, `a command`): such a change carries no counts.

| Attribute | Type | Description |
| --- | --- | --- |
| `path` | `str` |  |
| `added` | `int` |  |
| `removed` | `int` |  |
| `how` | `list[str]` |  |

## noclick.DiffStat

```python
class DiffStat
```

The lines an edit's diffs added and removed.

| Attribute | Type | Description |
| --- | --- | --- |
| `added` | `int` |  |
| `removed` | `int` |  |

## noclick.StepGroup

```python
class StepGroup
```

Reads, searches and listings a coding harness made in a row, folded into one line as Claude Code folds them
(never a failed step): `label` (`Read 6 files, searched for 3 patterns`; `Reading …` while one runs), the
`counts` (`read`: files, `search`, `list`), its steps (`step_ids`) and `parent`, the subagent call
whose steps they are. A group no longer standing (a step left it) has no `step_ids`.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |
| `label` | `str | None` |  |
| `counts` | `dict[str, int]` |  |
| `step_ids` | `list[str]` |  |
| `running` | `bool` |  |
| `parent` | `str | None` |  |

## noclick.StepLabel

```python
class StepLabel
```

What a coding harness's step did, in words, in its tense: running as it runs (`Reading attachments.py`),
done once it ended (`Read attachments.py lines 55-110`). `text` is the whole line; `verb`, `object` and
`detail` its parts.

| Attribute | Type | Description |
| --- | --- | --- |
| `text` | `str` |  |
| `verb` | `str | None` |  |
| `object` | `str | None` |  |
| `detail` | `str | None` |  |

## noclick.StepProgress

```python
class StepProgress
```

How far a step is, where it reported a count (a test run whose total is known, `[64/161]`): `done` of
`total`. A step that names no total has none.

| Attribute | Type | Description |
| --- | --- | --- |
| `done` | `int` |  |
| `total` | `int` |  |

## noclick.StepTests

```python
class StepTests
```

A test run's counts, read from what it printed (pytest, vitest, jest, node's runner, cargo): as it streams
(`done` False; `total` once it's known) and at its end, and in words (`label`: `161 passed`, `2 of 43 failed`, `64 of 161`).

| Attribute | Type | Description |
| --- | --- | --- |
| `passed` | `int` |  |
| `failed` | `int` |  |
| `skipped` | `int` |  |
| `total` | `int | None` |  |
| `done` | `bool` |  |
| `label` | `str` |  |

## noclick.TurnChanges

```python
class TurnChanges
```

The files a turn changed: `label` (`Changed 5 files`), each file, the lines added and removed, and how
many were changed only by a script or a command (`by_script`).

| Attribute | Type | Description |
| --- | --- | --- |
| `label` | `str` |  |
| `files` | `list[ChangedFile]` |  |
| `added` | `int` |  |
| `removed` | `int` |  |
| `by_script` | `int` |  |

## noclick.TurnSummary

```python
class TurnSummary
```

What a coding harness's turn did: `label` (`Read 9 files, searched 7 times`), its steps' `counts` by
category (read, search, list, edit, test, install, run, tool), how many `failed`, what it `changed` and its
last test run's counts (`tests`).

| Attribute | Type | Description |
| --- | --- | --- |
| `label` | `str | None` |  |
| `counts` | `dict[str, int]` |  |
| `failed` | `int` |  |
| `changed` | `TurnChanges | None` |  |
| `tests` | `StepTests | None` |  |

## noclick.Conversation

```python
class Conversation
```

One thread with an agent; pass `conversation` back to continue it or to `history()`.

| Attribute | Type | Description |
| --- | --- | --- |
| `conversation` | `str` |  |
| `user_id` | `str | None` |  |
| `title` | `str | None` |  |
| `preview` | `str | None` |  |
| `turns` | `int | None` |  |
| `cost_usd` | `float | None` |  |
| `last_activity` | `Any` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |
| `status` | `str | None` | `active`; `awaiting_human` while a turn waits on a person (an `ask`, a held call, a sign-in); `handed_off` while a person has it. |
| `handed_off_to` | `str | None` | Who a `handed_off` conversation is with: the person's email or phone. |
| `model_usage` | `ModelUsage | None` | Its model calls on your own key or plan, all turns together (`None` on NoClick's key). |
| `last_message` | `dict[str, Any] | None` | Its newest message: `{role, text, created_at}` (`None` before any). |
| `people` | `list[dict[str, Any]]` | Who is in it: each `{type, id, name}`, the thread's own person first, then whoever else wrote in it. |
| `archived` | `bool` |  |
| `forked_from` | `dict[str, Any] | None` | `{conversation, message, through}`: the conversation it was forked from. |
| `agent_reads` | `str | None` | A fork's: `native` when the agent reads the copy in its own history, `context` when carried as context. |
| `active` | `bool` | Whether it's the agent's session now, the one conversation everyone talking to it shares; the others can be resumed. |

## noclick.Message

```python
class Message
```

One message of a conversation: its `role` is `user`, `assistant`,
`person` (someone it was handed off to) or `note` (a line added with
`agent.note`, with its `data`).

| Attribute | Type | Description |
| --- | --- | --- |
| `role` | `str` |  |
| `text` | `str` |  |
| `created_at` | `Any` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |
| `files` | `list[Attachment]` | The files it carried (a `user` message's, sent with `files=`). |
| `tool_calls` | `list[dict[str, Any]]` | A reply's tool calls: each `{tool, arguments, result, is_error, created_at}`, as its turn's `tool_call` and `tool_result` events showed it (`arguments` cut short are `{"_truncated": True}`); a coding harness's reply has its own steps among them, in the order they happened (`AgentStep`). |
| `via` | `str | None` | How a `user` message reached the agent when not through the API: `whatsapp`, `imessage` (a text to NoClick's number), `call` (said on a phone call) or `email` (mail to one of its inboxes). |
| `data` | `dict[str, Any] | None` | A `note`'s data, as `agent.note` added it. |
| `trigger` | `dict[str, Any] | None` | What started the turn of a `user` message no person sent: `{kind, id, title}`, `kind` a trigger's (`webhook`, `event`, `cron`, `platform`, `queue`), `wakeup`, or `app_testing` (NoClick carrying on once app testing changed); a NoClick event's has its `event` (`{id, type, data}`). None for a message someone sent. |
| `reasoning` | `list[dict[str, Any]]` | A reply's reasoning: each `{text, created_at}`, a short line of what its model was thinking, as its turn's `reasoning` events showed it. |
| `operation_id` | `str | None` | The turn it belongs to (an `agent.message` operation's id; `None` for a message no turn sent, like a person's). |
| `command` | `dict[str, str] | None` | The harness command a `user` message ran in place of text: `{name, arguments}`. None for a message. |
| `id` | `str | None` | Its place in the thread, which stays (a revert marks, never removes): what `fork` and `revert` take. |
| `author` | `dict[str, Any] | None` | Who sent a `user` message: `{type, id, name}`, `type` `account` (the account itself, its owner or a key), `user` (one of your users, or you in a workspace you joined: `id` is that user's id), `agent` or `app` (an app's code). None where nobody's named (a trigger's event, an older message). |
| `notification` | `bool` | An agent's message to its owner from another of its conversations (a `human__notify` that joined this thread). |
| `space` | `dict[str, Any] | None` | A `notification` passing on a space's news (a space's NoClick alerted the person, or answered a question their NoClick asked it): `{workspace_id, name, label}`, `label` what that NoClick goes by outside its space ("NoClick · Launch"). None otherwise. |
| `subagent` | `dict[str, str] | None` | A `user` message written for one of its coding harness's subagents (`message_subagent`): `{id, title}`, `id` the harness's call that runs it. None otherwise. |
| `chat` | `str | None` | The chat a message of the agent's session came from, where it isn't the session's own: the `conversation` it was sent to (a WhatsApp chat's id, `channel:<id>`, `owner`, a shared page's visitor), which its reply goes back to. None otherwise. |
| `summary` | `TurnSummary | None` | What a coding harness's reply's turn did (`None` where it says nothing). |
| `groups` | `list[StepGroup]` | Its harness steps' folds, in order. |
| `steps` | `list[AgentStep]` | `tool_calls` as `AgentStep`s. |

## noclick.HarnessInfo

```python
class HarnessInfo
```

What can run an agent: one of `Agent.harnesses()`. `sdk` is NoClick's own
agent loop; the others are coding agents that run in a sandbox of their own, with
a shell and files, and think with the key or plan of a `model_connection`.
`models()` searches the models it offers.

| Attribute | Type | Description |
| --- | --- | --- |
| `name` | `str` | What `harness=` takes: `sdk`, `claude_code`, `codex`, `opencode`, `hermes` or `openclaw`. |
| `label` | `str | None` |  |
| `version` | `str | None` | The version NoClick runs (`None` for `sdk`). |
| `default_model` | `str` | The `model` an agent on it gets when you give none. |
| `custom_models` | `bool` | Whether `model=` also takes models `models()` doesn't offer. |
| `model_connection` | `str` | `"required"` for every CLI harness, `"optional"` for `sdk`. |
| `integrations` | `list[str]` | The model providers (`kind="model"` integrations) whose connection it can think with. |
| `streaming` | `str` | `"tokens"` when the reply streams as it's written, `"final"` when it arrives whole. |
| `shell` | `str` | `"built_in"` when it has its own shell and file tools, `"code_capability"` when its shell is the `code` tool. |
| `notes` | `list[str]` | What to know before choosing it (a model that needs a particular key, say). |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |
| `efforts` | `list[str]` | The reasoning efforts it takes on its default model, weakest first (`[]`: none). |
| `default_effort` | `str | None` | The effort it runs at when none is set (`None`: the model's own). |
| `speeds` | `list[str]` | `["standard", "fast"]` where it has a fast mode on its default model, else `[]`. |
| `noclick_key` | `dict[str, Any]` | Whether a coding agent on it may run on NoClick's own key (`model_connection="noclick"`, at the model's cost): `{runs, models}` (models to suggest there), or `{runs: False, why}`. |
| `permission_modes` | `list[str]` | The permission modes it enforces (`[]`: none, as on `sdk`), and why it runs the others as another. |
| `not_supported` | `dict[str, str]` |  |

### HarnessInfo.models

```python
harness_info.models(search=None, *, limit=50) -> list[HarnessModel]
```

The models it offers, its default first: the first `limit` (at most 200), or
those whose id or label contains `search` (ignoring case). A search after a
few quiet minutes reads the providers' lists afresh, so it can take seconds.

Parameters:

- `search` (`str | None`, default `None`)
- `limit` (`int`, default `50`): Return at most this many.

Returns: `list[HarnessModel]` Each model's `id` (what `model=` takes) and `label`. A harness whose
`custom_models` is True also runs ids it doesn't list.

Usage:

Find a Claude model for an agent on OpenCode:

```python
[opencode] = [h for h in noclick.Agent.harnesses() if h.name == "opencode"]
for model in opencode.models(search="claude", limit=10):
    print(model.id, model.label)
```

Check that a model is one Claude Code offers before creating the agent:

```python
[claude_code] = [h for h in noclick.Agent.harnesses() if h.name == "claude_code"]
offered = [m.id for m in claude_code.models(search="opus")]
print("opus" in offered)
```

## noclick.HarnessModel

```python
class HarnessModel
```

A model a harness offers, by the `id` its `model=` takes. One model reached
several ways is a row per way, each with its `route` (`maker`, `openrouter`,
`opencode` or `opencode-go`) and the same `canonical`, the model as its maker
names it (`anthropic/claude-sonnet-5-5`); a model reached one way is its own
`canonical`.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |
| `label` | `str | None` |  |
| `canonical` | `str` |  |
| `route` | `str` |  |
| `noclick_key` | `dict[str, Any] | None` | What it costs on NoClick's own key: `output_usd_per_million` (`None` for a router priced as the model it picks for each call) and `needs_funds_usd`, the funds your account must have added (not its plan's included usage) to put an agent on it there: set for a model over $2 a million output tokens, else `None`. `None` where the key doesn't run it on this harness, or its price can't be read now. |

## noclick.ModelUsage

```python
class ModelUsage
```

What an agent's model calls on your own key or plan (its `model_connection`) used:
tokens in (`cached_tokens` of them read from the provider's cache), tokens out, and what
they come to in US dollars at the provider's list price. NoClick doesn't bill these calls (the
key or plan pays); this is how you see them. A coding harness on a plan counts what it reports,
priced as if it ran on a key.

| Attribute | Type | Description |
| --- | --- | --- |
| `input_tokens` | `int` |  |
| `output_tokens` | `int` |  |
| `cached_tokens` | `int` |  |
| `usd` | `float` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.ModelSwitching

```python
class ModelSwitching
```

How an agent moves to another of its owner's model connections when its plan runs out, or when it's told to.

`mode="switch"` (a new agent's default): it moves by itself, to any of the owner's own Claude or ChatGPT plans
freely, and to a paid key (an API key, NoClick's key at cost) only on the owner's say-so. `mode="stay"`: it
never leaves its connection, and at a limit waits for the reset. `allowed`: the connections (`Connection` or
names) it moves between freely, paid keys included; None for the default rule. Only what's given is sent: an
update changes only those (`allowed` alone never changes its mode).

Usage:

```python
atlas = noclick.Agent.from_name("atlas")
atlas.update(model_switching=noclick.ModelSwitching(mode="stay"))
```

| Attribute | Type | Description |
| --- | --- | --- |
| `mode` | `Any` |  |
| `allowed` | `Any` |  |

## noclick.ModelSwitchGrant

```python
class ModelSwitchGrant
```

The owner's say-so for an agent's paid keys: which (`connections`, None for any), `once` or `standing`,
and how they gave it (`source`: `cited`, words of theirs the agent cited, with `evidence` saying where and
when, the quote and a link; `asked`, their tap; `owner`, their own call).

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |
| `connections` | `list[str] | None` |  |
| `scope` | `str` |  |
| `source` | `str` |  |
| `evidence` | `dict[str, Any]` |  |
| `granted_by` | `dict[str, Any]` |  |
| `used_at` | `str | None` |  |
| `revoked_at` | `str | None` |  |
| `created_at` | `str | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.AgentToolAccess

```python
class AgentToolAccess
```

What an agent may do with each app it reaches (`agent.tool_access()`). `mode` is `restricted` when
it's kept to the apps its rules turn on, else `everything`; `listed` when its `tools` are a list rather
than everything, whose `rules` are what that list amounts to; `since` when the `calls` counted start.

| Attribute | Type | Description |
| --- | --- | --- |
| `mode` | `str` |  |
| `listed` | `bool` |  |
| `rules` | `dict[str, str]` |  |
| `since` | `Any` |  |
| `apps` | `list[AgentToolApp]` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.AgentToolApp

```python
class AgentToolApp
```

One app in `agent.tool_access()`: a connection of its scope, an integration its rules name, NoClick or
the web (`kind`). `key` is its rule key (None for the web, whose actions `search` and `fetch` are keys of
their own); `account` the account it's connected as (else its name); `on` whether anything of it may run.

| Attribute | Type | Description |
| --- | --- | --- |
| `key` | `str | None` |  |
| `app` | `str` |  |
| `kind` | `str` |  |
| `integration` | `str | None` |  |
| `credential_type` | `str | None` |  |
| `label` | `str` |  |
| `account` | `str | None` |  |
| `status` | `str | None` |  |
| `on` | `bool` |  |
| `calls` | `int` |  |
| `actions` | `list[AgentToolAction]` |  |

## noclick.AgentToolAction

```python
class AgentToolAction
```

One action of an app in `agent.tool_access()`: its rule `key`, what its rules say of it
(`verdict`: `allow`, `ask` or `off`) and how often it ran. `group` is its integration's own
grouping of it (`Message`, `Invoices`); `kind` what it does, from its name (`read`, `send`,
`change`, `delete` or `money`: a hint, never a rule); `can_ask` False where `ask` can't hold it
(reading never waits for a person).

| Attribute | Type | Description |
| --- | --- | --- |
| `key` | `str` |  |
| `action` | `str` |  |
| `title` | `str` |  |
| `group` | `str | None` |  |
| `kind` | `str` |  |
| `verdict` | `str` |  |
| `can_ask` | `bool` |  |
| `calls` | `int` |  |

## noclick.AgentMemory

```python
class AgentMemory
```

`agent.memory`: named notes the agent keeps across conversations.
Every turn starts with each entry's name and description; the agent reads a
body when it needs one, and saves what it learns. Your code can seed,
read, correct and forget entries the same way.

An account agent keeps two layers: entries saved outside `as_user` are
the account's, read in every user's conversations (your refund policy),
and what it learns while talking to a user is that user's alone. A
user's own agent has one memory, the user's. The agent changes the
account's entries only in conversations your code has with it outside
`as_user`, and only reads its memory when it answers someone outside
your account (an inbox's sender, a caller, a visitor to its share link).
A long conversation also keeps its checkpoint here, in that conversation's
layer (`MemoryEntry.conversation`).

It's a `noclick.Memory` (its id is `agent.memory_id`) that goes with
the agent: another agent of its scope can read it too, with
`memories=[agent.memory]`, and named memories (`noclick.Memory`) are
attached the same way.

Usage:

```python
support = noclick.Agent.from_name("support")
support.memory.save("refunds", "Refund within 30 days of purchase.", description="Our refund rules")
print([entry.name for entry in support.memory.list()])
```

### AgentMemory.list

```python
agent.memory.list(*, user=...) -> list[MemoryEntry]
```

The entries of one layer: the account's outside `as_user`, else the user's.

Parameters:

- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `list[MemoryEntry]` Each entry's name, description, version and when it last changed, by name; `content` is
`None` here, so `read` an entry for its body.

Usage:

```python
support = noclick.Agent.from_name("support")
for entry in support.memory.list():
    print(entry.name, entry.description, entry.updated_by)
```

### AgentMemory.search

```python
agent.memory.search(query, *, limit=None, user=...) -> list[MemoryEntry]
```

Search what the agent remembers in a scope, the way the agent does: a
user's entries and the account's. An entry matches when its name,
description or content holds any of the query's words (a word also
finds the longer words it starts: `refund` finds `refunds`), or its
name or description holds the query; the more words, the better.

Parameters:

- `query` (`str`, required)
- `limit` (`int | None`, default `None`): Return at most this many.
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `list[MemoryEntry]` The best matches first (10 unless `limit` says otherwise, at most 100), each with its `content`
and `user_id` (`None` for the account's entries).

Usage:

```python
support = noclick.Agent.from_name("support")
for entry in support.memory.search("refund policy", user="user_42"):
    print(entry.name, entry.content)
```

### AgentMemory.read

```python
agent.memory.read(name, *, user=...) -> MemoryEntry
```

One entry in full; a name with no entry raises `noclick.NotFound`.

Parameters:

- `name` (`str`, required)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `MemoryEntry` The entry with its `content` and the `version` to pass back when you change it.

Usage:

```python
support = noclick.Agent.from_name("support")
refunds = support.memory.read("refunds")
print(refunds.version, refunds.content)
```

### AgentMemory.save

```python
agent.memory.save(
    name, content, *, description=None, version=None, user=...
) -> MemoryEntry
```

Write an entry, creating it if the name is new. `description` is the
line the agent sees every turn (required for a new entry, kept when you
leave it out). With `version`, the save only lands if the entry is
still at that version, else `noclick.Conflict`; without it, it replaces
whatever is there.

Parameters:

- `name` (`str`, required)
- `content` (`str`, required)
- `description` (`str | None`, default `None`)
- `version` (`int | None`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `MemoryEntry` The entry as saved, with its new `version`.

Usage:

Seed what every conversation should know:

```python
support = noclick.Agent.from_name("support")
support.memory.save(
    "refunds", "Refund within 30 days of purchase, to the original card.",
    description="Our refund rules",
)
```

Correct an entry without losing an edit the agent made meanwhile:

```python
support = noclick.Agent.from_name("support")
entry = support.memory.read("refunds")
try:
    support.memory.save("refunds", entry.content + "\nNo refunds on gift cards.", version=entry.version)
except noclick.Conflict:
    print("The agent changed it since; read it again.")
```

### AgentMemory.delete

```python
agent.memory.delete(name, *, version=None, user=...) -> None
```

Forget an entry. With `version`, only if it is still at that version
(else `noclick.Conflict`). The agent can save the name again later.

Parameters:

- `name` (`str`, required)
- `version` (`int | None`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Usage:

```python
support = noclick.Agent.from_name("support")
entry = support.memory.read("old-pricing")
support.memory.delete("old-pricing", version=entry.version)
```

### AgentMemory.versions

```python
agent.memory.versions(name, *, user=...) -> list[MemoryEntryVersion]
```

An entry's versions, newest first: the one it holds now, then those kept from earlier saves (its last
50 in all). A name with no entry raises `noclick.NotFound`.

Parameters:

- `name` (`str`, required)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `list[MemoryEntryVersion]` Each version's number, description, who wrote it and when, without its `content`.

Usage:

```python
support = noclick.Agent.from_name("support")
for v in support.memory.versions("refunds"):
    print(v.version, v.current, v.written_by.type, v.saved_at)
```

### AgentMemory.get_version

```python
agent.memory.get_version(name, version, *, user=...) -> MemoryEntryVersion
```

One version of an entry, with its content; one it no longer keeps raises `noclick.NotFound`.

Parameters:

- `name` (`str`, required)
- `version` (`int`, required)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `MemoryEntryVersion` That version in full.

Usage:

```python
first = noclick.Agent.from_name("support").memory.get_version("refunds", 1)
print(first.content)
```

### AgentMemory.restore

```python
agent.memory.restore(name, version, *, user=...) -> MemoryEntry
```

Put an entry back as it was at `version`: a new version holding that one's content and description,
so the one it replaces is kept too.

Parameters:

- `name` (`str`, required)
- `version` (`int`, required)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `MemoryEntry` The entry as restored, at its new `version`.

Usage:

```python
support = noclick.Agent.from_name("support")
support.memory.restore("refunds", 1)
```

### AgentMemory.entries

```python
agent.memory.entries(*, user=...) -> list[MemoryEntry]
```

`list`, as `noclick.Memory` calls it, so code reads any memory the same way.

Parameters:

- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `list[MemoryEntry]` Each entry's name, description and version, by name, without its `content`.

Usage:

```python
for memory in (noclick.Agent.from_name("support").memory, noclick.Memory.from_name("company")):
    print([entry.name for entry in memory.entries()])
```

### AgentMemory.forget

```python
agent.memory.forget(name, *, version=None, user=...) -> None
```

`delete`, as `noclick.Memory` calls it, so code changes any memory the same way.

Parameters:

- `name` (`str`, required)
- `version` (`int | None`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Usage:

```python
support = noclick.Agent.from_name("support")
support.memory.forget("old-pricing")
```

## noclick.MemoryEntry

```python
class MemoryEntry
```

One named note in an agent's memory. `version` goes up with every
save; pass the one you read back to `save` or `delete` so you never
overwrite a change the agent made since. `content` is `None` in a
listing (`read` loads it). `updated_by` is `agent`, `api` or
`console`.

`conversation` is set on a conversation's checkpoint: a long
conversation keeps its older history folded into one entry, named
`context.` and a hash, which its turns read in place of that history.
Read it to see what the agent carries forward; an edit wins over the next
summary, and deleting it forgets that history for good. The agent never
sees it outside that conversation.

| Attribute | Type | Description |
| --- | --- | --- |
| `name` | `str` |  |
| `description` | `str` |  |
| `content` | `str | None` |  |
| `version` | `int` |  |
| `updated_at` | `Any` |  |
| `updated_by` | `str | None` |  |
| `written_by` | `MemoryWriter` |  |
| `user_id` | `str | None` |  |
| `conversation` | `str | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.MemoryEntryVersion

```python
class MemoryEntryVersion
```

One version of a memory entry, as it was saved. Every save keeps the
version it replaces, so an entry keeps its last 50 versions, the one it
holds now (`current`) included; a conversation's checkpoint keeps none.
`content` is `None` in a listing (`get_version` loads it), and
`saved_at` is when that version was saved.

| Attribute | Type | Description |
| --- | --- | --- |
| `name` | `str` |  |
| `version` | `int` |  |
| `current` | `bool` |  |
| `description` | `str` |  |
| `content` | `str | None` |  |
| `written_by` | `MemoryWriter` |  |
| `user_id` | `str | None` |  |
| `saved_at` | `Any` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.MemoryWriter

```python
class MemoryWriter
```

Who last wrote a memory entry: an agent's turn (`type` `agent`: which agent, and in which of its
conversations), a person in the app (`console`) or a key (`api`).

| Attribute | Type | Description |
| --- | --- | --- |
| `type` | `str | None` |  |
| `agent_id` | `str | None` |  |
| `agent_name` | `str | None` |  |
| `conversation` | `str | None` |  |

## noclick.AgentWorkspace

```python
class AgentWorkspace
```

The files an agent works on: what it writes with its shell or its tools,
and what you put there for it. An agent has one `/workspace`, which every
turn sees whoever it answers, and a clear or a resume leaves as it is; an
account agent's user has their own. (A `noclick.Workspace` is something
else: a home for channels and their members.)

| Attribute | Type | Description |
| --- | --- | --- |
| `conversation` | `str | None` | The conversation it was named by, if any: accepted and ignored, since an agent has one workspace. |

### AgentWorkspace.files

```python
workspace.files() -> list[WorkspaceFile]
```

Every file in the workspace.

Returns: `list[WorkspaceFile]` Each file's `path` (relative to `/workspace`), size, when it last changed and a download `url`.
An empty list for a conversation whose agent hasn't written anything.

Usage:

```python
support = noclick.Agent.from_name("support")
for file in support.workspace().files():
    print(file.path, file.size_bytes, file.url)
```

### AgentWorkspace.read

```python
workspace.read(path) -> bytes
```

Read one file; a missing file raises `noclick.NotFound`.

Parameters:

- `path` (`str`, required)

Returns: `bytes` The file's bytes, exactly as stored; decode text yourself.

Usage:

```python
analyst = noclick.Agent.from_name("analyst")
report = analyst.workspace().read("report.csv")
print(report.decode()[:200])
```

### AgentWorkspace.write

```python
workspace.write(path, data) -> WorkspaceFile
```

Put a file in the workspace (bytes, or text as UTF-8), replacing one at
that path, so the agent finds it on its next turn. At most 100 MB. A
coding harness's sandbox stays up between turns and sees the file once it
starts again (it stops a few minutes after its last turn), so write there
before the conversation's first turn or between its sessions.

Parameters:

- `path` (`str`, required)
- `data` (`bytes | str`, required)

Returns: `WorkspaceFile` The file as stored, with its download `url`.

Usage:

```python
analyst = noclick.Agent.from_name("analyst")
workspace = analyst.workspace()
workspace.write("sales.csv", "region,total\nnorth,1200\nsouth,950\n")
reply = analyst.message("Chart sales.csv by region.", conversation="q3-review")
```

### AgentWorkspace.delete

```python
workspace.delete(path) -> None
```

Delete one file from the workspace; a missing file does nothing.

Parameters:

- `path` (`str`, required)

Usage:

```python
analyst = noclick.Agent.from_name("analyst")
analyst.workspace().delete("draft.csv")
```

### AgentWorkspace.url

```python
workspace.url(path, *, expires_in_s=None) -> str
```

A link that downloads one file without a key, for your user to click.

Parameters:

- `path` (`str`, required)
- `expires_in_s` (`int | None`, default `None`)

Returns: `str` The link; it works for `expires_in_s` seconds (an hour by default, a day at most).

Usage:

```python
analyst = noclick.Agent.from_name("analyst")
link = analyst.workspace().url("chart.png", expires_in_s=600)
print(link)
```

## noclick.WorkspaceFile

```python
class WorkspaceFile
```

A file in an agent's workspace for one conversation (`AgentWorkspace`).
`url` downloads it without a key for about an hour.

| Attribute | Type | Description |
| --- | --- | --- |
| `path` | `str` |  |
| `size_bytes` | `int` |  |
| `modified_at` | `Any` |  |
| `url` | `str | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.ShareLink

```python
class ShareLink
```

An agent's public chat page. Anyone with `url` can talk to the agent,
no sign-in: each visitor in conversations of their own, billed to you. Your
brand dresses the page. `created_at` is when it was first shared.

| Attribute | Type | Description |
| --- | --- | --- |
| `url` | `str` |  |
| `enabled` | `bool` |  |
| `agent_id` | `str` |  |
| `created_at` | `Any` |  |
| `rotated_at` | `Any` | When the URL last changed (None if it never has). |

### ShareLink.disable

```python
link.disable() -> ShareLink
```

Turn the page off: visitors see that the agent isn't available.
`agent.share()` turns it back on at the same URL.

Returns: `ShareLink` This link, with `enabled` false.

Usage:

```python
support = noclick.Agent.from_name("support")
support.share().disable()
```

### ShareLink.rotate

```python
link.rotate() -> ShareLink
```

Give the page a new URL; the old one stops at once.

Returns: `ShareLink` This link, with its new `url`.

Usage:

```python
support = noclick.Agent.from_name("support")
link = support.share().rotate()
print(link.url)
```

## noclick.AgentSandbox

```python
class AgentSandbox
```

The machine an agent works on (`agent.sandbox()`), one whoever it answers: what it is and costs, its files,
and your own commands on it, beside the agent's work. While its sandbox runs, its files are read there with
every secret it holds taken out; while it's stopped, from what its workspace kept. Files and commands need the
account's secret key with the `agents:terminal` scope (they reach what the sandbox holds).

| Attribute | Type | Description |
| --- | --- | --- |
| `conversation` | `str | None` | The conversation it was named by; none reads it through the agent's session. |

### AgentSandbox.get

```python
agent_sandbox.get() -> ConversationSandbox
```

Where it runs, whether it's running and since when, what it reserved and costs.

Returns: `ConversationSandbox` A `ConversationSandbox`.

Usage:

```python
coder = noclick.Agent.from_name("coder")
machine = coder.sandbox().get()
print(machine.status, machine.cpu, machine.memory_mb, machine.spent_usd_today)
```

### AgentSandbox.files

```python
agent_sandbox.files(
    path='/workspace', *, recursive=False, limit=None
) -> list[VolumeEntry]
```

What's in the folder at `path` (absolute; its workspace by default), a folder before what's in it, or with
`recursive=True` everything below it (git's objects left out unless listed by their path). A path that
doesn't exist raises `noclick.NotFound`.

Parameters:

- `path` (`str`, default `'/workspace'`)
- `recursive` (`bool`, default `False`)
- `limit` (`int | None`, default `None`): Return at most this many.

Returns: `list[VolumeEntry]` Every entry (or the first `limit`), fetched page by page.

Usage:

```python
coder = noclick.Agent.from_name("coder")
for entry in coder.sandbox().files("/workspace/src"):
    print(entry.path, entry.type, entry.size)
```

### AgentSandbox.files_page

```python
agent_sandbox.files_page(
    path='/workspace', *, recursive=False, cursor=None, limit=None
) -> SandboxFilesPage
```

One page of `files`, and where it was read; pass `next_cursor` back as `cursor`.

Parameters:

- `path` (`str`, default `'/workspace'`)
- `recursive` (`bool`, default `False`)
- `cursor` (`str | None`, default `None`): The `next_cursor` of the page before; omit it for the first page.
- `limit` (`int | None`, default `None`): Return at most this many.

Returns: `SandboxFilesPage` A `SandboxFilesPage`.

Usage:

```python
coder = noclick.Agent.from_name("coder")
page = coder.sandbox().files_page(limit=100)
print(page.source, [entry.path for entry in page.data])
```

### AgentSandbox.read

```python
agent_sandbox.read(path) -> bytes
```

One file's bytes (up to 16 MB), every secret the sandbox holds taken out; a missing file raises
`noclick.NotFound`.

Parameters:

- `path` (`str`, required)

Returns: `bytes` The file's bytes; decode text yourself.

Usage:

```python
coder = noclick.Agent.from_name("coder")
print(coder.sandbox().read("/workspace/README.md").decode())
```

### AgentSandbox.exec

```python
agent_sandbox.exec(command, *, timeout_s=None) -> ExecResult
```

Run a bash command in its running sandbox, in the agent's working directory, beside its work: the agent
isn't stopped, and the sandbox stays up while the command runs. A stopped conversation raises
`noclick.Conflict` (its next turn starts its sandbox).

Args:
command: Run with bash.
timeout_s: Seconds before it's stopped: 60 by default, at most 90.

Parameters:

- `command` (`str`, required)
- `timeout_s` (`int | None`, default `None`)

Returns: `ExecResult` Its `stdout`, `stderr` (the last 64 KiB of each) and `exit_code`.

Usage:

```python
coder = noclick.Agent.from_name("coder")
print(coder.sandbox().exec("git status --short").stdout)
```

### AgentSandbox.shell

```python
agent_sandbox.shell() -> SandboxShell
```

Your own shell (`bash -l`) on its running sandbox, in the agent's working directory, beside its work:
the agent isn't stopped, and the sandbox stays up while you type. A stopped conversation raises
`noclick.Conflict` (its next turn starts its sandbox).

Returns: `SandboxShell` A `SandboxShell` whose `url` and single-use `token` your user's browser opens within two minutes.

Usage:

```python
coder = noclick.Agent.from_name("coder")
shell = coder.sandbox().shell()
send_to_browser(shell.url, shell.token)
```

## noclick.ConversationSandbox

```python
class ConversationSandbox
```

The machine a conversation's agent works on, as it stands (`AgentSandbox.get`).

`place` is `sandbox` (one of the conversation's own), `machine` or `live` (an app's live container);
`status` is `running` or `stopped`, since `started_at`. A coding agent's sandbox starts with a turn and
stops a minute after its last; an `sdk` agent's shell lives only during a turn, so it reads `stopped`. `cpu`
and `memory_mb` are what it reserved (`None` while stopped), `usd_per_hour` what an hour of it costs,
`spent_usd_today` what its sandbox charged since midnight UTC (`None` where the conversation has no sandbox of
its own), and `workspace` the folder kept between its runs.

| Attribute | Type | Description |
| --- | --- | --- |
| `agent_id` | `str` |  |
| `conversation` | `str` |  |
| `harness` | `str` |  |
| `place` | `str` |  |
| `status` | `str` |  |
| `started_at` | `Any` |  |
| `cpu` | `float | None` |  |
| `memory_mb` | `int | None` |  |
| `region` | `str | None` |  |
| `usd_per_hour` | `float | None` |  |
| `spent_usd_today` | `float | None` |  |
| `machine_id` | `str | None` |  |
| `project_id` | `str | None` |  |
| `workspace` | `str | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.SandboxFilesPage

```python
class SandboxFilesPage(Page)
```

One page of a sandbox's folder (`AgentSandbox.files_page`): `data` holds `VolumeEntry`s, `next_cursor`
is `None` on the last page, and `source` says where it was read: the running `sandbox`, or what its
`workspace` kept.

| Attribute | Type | Description |
| --- | --- | --- |
| `source` | `str` |  |

## noclick.SandboxShell

```python
class SandboxShell
```

A shell on a conversation's sandbox (`AgentSandbox.shell`): hand `url` and the single-use `token` to your
user's browser, which opens it within two minutes as a take-over's terminal is opened (the websocket's first
message is `{"type": "auth", "token": ..., "cols": ..., "rows": ...}`; the TypeScript SDK's
`SandboxShell.connect`). It closes as bash exits, after `idle_limit_s` with nothing typed, or when the
websocket closes. A browser that says it renews (`"renew": true` in its first message) is asked to every 15
minutes (`{"type": "renew"}`) and answers `{"type": "renew", "token": ...}` with a new shell's token, and bash
goes on.

| Attribute | Type | Description |
| --- | --- | --- |
| `agent_id` | `str` |  |
| `conversation` | `str` |  |
| `url` | `str` |  |
| `token` | `str` |  |
| `token_expires_at` | `Any` |  |
| `idle_limit_s` | `int | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.CodingAgents

```python
class CodingAgents
```

Every coding agent (`Agent.coding()`): `agents`, then `counts` by harness, model, state and place,
`by_state`, `paused_by_reason`, and `unread`: what couldn't be read (an app's container, the sandbox
registry), whose runs are unknown, never shown down.

| Attribute | Type | Description |
| --- | --- | --- |
| `agents` | `list[CodingAgent]` |  |
| `counts` | `list[CodingCount]` |  |
| `by_state` | `dict[str, int]` |  |
| `paused_by_reason` | `dict[str, int]` |  |
| `read_at` | `Any` |  |
| `unread` | `list[str]` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.CodingAgent

```python
class CodingAgent
```

One coding agent, as `Agent.coding()` reads it: its `state`, its `place`, whose model credential it
thinks with, its current `job` and the conversations up now (`runs`).

| Attribute | Type | Description |
| --- | --- | --- |
| `agent_id` | `str` |  |
| `name` | `str` |  |
| `user_id` | `str | None` |  |
| `app` | `CodingApp | None` |  |
| `harness` | `str` |  |
| `model` | `str | None` |  |
| `credential` | `CodingCredential` |  |
| `place` | `str` |  |
| `state` | `str` |  |
| `paused` | `CodingPause | None` |  |
| `pauses` | `list[CodingPause]` |  |
| `job` | `CodingJob | None` |  |
| `runs` | `list[CodingRun]` |  |
| `spent_usd_this_month` | `float` |  |
| `model_usage_this_month` | `ModelUsage` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.CodingApp

```python
class CodingApp
```

The app a coding agent codes: `name` (what code finds it by), `title` (as a person reads it), and
`coder` for the app's own coding agent.

| Attribute | Type | Description |
| --- | --- | --- |
| `project_id` | `str` |  |
| `name` | `str | None` |  |
| `title` | `str | None` |  |
| `coder` | `bool` |  |

## noclick.CodingCount

```python
class CodingCount
```

How many coding agents run on one harness and model, in one state and place.

| Attribute | Type | Description |
| --- | --- | --- |
| `harness` | `str` |  |
| `model` | `str | None` |  |
| `state` | `str` |  |
| `place` | `str` |  |
| `count` | `int` |  |

## noclick.CodingCredential

```python
class CodingCredential
```

Whose model credential a coding agent thinks with: `kind` is `key`, a person's `plan`, NoClick's own
(`noclick`), or `pending` until it's connected.

| Attribute | Type | Description |
| --- | --- | --- |
| `kind` | `str` |  |
| `connection` | `str | None` |  |
| `credential_type` | `str | None` |  |
| `connected` | `bool | None` |  |

## noclick.CodingJob

```python
class CodingJob
```

A coding agent's turn in flight (or a `lost` one): `title` as whoever handed it over named it, `text` the
start of what it was asked, `workstream` the one it belongs to as it reads now (`{"id", "name"}`; `None`
where none was named).

| Attribute | Type | Description |
| --- | --- | --- |
| `operation_id` | `str` |  |
| `conversation` | `str | None` |  |
| `status` | `str` |  |
| `step` | `str | None` |  |
| `since` | `Any` |  |
| `title` | `str | None` |  |
| `text` | `str` |  |
| `lost` | `bool` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |
| `workstream` | `dict[str, str] | None` |  |

## noclick.CodingPause

```python
class CodingPause
```

Why a coding agent isn't doing anything: `reason` (`expired`, `disconnected`, `spending_paused`,
`spend_cap`, `out_of_funds`, `budget`, `failed_start`, `paused`) and its `message`.

| Attribute | Type | Description |
| --- | --- | --- |
| `reason` | `str` |  |
| `message` | `str` |  |

## noclick.CodingRun

```python
class CodingRun
```

A coding agent's conversation with a place up now; a sandbox's `cpu` and `memory_mb` are what it
reserved, an app's live container's `daemon` whether its harness runs there now.

| Attribute | Type | Description |
| --- | --- | --- |
| `conversation` | `str | None` |  |
| `place` | `str` |  |
| `since` | `Any` |  |
| `busy` | `bool` |  |
| `project_id` | `str | None` |  |
| `daemon` | `bool | None` |  |
| `cpu` | `float | None` |  |
| `memory_mb` | `int | None` |  |

## noclick.AgentEvent

```python
class AgentEvent
```

One moment of a streamed turn or a watched conversation. `type` is `text`
(`text` is the next piece of the reply), `tool_call` (`tool`, its wire
name like `gmail__send_email_message`, and its `arguments`; `held` when
policy holds it for a person), `tool_result` (`tool`, its `result`: the
start of what it returned, up to 500 characters, or its error; and whether it
`is_error`), `file` (a `file` the message carried, `role` `user`, or
the turn made, `assistant`), `reasoning` (`text` is one short line of
what the model is thinking, the title of a section of its reasoning, sent as
it completes), `status` (`compacting` while a long conversation's older
history is summarized, then `compacted`), `approval` (its `"noclick"` tools held a
purchase or a deletion for the account's owner: the `approval`), `operation`
(they started a long action: the `operation`, which comes again with its
`progress` each time the work reports some and once more when it ends) or
`done` (`reply` is the
whole `AgentReply`, as `message` returns it). `agent.watch()` also yields
`message` (a whole message: its `role`, `text`, `files`, `via` or `trigger` and, a reply, its
`tool_calls` and `reasoning`; a `note`, its `data`),
`status` (the conversation's new `status`) and `turn_end` once a turn of the conversation ends, however
it started and whether or not it saved a reply (its `status`: `succeeded`, `failed`, `canceled` or
`expired`; `text`, its reply's words, empty when it said nothing). `operation_id` names the turn
an event belongs to (`None` for a message no turn sent, like a person's
reply). `history()` reads messages in the same shape. The type `call` is
reserved for a phone call's moments. A coding harness's turn (Codex, Claude Code and
the like) also tells what its commands print as they run, `output` (`text`, its
command's `call_id`, and `whole` when it replaces what came before of that command),
and each file it changes, `diff` (`path`, `change` and the `diff`). Its own steps'
`tool_call` and `tool_result` say `source` `harness`, name their `call_id` and say
what kind of step it is (`step_kind`), a `tool_call` what it's about (`command`, `path`
or `query`), a command's result its `exit_code` and `duration_ms`: the fields a finished
turn's `AgentStep` keeps. A `status` of `events_dropped` says `count` moments its
sandbox couldn't send. On a machine, a turn waiting for its harness's image says
`downloading` while it downloads (`text`, like "Downloading OpenCode for this machine:
450 MB of 1.31 GB", with `downloaded_bytes` and `total_bytes` in `raw`), then
`downloaded`.

| Attribute | Type | Description |
| --- | --- | --- |
| `type` | `str` |  |
| `text` | `str | None` |  |
| `tool` | `str | None` |  |
| `arguments` | `dict[str, Any] | None` |  |
| `result` | `Any` |  |
| `is_error` | `bool` |  |
| `reply` | `AgentReply | None` |  |
| `role` | `str | None` | A `message`'s sender: `user`, `assistant`, `person` (someone it was handed off to) or `note` (a line added with `agent.note`). |
| `held` | `dict[str, Any] | None` | A held `tool_call`: who `approver` is and, when the request is addressed to the scope you read as, the approval's `request_id` and its page `url`. |
| `status` | `str | None` | A `status` event's: the conversation's new status (`active`, `awaiting_human` or `handed_off`), or a turn's own (`compacting`, then `compacted`; on a machine, `downloading`, then `downloaded`). A `turn_end`'s: how the turn ended (`succeeded`, `failed`, `canceled` or `expired`). |
| `operation_id` | `str | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |
| `file` | `Attachment | None` | A `file` event's file. |
| `files` | `list[Attachment]` | A `message` event's files. |
| `tool_calls` | `list[dict[str, Any]]` | A `message` event's tool calls (a reply's): each `{tool, arguments, result, is_error}`, as its turn's `tool_call` and `tool_result` events showed it. |
| `approval` | `dict[str, Any] | None` | An `approval` event's: its `id`, `summary`, exact `price` (a purchase), `expires_at` and `sent_to`, the apps NoClick sent the account's owner its link on (never the link). |
| `operation` | `dict[str, Any] | None` | An `operation` event's: the long action's `id` (an `Operation`'s), `kind`, `status` and `summary` and, once the work reported some, its `progress` (`Operation.progress`, with its last 3 `lines`). |
| `via` | `str | None` | A `user` message's way in, when not the API: `whatsapp`, `imessage`, `call` or `email`. |
| `data` | `dict[str, Any] | None` | A `note` message's data. |
| `trigger` | `dict[str, Any] | None` | A `user` message no person sent: what started its turn (`Message.trigger`). |
| `reasoning` | `list[dict[str, Any]]` | A `message` event's reasoning (a reply's): each `{text, created_at}` (`Message.reasoning`). |
| `call_id` | `str | None` | A coding harness's step: the `tool_call`, the `output` of its command, its `tool_result` and the `diff` of each file it changed share it. |
| `source` | `str | None` | `harness` for a step a coding harness took itself (its own shell, its edits), not a tool NoClick gave it. |
| `exit_code` | `int | None` | A harness command's `tool_result`: its exit code (`None` when it never exited) and how long it ran. |
| `duration_ms` | `int | None` |  |
| `whole` | `bool` | An `output` that replaces what streamed of its command so far, rather than continuing it. |
| `path` | `str | None` | A `diff`'s file (or the file, a page's URL, a harness step's `tool_call` edits or reads), what happened to it (`add`, `update` or `delete`) and the change: a unified diff, or a new file's whole content. |
| `change` | `str | None` |  |
| `diff` | `str | None` |  |
| `count` | `int | None` | A `status` `events_dropped`'s: how many moments its sandbox couldn't send. |
| `step_kind` | `str | None` | A harness step's `tool_call` and `tool_result`: `command`, `edit`, `read`, `search` or `tool` (`AgentStep.kind`). |
| `request` | `dict[str, Any] | None` | A `request` event's: what a coding harness asks a person (an approval or a question), as it waits and as it ends, the shape `Agent.requests` lists (answer it with `Agent.answer`). |
| `command` | `str | None` | A harness command's `tool_call`: the command it runs; a harness search's: what it looks for. |
| `query` | `str | None` |  |
| `message_id` | `str | None` | A `message`'s id in its thread (`Message.id`). |
| `author` | `dict[str, Any] | None` | Who sent a `user` `message` (`Message.author`). |
| `notification` | `bool` | A `message` an agent sent its owner from another of its conversations (`Message.notification`). |
| `space` | `dict[str, Any] | None` | A notification's space, when it passes on a space's news (`Message.space`). |
| `subagent` | `dict[str, str] | None` | The coding harness's subagent a `user` `message` was written for (`Message.subagent`). |
| `chat` | `str | None` | The chat a `message` of the agent's session came from, where it isn't the session's own (`Message.chat`). |
| `category` | `str | None` | A coding harness's step in words, as NoClick judged it (`tool_call` running, `tool_result` done; see `AgentStep`): its `category`, `label`, the command as shown, the fold it's in (`group`), a test run's `tests` and a count it reported (`progress`) as its `output` streams, how many lines it printed so far (`output_lines`), an edit's `diff_stat` and whether it `failed`. |
| `label` | `StepLabel | None` |  |
| `display_command` | `str | None` |  |
| `group` | `str | None` |  |
| `tests` | `StepTests | None` |  |
| `progress` | `StepProgress | None` |  |
| `output_lines` | `int | None` |  |
| `diff_stat` | `DiffStat | None` |  |
| `failed` | `bool | None` |  |
| `step_group` | `StepGroup | None` | A `group` moment: a fold of the turn's reads and searches that changed, as it stands now (`StepGroup`). |
| `summary` | `TurnSummary | None` | A `turn_end`'s turn did as a coding harness ran it (`TurnSummary`). |

## noclick.Rehearsal

```python
class Rehearsal
```

A test run: a real turn of the agent (its model, instructions and tools)
where a simulated world answers every tool call, so nothing is sent and no
account is touched. `tool_calls` are the calls it made, each with the
`tool` (its tool name, like `gmail__search_emails`), its `arguments`
and the `result` the world answered (`None` if the world couldn't);
`transcript` is the turn step by step: `role` `assistant` steps (its
`text` between calls, then the reply) and `tool` steps. On a coding
harness, its own shell and file steps are `tool` steps with `source`
`harness`: they ran for real, in the run's own sandbox. `cost_usd` is
what the run cost you.

| Attribute | Type | Description |
| --- | --- | --- |
| `reply` | `str` |  |
| `tool_calls` | `list[dict[str, Any]]` |  |
| `transcript` | `list[dict[str, Any]]` |  |
| `scenario` | `str | None` |  |
| `cost_usd` | `float | None` |  |
| `operation_id` | `str | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.Wakeup

```python
class Wakeup
```

A turn an agent will take later, in one of its conversations: at a time, when an
operation settles, on a NoClick event, or at each time of a schedule (`agent.wake`,
or its own `wake_me` tool). At its moment the conversation takes a turn whose
message is the `note`, followed by what woke it.
A turn already running in that conversation goes first: the wake-up waits behind
it, one turn at a time. It survives restarts, starts its turn once, and is billed
and capped like any turn. A recurring one (`every`) stays `pending` after each
turn, due at its schedule's next time; times it missed fold into one turn. NoClick
sets its own too: for a child's update, the link the agent asked its user to connect
an account with being done, and a decided approval of a held call. Your webhooks
hear each one delivered or failed (`agent.wakeup.delivered`, `agent.wakeup.failed`),
and each time a recurring one missed because your account couldn't pay
(`agent.wakeup.missed`).

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |
| `agent_id` | `str` |  |
| `user_id` | `str | None` | Whose conversation it wakes (`None`: the account's). |
| `conversation` | `str` | The conversation that takes the turn. |
| `note` | `str` | What the agent is told when it wakes. |
| `at` | `Any` | When it's due (a time wake-up), or when what it waited for happened. |
| `when` | `dict[str, Any] | None` | What it waits for besides a time: `{operation_id}` or `{event, filters}` (`None` for a time). |
| `every` | `Cron | None` | Its schedule, for a recurring wake-up (`None` for one that comes once); `at` is its next time. |
| `fired` | `int` | How many turns it has started (a recurring one counts up). |
| `source` | `str` | What set it: `code` (`agent.wake`), `wake_me` (the agent's own tool), `update` (a job's update for this agent as its parent), `answer` (the link it asked its user to connect an account with is done: connected or expired), `approval` (a held call was decided), `notice` (news for the account's own assistant) or `continue` (a turn its step limit ended, carried on by itself: `turn_limits`). |
| `status` | `str` | `pending`, `delivered` (its turn started), `canceled` or `failed`; a recurring one stays `pending` until it's canceled. |
| `woken_by` | `dict[str, Any] | None` | What woke it: `{at}` for a time (once delivered), `{operation_id, kind, status, result}` (or `error`) once its operation settled, `{update}` for a job's update, and `{event}` (the event as `Event.list` reads it) for an event; `None` until then. |
| `operation_id` | `str | None` | The turn it started (an `agent.message` operation). |
| `depth` | `int` | How many `wake_me` wake-ups in a row led to this one, with nothing else in between (0 for any other). |
| `error` | `dict[str, Any] | None` | Why it failed: `{type, message}` (the account couldn't pay, say). |
| `missed` | `dict[str, Any] | None` | A recurring one's last missed time: `{at, reason}`, `reason` being `credits`, `spend_cap` (the account's monthly cap) or `budget` (the agent's, its key's or its user's); `None` if it never missed. |
| `created_at` | `Any` |  |
| `delivered_at` | `Any` | When its turn started (`None` until then). |
| `operation` | `Operation | None` | The turn it started, as an `Operation` (`None` until it's delivered). |

### Wakeup.cancel

```python
wakeup.cancel() -> Wakeup
```

Call it off before it's due. A wake-up that already started its turn, or was
canceled or failed, raises `noclick.Conflict`.

Returns: `Wakeup` This wake-up, `canceled`.

Usage:

```python
digest = noclick.Agent.from_name("digest")
for wakeup in digest.wakeups("weekly-report", status="pending"):
    wakeup.cancel()
```

### Wakeup.update

```python
wakeup.update(*, note=None, at=None, after=None, every=None) -> Wakeup
```

Change a pending wake-up: its `note`, and its time with one of `at`,
`after` and `every` (a `Cron`; a one-off time makes a recurring one come
once more). A delivery under way of what it said before starts no turn. One
waiting on an operation or an event keeps that; one already delivered,
canceled or failed raises `noclick.Conflict`.

Parameters:

- `note` (`str | None`, default `None`)
- `at` (`Any`, default `None`)
- `after` (`Any`, default `None`)
- `every` (`Any`, default `None`)

Returns: `Wakeup` This wake-up, as it is now.

Usage:

```python
digest = noclick.Agent.from_name("digest")
[weekly] = digest.wakeups("weekly-report", status="pending")
weekly.update(every=noclick.Cron("0 8 * * 1", tz="Europe/London"))
```

## noclick.Job

```python
class Job(Operation)
```

Work one agent gave another: a spawned child's task (kind `agent.task`), or a
message a coordinator sent with its `agents` tools (kind `agent.message`), whose
only update is `done`. It's an `Operation`: `wait()` returns the `AgentReply`.

A task runs while the child works on it, across as many turns as it takes, and
finishes when its conversation goes quiet with nothing left to continue it: no turn
running, no wake-up pending, nothing waiting on a person. While it runs, `step` is
`working` (a turn is running) or `waiting` (only a wake-up is pending); it's
`awaiting_human` (step `blocked`) while it waits on a person: a held call, or a
connection it asked its user for. It `succeeded` once the child stopped, its last reply the result (a child
that needs a decision says so and stops; the parent's `message` to it starts a new
job in the same conversation), `failed` when a turn failed, `canceled` when
canceled (its running turn stops and its pending wake-ups are called off), and
`expired` when the child's `ttl_s` ran out first.

| Attribute | Type | Description |
| --- | --- | --- |
| `started_by` | `str | None` | The agent whose job it is: a task's parent, whether your code spawned it or the parent did. |
| `conversation` | `str | None` | The conversation the worker does it in. |
| `parent_conversation` | `str | None` | The parent's conversation its updates wake (`None`: they wake nobody). |
| `required_updates` | `list[Any]` | The updates its parent required, as on the wire: `done`, `blocked`, `{before}`, `{every_s}`. |
| `latest_update` | `JobUpdate | None` | Its newest update (`None` before the first). |
| `agent` | `Agent` | The agent doing the work, lazy. |

### Job.list

```python
noclick.Job.list(*, limit=None, **filters) -> list[Job]
```

Spawned children's tasks across your agents (kind `agent.task`), newest first.
Takes `Operation.list`'s filters except `kind` (`agent=` keeps the ones one
agent does). `agent.jobs()` reads the ones one agent started, its message jobs
(kind `agent.message`) too.

Parameters:

- `limit` (`int | None`, default `None`): Return at most this many.
- `filters` (`Any`)

Returns: `list[Job]` Every matching job (or the first `limit`), each with its `status`, `step` and `latest_update`.

Usage:

```python
for job in noclick.Job.list(status="awaiting_human", user_filter=noclick.ALL_USERS):
    print(job.agent_id, job.started_by, job.latest_update)
```

### Job.list_page

```python
noclick.Job.list_page(*, cursor=None, limit=None, **filters) -> Page
```

One page of jobs; pass `next_cursor` back as `cursor`.

Parameters:

- `cursor` (`str | None`, default `None`): The `next_cursor` of the page before; omit it for the first page.
- `limit` (`int | None`, default `None`): Return at most this many.
- `filters` (`Any`)

Returns: `Page` A page whose `data` holds the jobs and whose `next_cursor` is `None` on the last page.

Usage:

```python
page = noclick.Job.list_page(status="failed", limit=50)
for job in page.data:
    print(job.agent_id, job.error)
```

### Job.summary

```python
noclick.Job.summary(**filters) -> OperationSummary
```

How many jobs match, by status; takes `Operation.summary`'s filters except `kind`.

Parameters:

- `filters` (`Any`)

Returns: `OperationSummary` The number that match in `total`, and per operation status in `by_status`.

Usage:

```python
counts = noclick.Job.summary(status="live")
print(counts.total, counts.by_status["awaiting_human"])
```

### Job.updates

```python
job.updates() -> list[JobUpdate]
```

Every update it has sent its parent, oldest first.

Returns: `list[JobUpdate]` Each `JobUpdate` with its `kind`, the child's `text` and, by kind, the call it was about to
make, what it waits on, or the result.

Usage:

```python
planner = noclick.Agent.from_name("planner")
for job in planner.jobs(kind="task"):
    for update in job.updates():
        print(update.created_at, update.kind, update.text)
```

## noclick.JobUpdate

```python
class JobUpdate
```

One update a job sent its parent. `kind` is `done` (the job finished, any
outcome: `result` or `error`), `blocked` (it started waiting on a person:
`waiting_on`), `before` (it's about to make the call in `tool` with
`arguments`), `every` (it was due one) or `message` (the child's own
`tell_parent`). `text` is what the child wrote (for `blocked`, NoClick's line
saying what it waits on); `status` is the job's status then, and `wakeup_id`
the parent's wake-up it set (`None` when nothing was there to wake).

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |
| `job_id` | `str` |  |
| `agent_id` | `str` |  |
| `kind` | `str` |  |
| `text` | `str | None` |  |
| `tool` | `str | None` |  |
| `arguments` | `dict[str, Any] | None` |  |
| `status` | `str | None` |  |
| `result` | `Any` |  |
| `error` | `dict[str, Any] | None` |  |
| `waiting_on` | `dict[str, Any] | None` | A `blocked` update's wait: `{kind, url, operation_id}`, `kind` being `connection` (a link it asked its user to connect an account with: `url`), `approval` (a held call; never a `url`, so no agent approves its child's call), `person` (a question it asked someone) or `sign_in` (a step its browser needs a person for). |
| `wakeup_id` | `str | None` |  |
| `created_at` | `Any` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.Before

```python
class Before
```

An update the parent requires before its child makes a tool call: `Before` with
tool patterns written as policy writes them (`"gmail.send_email_message"`,
`"stripe.*"`, `"code"`). When the child calls a matching tool, NoClick sends the
parent an update holding the call and what the child wrote before it (its reason),
then the call runs: the parent hears first but doesn't hold it (a call that must
wait for a yes is a policy `require_approval` rule). A coding harness's own
shell commands and file edits aren't tool calls NoClick sees, so `Before` can't
match them, and its words reach NoClick only when its turn ends, so the update
carries the call without a reason.

Usage:

```python
support = noclick.Agent.from_name("support")
refunder = support.spawn(
    "Refund order 1841 if it's within our 30 days, then email the customer.",
    tools=["stripe.create_refund", "gmail.send_email_message"],
    updates=[noclick.Before("stripe.create_refund")],
    conversation="ticket-1841",
)
```

| Attribute | Type | Description |
| --- | --- | --- |
| `tools` | `list[str]` | The tool patterns it covers. |
| `tools` |  |  |

### noclick.Before

```python
noclick.Before(*tools)
```

Parameters:

- `tools` (`str`)

## noclick.Every

```python
class Every
```

An update the parent requires at least this often while its child works:
`Every` with an interval in seconds (or a `timedelta`), 60 seconds or more.
When that long has passed since the child's last update, NoClick asks it for one
(a coding harness by steering its running turn, an `sdk` agent before its next
model call), and the `tell_parent` it answers with is the `every` update. A
child that's only waiting (for a wake-up, for a person) isn't asked.

Usage:

```python
planner = noclick.Agent.from_name("planner")
migrator = planner.spawn(
    "Move every customer from the old CRM to the new one, in batches of 200.",
    tools=["hubspot", "salesforce"],
    updates=[noclick.Every(1800)],
    conversation="crm-move",
)
```

| Attribute | Type | Description |
| --- | --- | --- |
| `interval_s` | `int` | How often, at most, the parent hears while the child works. |
| `interval_s` |  |  |

### noclick.Every

```python
noclick.Every(interval)
```

Parameters:

- `interval` (`int | float | timedelta`, required)

## noclick.Agents

```python
class Agents
```

The `agents` capability, for an agent's `tools`: the same as the string
`"agents"`, narrowed with `Agents.only(...)`. It gives a coordinator six tools,
within its own scope, in its own conversations (in a channel, agents work by
mentions instead): `spawn` (a child of its own, whose updates wake it in the
conversation it spawned from), `message` (any agent it can reach: a user's agent
reaches that user's and the account's, an account agent the account's; it waits up
to 50 seconds for the reply, and a reply that takes longer, or one it doesn't wait
for, is a job whose `done` update wakes it), `ask` (as `agent.ask`),
`status` (an agent's or a job's), `list` (as `Agent.list` filters) and
`cancel` (a job it started). Its work runs in the threads of the user it's acting
for, and its children get the capability only when it lists it for them. Policy
names them `agents.spawn` ... `agents.cancel` (`agents.*`); the model sees
`agents__spawn`, `agents__message` and so on, and its tools count toward an
agent's 64.

Usage:

```python
coordinator = noclick.Agent.from_name(
    "coordinator", create_if_missing=True,
    instructions="You run our launches. Spawn a researcher for each competitor, then write the plan.",
    tools=["search", noclick.Agents()],
)
```

| Attribute | Type | Description |
| --- | --- | --- |
| `tools` | `list[str]` | The capability's tools this gives. |
| `tools` |  |  |

### noclick.Agents

```python
noclick.Agents()
```

### Agents.only

```python
noclick.Agents.only(*tools) -> Agents
```

Some of the capability's tools: `spawn`, `message`, `ask`, `status`,
`list` and `cancel`.

Parameters:

- `tools` (`str`)

Returns: `Agents` The capability narrowed to those tools, for `tools=` (on the wire, `"agents.spawn"`, ...).

Usage:

A supervisor that watches and asks but never starts work:

```python
supervisor = noclick.Agent.from_name(
    "supervisor", create_if_missing=True,
    instructions="You check on our agents every morning and report anything stuck.",
    tools=[noclick.Agents.only("list", "status", "ask")],
)
```

## noclick.Platform

```python
class Platform
```

NoClick itself, for an agent's `tools`: the same as the string `"noclick"`,
narrowed with `Platform.only(...)`. It gives the agent what a connected app
gets on NoClick's MCP server: `search` and `fetch` (NoClick's guides and your
account's objects), `api_describe` and `api_call` (any API operation), and
`quote`, `buy` and `delete`. They act as the turn's key and the user it acts
for, never more than that key may, judged by the same gate as any connected app:
a purchase or a deletion waits for the account's owner, who approves it on NoClick
with its exact price or what goes with it (the turn waits on them, and the call's
outcome is the conversation's next turn); a secret's value never comes from the
conversation; and a turn answering someone outside the agent's scope (an email, a
caller) asks a person before acting outside the account. A long action it starts
is an operation, which `wake_me` waits on. Policy names them `noclick.search`
... `noclick.delete`; the model sees `noclick__search` and so on, and they
count toward an agent's 64 tools. Watchers see an `approval` and an
`operation` event for them (`agent.stream`, `agent.watch`).

Usage:

```python
ops = noclick.Agent.from_name(
    "ops", create_if_missing=True, tools=[noclick.Platform()],
    instructions="You run our NoClick account: numbers, domains and agents.",
)
ops.message("Get us a phone number in the 415 area code.")  # buys once you approve
```

| Attribute | Type | Description |
| --- | --- | --- |
| `names` | `list[str]` | What it's narrowed to: capability groups and API areas (empty: all of NoClick). |
| `names` |  |  |

### noclick.Platform

```python
noclick.Platform()
```

### Platform.only

```python
noclick.Platform.only(*names) -> Platform
```

Part of NoClick: capability groups (`read`, `build`, `deploy`, `spend`,
`delete`) bound what kind of call it makes, and API areas (a key's scopes, like
`domains`, `phone` or `agents`) which part of the API it reaches; each
narrows only its own kind. Without `spend` it isn't offered `quote` and
`buy`, without `delete` not `delete`. `"admin"` adds the admin group, which nothing holds
unnamed (`"noclick"` alone never does): a few administrative calls and loosening what agents may do,
each off until your approval settings switch `admin` or `elevate`; it narrows nothing. Names are
checked when the agent is saved.

Parameters:

- `names` (`str`)

Returns: `Platform` NoClick narrowed to those names, for `tools=` (on the wire, `"noclick.read"`, ...).

Usage:

An agent that keeps your domains, and buys new ones once you approve:

```python
registrar = noclick.Agent.from_name(
    "registrar", create_if_missing=True,
    instructions="You look after our domains and their DNS.",
    tools=[noclick.Platform.only("domains")],
)
```

One that only reads, to answer questions about the account:

```python
analyst = noclick.Agent.from_name(
    "analyst", create_if_missing=True, instructions="You explain our usage and spend.",
    tools=[noclick.Platform.only("read")],
)
```

## noclick.Attachment

```python
class Attachment
```

A file on a message, kept as an account file at `url`. `kind` is
`image`, `audio`, `video` or `file`; a `voice` clip has its
`duration_ms` and its waveform's `peaks` (loudness from 0 to 1). Audio
is kept as transcription reads it (a browser's WebM recording as MP3). A
file an agent's conversation shows (in `history`, or a `file` event)
has its `name`, `url` and `mime_type`, and no `id`: it was sent. The
account's files (`noclick.attachments()`) have their `id`, to send again,
and when each was made (`created_at`) and last changed (`updated_at`).

| Attribute | Type | Description |
| --- | --- | --- |
| `name` | `str` |  |
| `url` | `str` |  |
| `mime_type` | `str` |  |
| `id` | `str | None` |  |
| `size_bytes` | `int | None` |  |
| `kind` | `str` |  |
| `voice` | `bool` |  |
| `duration_ms` | `int | None` |  |
| `peaks` | `list[float] | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |
| `created_at` | `datetime | None` |  |
| `updated_at` | `datetime | None` |  |

## noclick.Terminal

```python
class Terminal
```

A coding agent's conversation as its harness's own terminal: `state` is `agent` (the agent has it),
`taking_over` (its turn in flight finishes first), `person` (taken over) or `handing_back`. While it's
taken over the agent's messages wait; it hands itself back after `idle_limit_s` with nobody typing,
`detached_limit_s` with no terminal open, or at `ends_at` (its sandbox's time limit).

| Attribute | Type | Description |
| --- | --- | --- |
| `agent_id` | `str` |  |
| `conversation` | `str` |  |
| `harness` | `str` | `claude_code` or `codex`. |
| `state` | `str` | `agent`, `taking_over`, `person` or `handing_back`. |
| `waiting_for_turn` | `bool` | Taken over once the agent's turn in flight ends. |
| `since` | `Any` | When it was taken over. |
| `ends_at` | `Any` | When it hands itself back at the latest: its sandbox's limit. |
| `idle_limit_s` | `int | None` | It hands itself back after this long with nobody typing. |
| `detached_limit_s` | `int | None` | It hands itself back after this long with no terminal open. |
| `ended_because` | `str | None` | Why the last take-over ended: `handed_back`, `canceled`, `idle`, `detached`, `exited` (the terminal's program exited), `deadline` or `failed`. |
| `url` | `str | None` | The terminal's websocket (from `take_over` only). |
| `token` | `str | None` | Opens `url` once, within two minutes (from `take_over` only): its first message's `token`. |
| `token_expires_at` | `Any` |  |

### Terminal.hand_back

```python
terminal.hand_back() -> Terminal
```

Give the conversation back to the agent: the terminal closes, what was said in it joins the
conversation's history (`via: "terminal"`), and the messages that waited reach the agent.

Returns: `Terminal` This terminal, as it is now (`agent`, or `handing_back` while its program exits).

Usage:

```python
coder = noclick.Agent.from_name("coder")
coder.terminal("main").hand_back()
```

## noclick.attachments

```python
noclick.attachments(*, query=None, limit=30, client=None) -> list[Attachment]
```

The account's files, newest first: what its messages carried, the images
and videos it made, its calls' recordings, what its browsers downloaded and the
pages they stopped on. A message to an agent sends any of them again in its
`files`. The account's alone: read as a user, it's refused.

Args:
query: Keeps the files whose names contain it (any case).
limit: How many, 1 to 100.

Parameters:

- `query` (`str | None`, default `None`)
- `limit` (`int`, default `30`): Return at most this many.
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `list[Attachment]` Each file as an `Attachment` with its `id`, `name`, `url` (a link that reads it for an hour),
`mime_type` and `kind`.

Usage:

```python
[report] = noclick.attachments(query="q3")
analyst.message("What changed since this?", files=[report])
```

## noclick.attachments_page

```python
noclick.attachments_page(*, query=None, cursor=None, limit=None, client=None) -> Page
```

One page of the account's files, newest first; pass `next_cursor` back as `cursor`.

Parameters:

- `query` (`str | None`, default `None`)
- `cursor` (`str | None`, default `None`): The `next_cursor` of the page before; omit it for the first page.
- `limit` (`int | None`, default `None`): Return at most this many.
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `Page` A page whose `data` holds each `Attachment` and whose `next_cursor` is `None` on the last page.

Usage:

```python
page = noclick.attachments_page(limit=50)
while True:
    for file in page.data:
        print(file.name, file.size_bytes)
    if page.next_cursor is None:
        break
    page = noclick.attachments_page(limit=50, cursor=page.next_cursor)
```

## noclick.delete_attachment

```python
noclick.delete_attachment(attachment, *, client=None) -> None
```

Delete one of the account's files for good (an `Attachment` or its id):
its record and what it stored, with no trash to restore it from. A message
that carried it keeps its name, and its link stops working. The account's
own to do: acting for one of your users, or from an app's code, it's refused.

Parameters:

- `attachment` (`Any`, required)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Usage:

```python
for file in noclick.attachments(query="draft"):
    noclick.delete_attachment(file)
```
