-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
393 lines (353 loc) · 9.79 KB
/
pyproject.toml
File metadata and controls
393 lines (353 loc) · 9.79 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
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "superego-mcp"
dynamic = ["version"]
description = "Intelligent tool-call review system for AI agents"
requires-python = ">=3.11"
readme = "README.md"
license = "MIT"
authors = [
{ name = "Brian Cripe", email = "brian@onegrep.dev" },
]
keywords = [
"mcp",
"ai",
"agent",
"llm",
"toolprint",
"security",
"tool-filtering",
"claude-code",
"hooks",
"agent-safety",
"llm-safety",
"inference-control",
"rule-engine",
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Security",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Monitoring",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Environment :: Console",
"Typing :: Typed",
]
dependencies = [
"fastmcp>=2.0.0", # MCP server framework with sampling support
"pydantic>=2.0.0", # Data validation and domain models
"pyyaml>=6.0", # Configuration file parsing
"watchfiles>=0.20.0", # File system monitoring for hot-reload
"jinja2>=3.1.0", # Secure prompt templating
"httpx>=0.25.0", # HTTP client for AI services
"structlog>=23.0.0", # Structured logging
"psutil>=5.9.0", # System metrics for health checks
"fastapi>=0.104.0", # FastAPI for HTTP and WebSocket transports
"uvicorn[standard]>=0.24.0", # ASGI server for FastAPI
"jsonpath-ng>=1.6.0", # JSONPath expression support
"python-dateutil>=2.8.0", # Time-based rule evaluation
"prometheus-client>=0.19.0", # Prometheus metrics export
"aiohttp>=3.9.0", # HTTP server for monitoring dashboard
"aiohttp-sse>=2.1.0", # Server-sent events for real-time metrics
"docker>=7.1.0",
"requests>=2.32.4",
]
[project.optional-dependencies]
# Core dependencies for evaluation mode only
core = [
"pydantic>=2.0.0",
"pyyaml>=6.0",
"structlog>=23.0.0",
"jsonpath-ng>=1.6.0",
]
# Full server dependencies
server = [
"fastmcp>=2.0.0",
"fastapi>=0.104.0",
"uvicorn[standard]>=0.24.0",
"watchfiles>=0.20.0",
"psutil>=5.9.0",
"prometheus-client>=0.19.0",
"aiohttp>=3.9.0",
"aiohttp-sse>=2.1.0",
]
# CLI and development tools
cli = [
"httpx>=0.25.0",
"python-dateutil>=2.8.0",
]
# All features
all = [
"fastmcp>=2.0.0",
"fastapi>=0.104.0",
"uvicorn[standard]>=0.24.0",
"watchfiles>=0.20.0",
"psutil>=5.9.0",
"prometheus-client>=0.19.0",
"aiohttp>=3.9.0",
"aiohttp-sse>=2.1.0",
"httpx>=0.25.0",
"python-dateutil>=2.8.0",
]
# Demo and testing
demo = [
"fast-agent-mcp>=0.1.0", # Demo client for sampling testing
]
# Development dependencies
dev = [
"pytest>=7.4.0",
"pytest-asyncio>=0.21.0",
"pytest-cov>=4.1.0",
"pytest-timeout>=2.1.0",
"ruff>=0.1.0",
"mypy>=1.5.0",
"types-PyYAML>=6.0.0",
"types-psutil>=7.0.0.20250801",
"types-python-dateutil>=2.9.0.20250809",
]
# Container testing dependencies
container-test = [
"docker>=7.0.0", # Docker Python API for container management
"requests>=2.31.0", # HTTP client for container API testing
"pytest>=7.4.0", # Testing framework
"pytest-asyncio>=0.21.0", # Async test support
"pytest-timeout>=2.1.0", # Test timeout handling
]
# Test harness dependencies
test-harness = [
"cyclopts>=2.0.0", # CLI framework for test commands
"httpx>=0.25.0", # HTTP client for API testing
"rich>=13.0.0", # Rich terminal output
"pydantic>=2.0.0", # Data validation
"tomli>=2.0.0", # TOML parsing
]
[project.scripts]
# Unified CLI interface (primary)
superego = "superego_mcp.cli:main"
# Legacy entry points (maintained for backward compatibility)
superego-mcp = "superego_mcp.main:cli_main"
superego-eval = "superego_mcp.cli_eval:main"
[project.urls]
Homepage = "https://github.com/toolprint/superego-mcp"
Repository = "https://github.com/toolprint/superego-mcp"
Issues = "https://github.com/toolprint/superego-mcp/issues"
Documentation = "https://github.com/toolprint/superego-mcp/blob/main/README.md"
Changelog = "https://github.com/toolprint/superego-mcp/releases"
"Source Code" = "https://github.com/toolprint/superego-mcp"
"Bug Reports" = "https://github.com/toolprint/superego-mcp/issues"
"Feature Requests" = "https://github.com/toolprint/superego-mcp/issues"
[tool.hatch.build.targets.wheel]
packages = ["src/superego_mcp"]
# Include all runtime assets and configuration files in the wheel
include = [
# Core Python package
"src/superego_mcp/**/*.py",
# Configuration files
"src/superego_mcp/**/*.yaml",
"src/superego_mcp/**/*.yml",
"src/superego_mcp/**/*.json",
# Static assets (CSS, JS, HTML, images)
"src/superego_mcp/**/*.css",
"src/superego_mcp/**/*.js",
"src/superego_mcp/**/*.html",
"src/superego_mcp/**/*.png",
"src/superego_mcp/**/*.svg",
"src/superego_mcp/**/*.ico",
# Template files
"src/superego_mcp/**/*.jinja2",
"src/superego_mcp/**/*.j2",
# Compressed assets
"src/superego_mcp/**/*.gz",
# Build metadata and checksums
"src/superego_mcp/_build_metadata.json",
"src/superego_mcp/_asset_checksums.json",
# External configuration files (copied by build hooks)
"config/*.yaml",
"config/*.yml",
"demo/config/**/*.yaml",
"demo/config/**/*.yml",
"demo/config/**/*.json",
]
# Exclude unnecessary files from wheel
exclude = [
"**/__pycache__/**",
"**/*.pyc",
"**/*.pyo",
"**/.DS_Store",
"**/Thumbs.db",
"tests/**",
"htmlcov/**",
"dist/**",
"build/**",
"*.egg-info/**",
# Exclude temporary build files
"**/*.tmp",
"**/*.bak",
"**/.gitkeep",
]
[tool.hatch.build.hooks.custom]
path = "hatch_build.py"
# Custom build hook configuration for asset management
dependencies = [
"pyyaml>=6.0", # For configuration validation
]
# Hook runs for all build targets
require-runtime-dependencies = false
[tool.hatch.build.targets.sdist]
# Include all source files and assets in source distribution
include = [
# Source code and package files
"src/**",
# Configuration and asset directories
"config/**",
"demo/config/**",
"static/**",
"templates/**",
# Test files for development
"tests/**",
# Documentation and project files
"README.md",
"pyproject.toml",
"hatch_build.py",
"justfile",
"uv.lock",
# License and changelog
"LICENSE*",
"CHANGELOG*",
"HISTORY*",
]
exclude = [
# Build artifacts
"**/__pycache__/**",
"**/*.pyc",
"**/*.pyo",
"**/.DS_Store",
"**/Thumbs.db",
"dist/**",
"build/**",
"htmlcov/**",
"*.egg-info/**",
# Temporary and generated files
"build_report.json",
"src/superego_mcp/_build_metadata.json",
"src/superego_mcp/_asset_checksums.json",
"**/*.tmp",
"**/*.bak",
# IDE and editor files
".vscode/**",
".idea/**",
"**/*.swp",
"**/*.swo",
"**/*~",
]
[tool.hatch.version]
path = "src/superego_mcp/__init__.py"
# Build configuration for asset management
[tool.hatch.build]
# Skip VCS ignore patterns for asset inclusion
skip-excluded-dirs = true
# Force include build metadata files
[tool.hatch.build.force-include]
"src/superego_mcp/_build_metadata.json" = "superego_mcp/_build_metadata.json"
"src/superego_mcp/_asset_checksums.json" = "superego_mcp/_asset_checksums.json"
[tool.ruff]
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
"UP", # pyupgrade
]
ignore = [
"E501", # line too long, handled by black
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
[tool.mypy]
python_version = "3.11"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true
[[tool.mypy.overrides]]
module = [
"fastmcp.*",
"fast_agent_mcp.*",
]
ignore_missing_imports = true
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"--cov=superego_mcp",
"--cov-report=term-missing",
"--cov-report=html",
"--strict-markers",
"--timeout=60",
"--timeout-method=thread",
]
env = [
"TESTING=1",
"PYTEST_CURRENT_TEST=1",
]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
"unit: marks tests as unit tests",
"performance: marks tests as performance benchmarks",
]
[tool.coverage.run]
source = ["src"]
omit = [
"*/tests/*",
"*/test_*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
[dependency-groups]
dev = [
"build>=1.3.0",
"pytest>=8.4.1",
"pytest-asyncio>=1.1.0",
"pytest-cov>=6.2.1",
"pytest-timeout>=2.4.0",
"twine>=6.1.0",
"types-psutil>=7.0.0.20250801",
"types-python-dateutil>=2.9.0.20250809",
]