Metadata-Version: 2.4
Name: asiflow-hyper
Version: 1.1.0
Summary: Python client for the Hyper Agent API (OAuth 2.1, REST v1): drive sessions, invoke any capability, delegate objectives, run and verify work, read evidence.
Author: ASIFlow
License: MIT
Project-URL: Homepage, https://hyper.asiflow.ai
Project-URL: Documentation, https://hyper.asiflow.ai/docs/platform/agent-api
Project-URL: OpenAPI, https://api.hyper.asiflow.ai/openapi.json
Keywords: hyper,agent,ai software engineer,oauth,mcp
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.25

# asiflow-hyper

Python client for the [Hyper Agent API](https://hyper.asiflow.ai/docs/platform/agent-api): delegate a software objective to Hyper, run and verify the work, read the evidence. Thin and honest: every method is one documented REST call (`https://api.hyper.asiflow.ai/openapi.json`); errors are the API's RFC 9457 problems.

```python
from asiflow_hyper import HyperClient, device_login

token = device_login(client_name="my-agent", scope="objectives:read objectives:write runs:write evidence:read deploy:verify offline_access")
hyper = HyperClient(token=token.access_token)

job = hyper.create_objective(name="Bakery site", objective="A one-page site for Nour's bakery with a contact form.")
job = hyper.wait_job(job["id"])
run = hyper.start_run(job["result"]["project_id"], policy={"budget_cap_usd": 10})
run = hyper.wait_run(run["result"]["run_id"], on_needs_you=lambda card: "approved")
for attempt in run["attempts"]:
    if attempt["status"] == "verified":
        print(hyper.attempt_evidence(attempt["id"]))
```

## Drive a session (1.1.0)

The interactive loop — the same one the Hyper web app runs — and every other capability:

```python
s = hyper.sessions.create(repo="acme/site", permission_mode="auto_approve", budget_usd=10)
hyper.sessions.send(s["id"], "Add a pricing page, run the tests, open a pull request.")
view = hyper.sessions.wait_until_settled(s["id"])          # ready | waiting_input | …
if view["pending"] and view["pending"]["kind"] == "question":
    hyper.sessions.answer(s["id"], "blue")
    view = hyper.sessions.wait_until_settled(s["id"])
print(hyper.sessions.transcript(s["id"])["rows"][-1]["content"])
hyper.actions.invoke("publish_site", sessionId=s["id"])    # any of hyper.capabilities()["groups"]
hyper.sessions.end(s["id"])
```

Scopes `sessions:read sessions:write` (plus `workspace:*`, `publish:write` for the catalog). A person can hand you a token from **Settings → Agent access** on hyper.asiflow.ai, or your client registers itself and the person allows it on Hyper's consent page.

The `agent-interop-e2e` lane runs this client against production on every Hyper deploy.
