Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ with Client.local(local_options={"binary_path": "/path/to/hai-agent-runtime"}) a
Inference stays hosted (`HAI_API_KEY`) unless you pass `inference=Inference.self_hosted(url, model=...)`
(`from hai_agents_local.runtime import Inference`).

One agent drives this machine's desktop at a time: a second process asking for a `desktop` or `workstation` bridge
fails fast instead of sharing the mouse. `hai local stop` stops every local turn on the machine; so does a double Esc
once `hai_agents_local.killswitch.arm_esc_listener()` is armed (macOS, Windows, and X11 Linux).

## How a session works

A session is one run of an agent against a task. It moves through a small set of states: `pending`, `running`, and then a settled state such as `completed`, `idle`, `failed`, `timed_out`, or `interrupted`.
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "hai-agents"
version = "1.2.1"
version = "1.2.2"
description = "Python SDK for H Company's Agents API: autonomous agents powered by Holo."
requires-python = ">=3.10"
readme = "README.md"
Expand Down Expand Up @@ -34,6 +34,7 @@ dependencies = [
[project.optional-dependencies]
cli = [
"python-dotenv>=1.2.3,<2",
"pyyaml>=6.0,<7",
Comment thread
abonneth marked this conversation as resolved.
"rich>=15.0.0,<16",
"typer>=0.27.2,<1",
]
Expand All @@ -45,6 +46,7 @@ browser = [
]
workstation = [
"hai-drivers[browser-cli,cua-cli,desktop-cli]>=0.1.10",
"pynput>=1.7.6; sys_platform == 'win32'",
]
all = [
"hai-agents[browser,cli,desktop,workstation]",
Expand Down
4 changes: 2 additions & 2 deletions src/hai_agents/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def get_headers(self) -> typing.Dict[str, str]:
import platform

headers: typing.Dict[str, str] = {
"User-Agent": "hai_agents/1.2.1",
"User-Agent": "hai_agents/1.2.2",
"X-HCompany-Client-Name": "hai_agents",
"X-HCompany-Client-Version": "1.2.1",
"X-HCompany-Client-Version": "1.2.2",
"X-HCompany-Client-Type": "sdk",
"X-HCompany-Language": "Python",
"X-HCompany-Runtime": f"python/{platform.python_version()}",
Expand Down
6 changes: 3 additions & 3 deletions src/hai_agents_cli/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,8 +604,8 @@ def mcp_install(


def _install_one(cid: str, c: mcp_hosts.Client, url: str, key: str) -> dict:
status, detail = mcp_hosts.wire_mcp(c, url, key)
skill = mcp_hosts.wire_skill(c) if c.skills_dir is not None else None
status, detail = mcp_hosts.wire_mcp(c, {mcp_hosts.URL: url, mcp_hosts.KEY: key}, secret=key)
skill = mcp_hosts.wire_skill(c, mcp_hosts.SERVER_NAME, mcp_hosts.bundled_skill()) if c.skills_dir else None
return {"client": cid, "status": status, "detail": detail, "skill": skill}


Expand Down Expand Up @@ -792,7 +792,7 @@ def _arm_kill_switch(bridge: Any) -> Any:
listener = arm_esc_listener()
if listener is not None:
console.print(f"[dim]{KILL_SWITCH_ARMED_HINT}[/dim]")
elif sys.platform == "darwin":
else:
# A panic button that silently failed to arm is dangerous; always say so.
console.print(f"[yellow]{KILL_SWITCH_UNAVAILABLE_HINT}[/yellow]")
return listener
Expand Down
13 changes: 11 additions & 2 deletions src/hai_agents_cli/doctor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""`hai doctor`: read-only diagnostics for login, platform access, and local control, with fix-its."""
"""`hai doctor`: read-only diagnostics for login, platform access, the local runtime, and local control."""

from __future__ import annotations

Expand Down Expand Up @@ -47,6 +47,15 @@ def check_platform(api_key: str | None, base_url: str | None) -> CheckResult:
return CheckResult("platform", True, f"authenticated against {endpoint}")


def check_runtime() -> CheckResult:
from hai_agents_local.runtime import locate_runtime

path = locate_runtime()
if path is None:
return CheckResult("runtime", True, "local runtime not installed yet; downloaded on the first local run")
return CheckResult("runtime", True, path)


def check_browser() -> CheckResult:
if importlib.util.find_spec("hai_drivers") is None or importlib.util.find_spec("hai_drivers.web") is None:
return CheckResult(
Expand Down Expand Up @@ -104,5 +113,5 @@ def run_checks(api_key: str | None, base_url: str | None) -> list[CheckResult]:
checks = [login]
if login.ok:
checks.append(check_platform(api_key, base_url))
checks.extend([check_browser(), check_desktop()])
checks.extend([check_runtime(), check_browser(), check_desktop()])
return checks
Loading
Loading