[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "ai-intervention-agent"
version = "1.4.10"
description = "AI Intervention Agent: MCP server enabling real-time user intervention in AI-assisted development workflows."
readme = "README.md"
license = "MIT"
requires-python = ">=3.11"
authors = [
{ name = "xiadengma", email = "52972447+XIADENGMA@users.noreply.github.com" },
]
keywords = [
"mcp",
"ai",
"intervention",
"feedback",
"agent",
"claude",
"cursor",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
dependencies = [
"fastmcp>=2.10.5",
"flask>=3.1.0",
"flask-compress>=1.15.0",
"flask-cors>=5.0.0",
"flask-limiter>=3.12.0",
"markdown>=3.8.0",
"platformdirs>=4.3.0",
"plyer>=2.1.0",
"psutil>=6.1.0",
"pygments>=2.18.0",
"requests>=2.32.0",
"urllib3>=2.3.0",
"watchdog>=6.0.0",
"zeroconf>=0.146.0",
]
[project.optional-dependencies]
dev = [
"pytest>=8.4.0",
"pytest-cov>=6.2.1",
"pytest-timeout>=2.3.0",
"black>=23.0.0",
"isort>=5.12.0",
"flake8>=7.2.0",
"mypy>=1.0.0",
"ruff>=0.8.0",
"ty",
"rcssmin>=1.1.2",
"rjsmin>=1.2.5",
]
[project.urls]
Homepage = "https://github.com/xiadengma/ai-intervention-agent"
Repository = "https://github.com/xiadengma/ai-intervention-agent"
Issues = "https://github.com/xiadengma/ai-intervention-agent/issues"
Documentation = "https://github.com/xiadengma/ai-intervention-agent#readme"
[project.scripts]
ai-intervention-agent = "server:main"
[tool.hatch.build.targets.wheel]
packages = ["."]
exclude = [
"/packages/vscode",
"/packages/vscode/**",
]
[tool.hatch.build.targets.sdist]
include = [
"/server.py",
"/web_ui.py",
"/config_manager.py",
"/config_utils.py",
"/enhanced_logging.py",
"/file_validator.py",
"/notification_manager.py",
"/notification_providers.py",
"/task_queue.py",
"/config.jsonc.default",
"/templates",
"/static",
"/sounds",
"/icons",
"/README.md",
"/LICENSE",
]
[tool.black]
line-length = 88
target-version = ['py311']
include = '\.pyi?$'
extend-exclude = '''
/(
# directories
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| build
| dist
)/
'''
[tool.isort]
profile = "black"
multi_line_output = 3
line_length = 88
[tool.mypy]
python_version = "3.11"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = "--cov=ai_intervention_agent --cov-report=term-missing"
[dependency-groups]
dev = [
"flake8>=7.2.0",
"pytest>=8.4.0",
"pytest-cov>=6.2.1",
"pytest-timeout>=2.3.0",
"rcssmin>=1.1.2",
"rjsmin>=1.2.5",
"ruff>=0.8.0",
"ty",
]
[tool.ruff]
# 目标 Python 版本
target-version = "py311"
# 行长度限制
line-length = 88
[tool.ruff.lint]
# 启用的规则
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
]
# 忽略的规则
ignore = [
"E501", # 行长度由 formatter 处理
"B008", # Field() 在默认参数中调用 - fastmcp 框架用法
"B026", # star-arg 解包 - 框架兼容性需要
]
[tool.ruff.lint.per-file-ignores]
# 测试文件允许导入不在顶部(需要先修改 sys.path)
"tests/*.py" = ["E402", "F841"]
# server.py 特殊配置
"server.py" = ["E402"]
[tool.ruff.format]
# 使用双引号
quote-style = "double"
# 缩进使用空格
indent-style = "space"
[tool.ty.environment]
# 与项目 requires-python 保持一致
python-version = "3.11"
[tool.ty.terminal]
# 更精简的输出,便于在 CI/终端阅读
output-format = "concise"