forked from xorbitsai/xagent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
363 lines (333 loc) · 9.5 KB
/
Copy pathpyproject.toml
File metadata and controls
363 lines (333 loc) · 9.5 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
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
[project]
authors = [
{ name = "Jicheng Shi", email = "rogershijicheng@gmail.com" },
{ name = "Xuye Qin", email = "qinxuye@gmail.com" },
]
name = "xagent-ai"
dynamic = ["version"]
description = "a powerful agent os with great compatibility"
license = { text = "Xagent Source License" }
readme = "README.md"
requires-python = ">=3.11"
classifiers = [
"Development Status :: 1 - Planning",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.11",
]
dependencies = [
"pydantic >= 2.11.7",
"langchain-openai >= 0.3.27",
"langchain >= 0.3.26",
"langchain-community >= 0.3.21",
"openai >= 1.50.0",
"anthropic >= 0.84.0",
"google-genai >= 1.65.0",
"elevenlabs >= 2.0.0",
"xinference-client >= 2.3.0",
"zai-sdk>=0.0.3.2",
"numexpr >= 2.11.0",
"aiohttp >= 3.12.14",
"tqdm >= 4.66.0",
"beautifulsoup4 >= 4.12.3",
"html2text >= 2025.4.15",
"PyYAML >= 6.0.2",
"fastapi >= 0.35.0",
"uvicorn >= 0.35.0",
"websockets>=15.0.1",
"httpx[socks] >= 0.27.2",
"rich >= 14.0.0",
"prompt_toolkit >= 3.0.0",
"langfuse >= 4.0.6, < 5.0.0", # Tracing implementation targets the v4 SDK API
"python-dotenv >= 1.0.1",
"mcp>=1.12.4",
"asyncssh>=2.14.0", # SSH MCP runner (production runtime, not just tests)
"requests >= 2.32.0",
"celery[redis]>=5.4.0,<6.0.0",
"redis>=5.0.0",
"pillow >= 10.0.0",
"pypinyin>=0.53.0",
"cairosvg >= 2.7.1",
"lancedb>=0.13.0",
"pyarrow>=16.1.0",
# Basic document processing (keep pypdf for basic PDF support)
"pypdf>=4.0.0",
"tiktoken>=0.8.0",
# Database ORM and migrations (core for web interface)
"sqlalchemy>=2.0.0",
"alembic>=1.13.0",
"python-jose[cryptography]>=3.3.0",
"cryptography>=3.0.0",
"bcrypt>=4.0.0",
# Rate limiting for public trigger callback and trigger CRUD endpoints
"limits>=3.13.0",
# Per-mailbox Gmail Pub/Sub provisioning for Gmail triggers
"google-cloud-pubsub>=2.21.0",
# Utilities
"docker>=7.1.0",
"json-repair==0.35.0",
"jsonschema>=4.25.1",
"beartype>=0.18.5",
"matplotlib>=3.5.0",
"google-auth-oauthlib>=1.2.0",
"google-api-python-client>=2.111.0",
"boxlite>=0.6.0; sys_platform == 'linux' and platform_machine == 'x86_64'",
"boxlite>=0.6.0; sys_platform == 'darwin' and platform_machine == 'arm64'",
"filelock>=3.0.0",
"fsspec>=2024.0.0",
"cloudpickle>=3.0.0",
"exa-py>=2.0.0",
# Data science libraries (core for RAG and analysis)
"pandas>=1.3.0",
# Special handling - AI-enhanced document processing
"deepdoc-lib==0.2.2",
"aiogram>=3.4.1",
"aiohttp-socks>=0.8.4",
"lark-oapi>=1.5.3",
"s3fs>=2026.2.0",
"authlib>=1.7.2",
"itsdangerous>=2.2.0",
"volcengine-python-sdk[ark]>=5.0.37",
"byteplus-python-sdk-v2>=3.0.52",
]
[project.optional-dependencies]
command-path-guard = ["bashlex>=0.18"]
# In-process LLM routing for OpenRouter's "auto" model. xrouter-llm currently
# does not declare its bundled predictor runtime deps, so keep them explicit
# here until upstream does.
router = [
"xrouter-llm>=0.1.2",
"sentence-transformers>=3.0.0",
# xrouter-llm's embedding model is a Qwen3-architecture checkpoint; transformers
# only registered the `qwen3` model type in 4.51.
"transformers>=4.51",
"torch>=2.0.0",
]
# document processing libraries(Non-AI)
document-processing = [
"pdfplumber>=0.10.0",
"unstructured>=0.15.0",
# Keep unstructured from resolving to legacy numba releases that cannot build
# on Python 3.12 after deepdoc-lib moved the environment to NumPy 2.x.
"numba>=0.64.0",
"typer>=0.9.0", # Required by spacy CLI, used by unstructured
"pymupdf>=1.23.0,<1.27.0",
"python-docx>=1.1.0",
"openpyxl>=3.1.0",
"python-pptx>=0.6.0",
"pypdf2>=3.0.1",
]
# AI-related document processing
ai-document = ["docling>=2.68.0"]
# PostgreSQL driver (uses psycopg2-binary for convenience)
# Note: For production, consider installing psycopg2 from source instead
postgresql = ["psycopg2-binary>=2.9.0"]
duckdb = ["duckdb>=1.0.0,<2.0", "duckdb-engine>=0.10.0,<1.0"]
# Browser automation
browser = ["playwright>=1.40.0"]
# Browser TLS fingerprint impersonation for WAF-sensitive web crawling
waf-crawl = ["curl_cffi>=0.14.0"]
# Alternative vector databases (optional alternatives to LanceDB)
chromadb = ["chromadb"]
milvus = ["pymilvus>=2.6.9,<3.0.0"]
# All optional extras (for users who want everything)
# Note: List packages directly since optional-dependencies doesn't support include-group
all = [
"bashlex>=0.18",
"unstructured>=0.15.0",
"numba>=0.64.0",
"typer>=0.9.0", # Required by spacy CLI, used by unstructured
"pymupdf>=1.23.0,<1.27.0",
"python-docx>=1.1.0",
"openpyxl>=3.1.0",
"python-pptx>=0.6.0",
"pypdf2>=3.0.1",
"docling>=2.68.0",
"psycopg2-binary>=2.9.0",
"playwright>=1.40.0",
"curl_cffi>=0.14.0",
"chromadb",
"pymilvus>=2.6.9,<3.0.0",
"xrouter-llm>=0.1.2",
"sentence-transformers>=3.0.0",
]
[dependency-groups]
backend-image = [
"unstructured>=0.15.0",
"numba>=0.64.0",
"typer>=0.9.0",
"pymupdf>=1.23.0,<1.27.0",
"python-docx>=1.1.0",
"openpyxl>=3.1.0",
"python-pptx>=0.6.0",
"pypdf2>=3.0.1",
"docling>=2.68.0",
"psycopg2-binary>=2.9.0",
"playwright>=1.40.0",
"curl_cffi>=0.14.0",
"chromadb",
"pymilvus>=2.6.9,<3.0.0",
"torch",
"torchvision",
"xrouter-llm>=0.1.2",
"sentence-transformers>=3.0.0",
]
# Development tools (linting, formatting)
dev = [
"pre-commit>=4.2.0",
"ruff>=0.12.3",
"flake8>=7.3.0",
"mypy>=1.16.1",
{ include-group = "test" },
{ include-group = "static-type-check" },
]
# Testing dependencies
test = [
"bashlex>=0.18",
"pytest>=8.0",
"pytest-mock>=3.14.1",
"pytest-cov>=6.2.1",
"pytest-asyncio>=0.24.0",
"pytest-xdist>=3.0",
"pytest-dotenv>=0.5.2",
"pytest-timeout>=2.4.0",
"pytest-socket>=0.7.0",
"psycopg2-binary>=2.9.0",
"chromadb",
"pymilvus>=2.6.9,<3.0.0",
"copilotkit==0.1.69",
"langgraph-prebuilt<1.0.9",
"openpyxl>=3.1.5",
"asyncssh>=2.14.0",
]
# Static type checking
static-type-check = [
"types-PyYAML>=6.0",
"types-requests>=2.0.0",
"types-openpyxl>=3.1.5",
"types-setuptools>=69.0.0",
"types-docker>=7.1.0.20251009",
]
[project.scripts]
xagent = "xagent.web.__main__:main"
xagent-web = "xagent.web.__main__:main"
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[tool.uv.sources]
torch = [{ index = "pytorch-cpu" }]
torchvision = [{ index = "pytorch-cpu" }]
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[tool.hatch.version]
source = "vcs"
[tool.pytest.ini_options]
addopts = "-ra -q"
testpaths = ["tests"]
asyncio_mode = "auto"
pythonpath = ["tests/_stubs"]
markers = [
"integration: marks tests as integration tests",
"slow: marks tests as slow running tests",
"postgresql: marks tests that require PostgreSQL database",
"real_rag: real embedding/provider/search KB integration; prefer serial CI (-n 0) under load",
"contract_stub: stable API contract tests using stub embedding or mocks",
"e2e: end-to-end style tests (may be slow)",
"requires_network: tests that need outbound network access",
]
[tool.mypy]
mypy_path = "src:stubs"
disallow_any_unimported = true
no_implicit_optional = true
check_untyped_defs = true
exclude = ["src/xagent/web/uploads/", "src/xagent/migrations/"]
warn_return_any = true
show_error_codes = true
warn_unused_ignores = true
python_version = "3.11"
disallow_untyped_defs = true
plugins = ["pydantic.mypy"]
namespace_packages = true
explicit_package_bases = true
[[tool.mypy.overrides]]
module = [
"asyncssh",
"bashlex",
"docx",
"pptx",
"pptx.*",
"pdfplumber",
"unstructured.*",
"fitz",
"pandas",
"matplotlib",
"matplotlib.pyplot",
"deepdoc",
"deepdoc.*",
"json_repair",
"langchain_core.*",
"langchain.*",
"jose",
"alembic",
"alembic.*",
"xinference",
"xinference.*",
"xinference_client",
"aiogram",
"aiogram.*",
"lark_oapi",
"lark_oapi.*",
"exa_py",
"exa_py.*",
"celery",
"celery.*",
"kombu",
"kombu.*",
"fsspec",
"fsspec.*",
"joblib",
"xrouter_llm",
"xrouter_llm.*",
"google.pubsub_v1",
]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["core.tools.file_tool"]
ignore_errors = true
[[tool.mypy.overrides]]
module = ["xagent.core.tools.core.vision_tool"]
disable_error_code = ["assignment"]
[[tool.mypy.overrides]]
module = [
"xagent.core.model.chat.basic.xinference",
"xagent.core.model.embedding.xinference",
"xagent.core.model.image.xinference",
"xagent.core.model.asr.xinference",
"xagent.core.model.tts.xinference",
"xagent.web.channels.telegram.bot",
"xagent.web.channels.telegram.handler",
# asyncssh ships no type stubs; the runner annotates connection types that
# would otherwise trip disallow_any_unimported.
"xagent.core.ssh.runner",
]
disallow_any_unimported = false
warn_unused_ignores = false
[tool.hatch.build.targets.wheel]
packages = ["src/xagent"]
# `packages` already includes the whole src/xagent tree (Python sources plus the
# tracked skills/templates data files). Do NOT add an explicit `include` here:
# in hatchling an `include` list becomes the authoritative allowlist and would
# drop everything else (the entire Python package). The built frontend static
# export is .gitignore'd as a build output, so it must be declared as an
# artifact for the single-process (pip / uvx) deployment to serve the UI.
artifacts = ["src/xagent/web/frontend_dist/**"]
[tool.hatch.build.targets.sdist]
artifacts = ["src/xagent/web/frontend_dist/**"]
[tool.hatch.metadata]
allow-direct-references = true
[tool.isort]
profile = "black"
line_length = 88
multi_line_output = 3
include_trailing_comma = true