Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
288 lines (275 loc) · 13.4 KB
/
Copy pathpyproject.toml
File metadata and controls
288 lines (275 loc) · 13.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
[tool.async-hermes]
upstream_version = "0.20.4"
upstream_tag = "v2026.8.18"
async_revision = 1
[project]
name = "async-hermes-agent"
version = "0.20.4.1"
description = "A native-async AI agent harness for tools, MCP, skills, memory, and trajectory generation"
readme = "README.md"
# Upper bound is load-bearing, not cosmetic. uv resolves the project's
# Python from `requires-python`, and an inherited `UV_PYTHON` env var (or a
# fresh distro whose newest interpreter uv auto-picks) will otherwise select
# 3.14, where Rust-backed transitives (e.g. pydantic-core) have no cp314
# wheel yet and fall back to a maturin source build that fails. Capping at
# <3.14 makes uv refuse 3.14 with a clear error instead of attempting that
# build. Raise the ceiling once our Rust transitives ship cp314 wheels.
requires-python = ">=3.11,<3.14"
authors = [{ name = "Nous Research" }]
license = "MIT"
license-files = ["LICENSE"]
dependencies = [
# Core — every direct dep is exact-pinned to ==X.Y.Z (no ranges).
# Rationale: ranges allow PyPI to ship a fresh version of a transitive
# at any time without a code review on our side. Exact pins mean the
# only way a new package version reaches a user is via an intentional
# update on our end (bump the pin in this file, regenerate uv.lock).
# This was tightened on 2026-05-12 in response to the Mini Shai-Hulud
# worm hitting mistralai 2.4.6 on PyPI; if that release had been
# captured by `mistralai>=2.3.0,<3` rather than an exact pin, every
# install in the hours before the quarantine would have pulled it.
#
# When updating: bump the version below AND regenerate uv.lock with
# `uv lock` so the transitive resolution stays consistent. Don't
# introduce ranges back without a written justification.
#
# Scope rule: only packages used by EVERY hermes session belong here.
# Anything that's provider-specific (`anthropic`, `fal-client`,
# `edge-tts`, `parallel-web`) belongs in an
# extra and fails fast with an install hint when the user picks that
# backend. Smaller `dependencies` = smaller blast
# radius for the next supply-chain attack.
"openai==2.24.0",
"aiosqlite==0.22.1",
"aiofiles==24.1.0",
"python-dotenv==1.2.2",
"httpx[socks]==0.28.1",
# Imported directly by the retained TLS resolver. Keep the reviewed CA
# bundle version stable instead of accepting whichever transitive release
# httpx happens to resolve in an unlocked wheel install.
"certifi==2026.5.20",
# The retained Bitwarden secret source imports cryptography directly. MCP
# also pulls it transitively today, but that is not a stable public contract.
"cryptography==48.0.1", # CVE-2026-39892, CVE-2026-34073, GHSA-537c-gmf6-5ccf
# Home Assistant is a retained built-in tool. Its REST helpers use the
# coroutine-native aiohttp transport and construct one owned session per
# operation, so the base package works whenever HASS_TOKEN is present.
"aiohttp==3.14.3",
# The retained trajectory compressor's default Kimi tokenizer publishes a
# tiktoken BPE. We download its assets with httpx/aiofiles and construct the
# CPU-only encoder directly, avoiding Transformers' synchronous Hub/file I/O.
"tiktoken==0.13.0",
# Standard custom trajectory tokenizers publish their complete Rust pipeline
# as tokenizer.json. Assets are read/downloaded asynchronously, then parsed
# from memory without Transformers' synchronous Hub/file-loading path.
"tokenizers==0.23.1",
# Older Llama/T5-family tokenizers publish only a serialized SentencePiece
# model. The bytes are loaded asynchronously and parsed in memory; encoding
# is CPU-only and preserves their upstream special-token behavior.
"sentencepiece==0.2.2",
# sentencepiece_model_pb2 is imported directly when those legacy models are
# parsed, but sentencepiece does not declare protobuf as its own dependency.
# Keep clean wheel installs functional instead of relying on an unrelated
# provider extra to pull the generated-code runtime transitively.
"protobuf==6.33.6",
# Native CDP transport for browser_cdp and the persistent supervisor.
"websockets==15.0.1",
"rich==14.3.3",
"fire==0.7.1",
"pyyaml==6.0.3",
# Bumped from 2.12.5 to 2.13.4 to pull in pydantic-core 2.46.4.
# pydantic-core 2.41.5 (pulled by 2.12.5) segfaults when the OpenAI SDK's
# Responses API resource is exercised from a non-main thread, which is the
# codex_responses dispatch in agent/chat_completion_helpers.py:_call.
"pydantic==2.13.4",
# External MCP is part of the retained agent tool surface, not an optional
# UI integration. Keep the client SDK available in every slim installation.
"mcp==2.0.0",
"httpx2==2.7.0",
# MCP's HTTP/SSE stack imports Starlette. Pin the patched release directly
# rather than relying on its unconstrained transitive resolution.
"starlette==1.3.1", # CVE-2026-48710
# Windows has no IANA tzdata shipped with the OS, so Python's ``zoneinfo``
# (PEP 615) raises ``ZoneInfoNotFoundError`` for every non-UTC timezone
# out of the box. ``tzdata`` ships the Olson database as a data package
# Python resolves automatically. No-op on Linux/macOS (which have
# /usr/share/zoneinfo). Credits: PR #13182 (@sprmn24).
"tzdata==2025.3; sys_platform == 'win32'",
# Cross-platform process / PID management. `psutil` is the canonical
# answer for "is this PID alive" and process-tree walking across Linux,
# macOS and Windows. It replaces POSIX-only idioms like `os.kill(pid, 0)`
# (which is a silent killer on Windows — see CONTRIBUTING.md) and
# `os.killpg` (which doesn't exist on Windows).
"psutil==7.2.2",
# Image resize recovery for the vision tools. Pillow shrinks oversized images
# (>5 MB or >8000px) at embed time; without it the byte AND pixel-dimension
# shrink paths no-op, so an oversized image bakes into immutable history and
# bricks the session on Anthropic's non-retryable 400. Pure-wheel, no system
# libs required for the codecs we use, so it is safe to ship in the base
# install rather than requiring a mid-session install.
"Pillow==12.3.0",
# Windows log rotation. Stdlib ``RotatingFileHandler.doRollover()`` uses
# ``os.rename()`` which fails with ``PermissionError [WinError 32]`` on
# Windows whenever any other process holds an append-mode handle on
# ``agent.log`` (for example, concurrent agents or MCP servers may log from
# separate processes), pinning ``agent.log`` at the 5 MiB threshold and spamming
# stderr on every emit (see #44873). ``concurrent-log-handler`` wraps the
# rename in a cross-process file lock (via ``portalocker``: pywin32 on
# Windows) so only one process rotates at a time. ``hermes_logging.py``
# aliases it ONLY on Windows — POSIX renames an open file fine, so stdlib
# already works there and managed-mode perms depend on its exact lifecycle.
# Hence the ``sys_platform == 'win32'`` marker: the dep (and its portalocker
# / pywin32 tree) ships only where it's actually used.
"concurrent-log-handler==0.9.29; sys_platform == 'win32'",
]
[project.urls]
Documentation = "https://ykoh42.github.io/async-hermes-agent/"
Issues = "https://github.com/ykoh42/async-hermes-agent/issues"
Repository = "https://github.com/ykoh42/async-hermes-agent"
[project.optional-dependencies]
# Native Anthropic provider — only needed when provider=anthropic (not via
# OpenRouter or other aggregators).
anthropic = ["anthropic==0.87.0"] # CVE-2026-34450, CVE-2026-34452
# Vertex credential refresh uses google-auth's coroutine credentials and its
# aiohttp transport. It is provider-specific and therefore stays out of the
# base install.
vertex = ["google-auth[aiohttp]==2.56.2"]
# Microsoft Entra ID uses azure.identity.aio; aiohttp is its documented async
# transport and remains provider-specific.
azure-identity = ["azure-identity==1.25.3", "aiohttp==3.14.3"]
# Web search backends — each only loaded when selected in config.yaml.
parallel-web = ["parallel-web==0.4.2"]
# Exa and Firecrawl now use the retained native httpx transport; keep their
# upstream install-extra names as no-op compatibility aliases.
exa = []
firecrawl = []
# FAL video generation backend; loaded only when that plugin is selected.
fal = ["fal-client==0.13.1"]
# Retained native-async speech providers.
edge-tts = ["edge-tts==7.2.7"]
tts-premium = ["elevenlabs==1.59.0"]
mistral = ["mistralai==2.4.8"]
# Piper's SDK is synchronous; the retained tool runs it in an owned,
# profile-scoped subprocess broker. Keep the GPL provider opt-in and out of
# the base library dependency set.
piper-tts = ["piper-tts==1.6.0"]
# Optional native-async cloud execution backends retained from upstream.
modal = ["modal==1.3.4"]
daytona = ["daytona==0.155.0"]
vercel = ["vercel==0.7.2"]
# Retained tools whose former optional dependencies are now in core.
homeassistant = [] # aiohttp is a core dependency.
computer-use = ["mcp==2.0.0", "httpx2==2.7.0", "starlette==1.3.1"] # CVE-2026-48710; cua-driver remains external.
vision = [] # Pillow is a core dependency.
dev = ["pytest==9.1.1", "pytest-asyncio==1.3.0", "blockbuster==1.5.26", "flake8-async==26.6.1", "pyleak==0.2.0", "ty==0.0.21", "ruff==0.15.10", "setuptools==83.0.0", "mcp==2.0.0", "httpx2==2.7.0"]
# CVE-2026-48710 (BadHost): Starlette is pulled transitively by MCP's
# sse-starlette / HTTP-SSE stack. Before
# 1.0.1, a malformed Host header makes `request.url.path` desync from the path
# the ASGI router actually dispatched, so middleware/endpoints that gate on
# `request.url` can be bypassed. We pin a patched Starlette directly in every
# extra that exposes a Starlette-backed server surface so pip/uv can't resolve
# a vulnerable pre-1.0.1 transitive. Bump in lockstep with uv.lock.
mcp = ["mcp==2.0.0", "httpx2==2.7.0", "starlette==1.3.1"] # CVE-2026-48710
bedrock = [
"aiobotocore==3.8.0",
"anthropic[bedrock]==0.87.0",
]
# Mem0 Platform/OSS memory provider. Self-hosted HTTP mode uses the core
# httpx dependency and does not require this extra.
mem0 = [
"mem0ai==2.0.10",
"ollama==0.6.2",
"psycopg[binary,pool]==3.3.4",
]
# Supermemory's pinned SDK exposes AsyncSupermemory and accepts the harness's
# owned httpx.AsyncClient, so no worker-thread compatibility layer is needed.
supermemory = ["supermemory==3.50.0"]
# Hindsight's published client exposes native coroutine retain/recall/reflect
# operations and deterministic ``aclose()``; local embedded mode additionally
# needs the separately installed ``hindsight-all`` runtime.
hindsight = ["hindsight-client==0.6.1", "packaging==26.0"]
# Honcho 2.2 exposes provider, peer, session, and conclusion operations through
# its native coroutine ``.aio`` views. The plugin never instantiates the SDK's
# synchronous HTTP transport.
honcho = ["honcho-ai==2.2.0"]
# Explicit PostgreSQL SessionDB backend. SQLAlchemy Core is used with
# psycopg 3's native async dialect; SQLite remains the default backend.
postgres = ["SQLAlchemy[asyncio]==2.0.51", "psycopg[binary]==3.3.4"]
[build-system]
requires = ["setuptools>=77.0,<83"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
# Top-level single-file modules (not packages).
py-modules = [
"run_agent",
"model_tools",
"toolsets",
"mini_swe_runner",
"batch_runner",
"trajectory_compressor",
"toolset_distributions",
"hermes_bootstrap",
"hermes_constants",
"hermes_state",
"hermes_state_postgres",
"hermes_state_common",
"hermes_state_portability",
"hermes_state_schema",
"hermes_state_search",
"hermes_time",
"hermes_logging",
"utils",
]
[tool.setuptools.packages.find]
include = ["agent", "agent.*", "tools", "tools.*", "hermes_cli", "hermes_cli.*", "plugins", "plugins.*", "providers", "providers.*", "gateway", "gateway.*"]
[tool.setuptools.package-data]
# Plugin discovery is manifest-driven. Source checkouts can see these files
# directly, but wheels need them declared explicitly or every bundled web
# provider silently disappears after installation.
plugins = ["**/*.yaml"]
# NeuTTS resolves its upstream default reference voice relative to
# ``tools/tts_tool.py``. Keep the exact tracked transcript/audio pair in built
# wheels so source and clean-install behavior are identical.
tools = ["neutts_samples/*.txt", "neutts_samples/*.wav"]
[tool.pytest.ini_options]
testpaths = ["tests"]
markers = [
"integration: marks hermetic multi-component integration tests",
"real_concurrent_gate: opt out of the autouse stub that disables _detect_concurrent_hermes_instances",
"requires_wal: needs the runtime to actually enable SQLite WAL mode (skipped where Hermes falls back to journal_mode=DELETE)",
"no_isolate: opt out of per-file subprocess isolation (tests share mutable module-level state)",
"ssh: marks tests requiring a reachable SSH server (skipped in normal CI)",
]
[tool.ty.environment]
python-version = "3.13"
[tool.ty.rules]
unknown-argument = "warn"
redundant-cast = "ignore"
[tool.ruff]
preview = true # required for PLW1514 (unspecified-encoding) — preview rule
target-version = "py311"
[tool.ruff.lint]
# Keep the encoding rule and the Python 3.11-safe modernization rules enabled.
# The UP rules below enforce the annotation and stdlib forms used throughout
# the retained runtime without enabling unrelated style migrations.
select = [
"PLW1514",
"UP006",
"UP007",
"UP017",
"UP024",
"UP035",
"UP037",
"UP041",
"UP045",
"UP028",
"UP031",
"UP042",
"RUF013",
]
[tool.ruff.lint.per-file-ignores]
# Tests can intentionally exercise locale-encoding edge cases.
"tests/**" = ["PLW1514"]
# Skills and plugins are partially user-authored — their own conventions.
"skills/**" = ["PLW1514"]
"plugins/**" = ["PLW1514"]