Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
272 lines (254 loc) · 10.7 KB
/
Copy pathpyproject.toml
File metadata and controls
272 lines (254 loc) · 10.7 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
[project]
name = "aios"
version = "0.1.0"
description = "Open-source agent runtime: Postgres-backed sessions, Docker sandbox, any LiteLLM model"
readme = "README.md"
requires-python = ">=3.13"
license = { text = "MIT" }
authors = [{ name = "aios contributors" }]
dependencies = [
# HTTP + SSE
"fastapi>=0.115",
"uvicorn[standard]>=0.32",
"sse-starlette>=2.1",
# Validation + settings
"pydantic>=2.9",
"pydantic-settings>=2.6",
# Direct runtime dependency: MCP dispatch validates untrusted third-party
# tool arguments with Draft 2020-12 before any connector side effect.
"jsonschema==4.23.0",
# jsonschema's immutable registry disables remote $ref retrieval.
"referencing==0.37.0",
# Postgres + migrations + job queue
"asyncpg>=0.32.0",
"alembic>=1.13",
"sqlalchemy>=2.0", # required by alembic even when used without the ORM
"procrastinate==3.8.1", # exact pin so the task/connector API stays stable
"psycopg[binary]>=3.2", # required by procrastinate; aios uses asyncpg directly
"croniter>=3.0", # cron expression validation + next-fire computation (scheduled_tasks)
"dateparser>=1.2", # natural-language time parsing for schedule_wake's `at` argument
# dateparser resolves its TIMEZONE setting through pytz and raises
# pytz's UnknownTimeZoneError for an unknown `tz`; schedule_wake catches
# that to reject bad model input as a client error. Declared directly
# (not relied on transitively) so the caught exception type is pinned.
"pytz>=2024.1",
# Bundled IANA tz database so zoneinfo resolves named zones for per-account
# received-at rendering regardless of whether the deploy image ships a
# system tzdb (otherwise tzdata is only a win32-marked transitive dep).
"tzdata>=2024.1",
# Sandbox
"aiodocker>=0.23",
# Crypto + ids
"pynacl>=1.5",
"cryptography>=46", # egress-CA x509 cert + EC key (sandbox/egress_ca.py)
"asyncssh>=2.21", # ssh built-in tool (tools/ssh.py): connect/exec + in-memory
# key/known_hosts parse. Ships py.typed; only hard dep
# (cryptography) is already direct above.
"python-ulid>=3.0",
# LLM client
# >=1.96.2 includes current provider/model capability data. AIOS still treats
# that map as advisory and centrally passes supplied params to the provider.
"litellm>=1.96.2",
# MCP client + server reflection.
# Cap <2: SDK v2 is a breaking rearchitecture (maintainers advise pinning <2).
"mcp>=1.20,<2",
"fastapi-mcp>=0.4",
# Web tools
"httpx>=0.27",
# HTTP/1.1 framing for the TLS-terminating secret-egress proxy
# (sandbox/secret_egress_proxy.py). Already transitive via httpcore;
# pinned direct because we use it as a sans-IO server parser.
# >=0.16 excludes the request-smuggling-vulnerable parser (CVE-2025-43859).
"h11>=0.16",
# CLI
"typer>=0.12",
# Observability
"structlog>=24.4",
# Split into its own package so connector containers can depend on the
# SDK without dragging in fastapi/asyncpg/procrastinate/etc.
"aios-sdk",
# Shared HTTP-client SDK: the runtime imports ``sniff_image_mime``
# for renderer-side mime correction so the same magic-byte detector
# runs at the connector boundary and at replay time.
"aios-connector-http",
# Inbound image downsampling at staging time so vision-capable models
# see the pixels instead of a path marker. See harness/image_resize.py.
"pillow>=10.0",
"sqlglot>=30.12.0",
]
[dependency-groups]
dev = [
"pytest>=8.3",
"pytest-asyncio>=0.24",
"pytest-mock>=3.14",
"pytest-xdist>=3.6", # parallel test execution on docker e2e shard
# Generative (hypothesis) law tests for the attenuation operator (#1758) —
# hand-built strategies over Surface, no plugin (pydantic v2 has none). Seeded/
# derandomized so `pytest -n 4` (unit CI) stays deterministic across workers.
"hypothesis>=6.100",
"httpx>=0.27", # FastAPI TestClient backend
"testcontainers[postgres]>=4.8",
"ruff>=0.8",
"mypy>=1.13",
"openapi-python-client>=0.21",
# Reference + production connectors — e2e tests import each
# connector's runner directly to drive multi-connection routing.
"aios-echo-http",
"aios-matrix",
"aios-signal",
"aios-slack",
"aios-sms",
"aios-telegram",
"aios-whatsapp",
# The per-account browser driver (jarbot#106 Phase 2). A workspace member,
# not an aios dependency (the runtime must never import it); dev-installed
# so its unit suite runs in the normal PR lane with playwright available.
"aios-browser-driver",
"types-pyyaml>=6",
]
[project.scripts]
aios = "aios.__main__:main"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/aios", "src/aios_connectors"]
# ─── uv workspace ────────────────────────────────────────────────────────────
[tool.uv.workspace]
members = [
"connectors/echo-http",
"connectors/matrix",
"connectors/signal",
"connectors/slack",
"connectors/sms",
"connectors/telegram",
"connectors/whatsapp",
"packages/aios-browser-driver",
"packages/aios-connector-http",
"packages/aios-sdk",
]
# Install the SDK + reference + production connectors in editable mode
# for development and tests; production deploys each connector as its
# own container.
[tool.uv.sources]
aios-browser-driver = { workspace = true }
aios-connector-http = { workspace = true }
aios-echo-http = { workspace = true }
aios-matrix = { workspace = true }
aios-sdk = { workspace = true }
aios-signal = { workspace = true }
aios-slack = { workspace = true }
aios-sms = { workspace = true }
aios-telegram = { workspace = true }
aios-whatsapp = { workspace = true }
# ─── ruff ────────────────────────────────────────────────────────────────────
[tool.ruff]
line-length = 100
target-version = "py313"
src = ["src", "tests"]
# Build artifact from scripts/regen-client.sh; lint complaints belong
# upstream in openapi-python-client, not in this repo.
extend-exclude = ["packages/aios-sdk/aios_sdk/_generated"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # bugbear
"UP", # pyupgrade
"SIM", # simplify
"RUF", # ruff-specific
"TID", # tidy imports
"ASYNC", # async-specific lints
]
ignore = [
"E501", # line length is enforced by the formatter
]
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = [
"B011", # allow asserts in tests
]
[tool.ruff.lint.isort]
# Workspace packages are first-party from the linter's perspective even
# though they're separate distributions. Without this hint ruff groups
# them with third-party imports and complains about import order.
known-first-party = ["aios", "aios_sdk", "aios_connector_http"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
# ─── mypy ────────────────────────────────────────────────────────────────────
[tool.mypy]
python_version = "3.13"
strict = true
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_unreachable = true
disallow_any_generics = true
disallow_untyped_defs = true
no_implicit_optional = true
plugins = ["pydantic.mypy"]
[[tool.mypy.overrides]]
module = [
"litellm.*",
"mcp.*",
"fastapi_mcp.*",
"aiodocker.*",
"procrastinate.*",
"testcontainers.*",
"asyncpg",
"asyncpg.*",
"croniter",
"croniter.*",
"dateparser",
"dateparser.*",
"pytz",
"pytz.*",
"jsonschema",
"prometheus_client",
"prometheus_client.*",
]
ignore_missing_imports = true
# slack-sdk's async Socket-Mode surface is only partially typed (its
# ``connect``/``disconnect``/``close`` come back as untyped functions and
# its listener-list element type is the abstract base client). Treat the
# whole package as untyped at the import boundary so strict mypy doesn't
# flag every call into it; the connector wraps the seam thinly.
[[tool.mypy.overrides]]
module = ["slack_sdk.*"]
ignore_missing_imports = true
follow_imports = "skip"
follow_imports_for_stubs = true
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
# Build artifact from scripts/regen-client.sh; type complaints belong
# upstream in openapi-python-client, not here.
[[tool.mypy.overrides]]
module = "aios_sdk._generated.*"
ignore_errors = true
follow_imports = "skip"
# ─── pytest ──────────────────────────────────────────────────────────────────
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
addopts = [
"-ra",
"--strict-markers",
"--strict-config",
# Surface slow tests in every CI log so regressions don't accumulate
# silently. ``--durations-min=0.5`` filters out the noise floor so
# the report stays a sentence, not a screenful.
"--durations=20",
"--durations-min=0.5",
]
markers = [
"integration: tests requiring a Postgres testcontainer",
"e2e: end-to-end tests requiring Docker + a real or recorded model",
"slow: heavy tests (benchmarks, large fixtures) — skipped on PR CI, run nightly",
"docker: e2e tests that need the sandbox image (selected by CI's docker shard)",
"perf: ADVISORY wall-clock scaling backstops — NON-GATING, never in required-checks (#1661)",
"netns_sidecar_egress: asserts on the effect of the in-netns iptables lockdown, applied by a sidecar that joins the sandbox netns. Cannot work with the CURRENT mechanism under gVisor/runsc: two containers sharing a netns get separate Sentries/netstacks, so the sidecar addresses a different netstack and even the FILTER table fails to initialize (aios#2310). Deselected in the gVisor leg only; runs normally under runc. A runtime-agnostic egress mechanism (host-level DOCKER-USER rules) would fix it — this is not unfixable, just not possible in-netns.",
"runsc_dns_unresolved: fails under gVisor/runsc with curl exit 6 (CURLE_COULDNT_RESOLVE_HOST) for a reason NOT related to the egress sidecar — the sandbox never invokes it. An unexplained DNS defect under runsc, tracked separately (aios#2430) so it is not buried under the netstack story.",
]