-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
457 lines (407 loc) · 14 KB
/
pyproject.toml
File metadata and controls
457 lines (407 loc) · 14 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
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[project]
name = "consoul"
version = "0.4.2"
description = "AI-powered terminal assistant with rich TUI - brings ChatGPT/Claude to your command line"
readme = "README.md"
requires-python = ">=3.10"
license = {text = "Apache-2.0"}
authors = [
{name = "Jared Rummler", email = "jared@jaredrummler.com"}
]
maintainers = [
{name = "Jared Rummler", email = "jared@jaredrummler.com"}
]
keywords = [
"ai",
"assistant",
"terminal",
"tui",
"cli",
"chatgpt",
"claude",
"langchain",
"textual",
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Terminals",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Typing :: Typed",
]
dependencies = [
# Core SDK dependencies
"langchain>=1.0.7",
"langchain-community (>=0.4.1,<0.5.0)",
"langchain-openai>=1.0.3",
"langchain-anthropic>=1.0.4",
"langchain-google-genai>=3.0.3",
"langchain-ollama>=1.0.0",
"langchain-huggingface>=1.0.1",
"pydantic>=2.12.4",
"pydantic-settings>=2.12.0",
"python-dotenv>=1.2.1",
"pyyaml (>=6.0.3,<7.0.0)",
"requests>=2.32.5",
"urllib3>=2.6.0",
"tiktoken>=0.12.0",
"grep-ast>=0.9.0",
"tree-sitter>=0.25.2",
"tree-sitter-language-pack>=0.11.0",
"diskcache>=5.6.3",
"duckduckgo-search>=8.1.1",
"ddgs>=9.9.0", # Required by langchain-community's DuckDuckGoSearchAPIWrapper
"prompt-toolkit (>=3.0.52,<4.0.0)",
"trafilatura (>=2.0.0,<3.0.0)",
"rich>=14.2.0",
]
# https://pypi.org/project/textual
# https://pypi.org/project/langchain
# https://pypi.org/project/langchain-openai
# https://pypi.org/project/langchain-anthropic
# https://pypi.org/project/langchain-google-genai
# https://pypi.org/project/langchain-ollama
# https://pypi.org/project/langchain-huggingface
# https://pypi.org/project/click
# https://pypi.org/project/pydantic
# https://pypi.org/project/pydantic-settings
# https://pypi.org/project/python-dotenv
# https://pypi.org/project/pyyaml (
# https://pypi.org/project/requests
# https://pypi.org/project/tiktoken
# https://pypi.org/project/pyperclip
# https://pypi.org/project/grep-ast
# https://pypi.org/project/tree-sitter
# https://pypi.org/project/tree-sitter-language-pack
# https://pypi.org/project/diskcache
# https://pypi.org/project/duckduckgo-search
[project.optional-dependencies]
# TUI dependencies (terminal user interface)
tui = ["textual>=6.6.0", "click>=8.3.1", "pyperclip>=1.11.0", "pillow>=10.0.0"]
# Feature-specific dependencies
pdf = ["pypdf>=6.2.0"]
ollama-library = ["beautifulsoup4>=4.12.0"]
logging = ["structlog>=24.4.0"] # Structured JSON logging with correlation IDs and compliance audit trails
# Observability (production monitoring and tracing)
observability = [
"langsmith>=0.1",
"opentelemetry-api>=1.20",
"opentelemetry-sdk>=1.20",
"opentelemetry-exporter-otlp>=1.20",
"prometheus-client>=0.19",
"structlog>=24.4.0",
]
langsmith = ["langsmith>=0.1"]
otel = ["opentelemetry-api>=1.20", "opentelemetry-sdk>=1.20", "opentelemetry-exporter-otlp>=1.20"]
prometheus = ["prometheus-client>=0.19"]
# Server dependencies (FastAPI backends with security middleware)
server = [
"fastapi>=0.115.0",
"uvicorn[standard]>=0.34.0",
"slowapi>=0.1.9",
"redis>=5.2.0",
"arq>=0.26.0", # Async Redis-based task queue for webhook delivery (SOUL-346)
"httpx>=0.27.0", # Async HTTP client for webhook delivery (SOUL-346)
]
# Local model execution
huggingface-local = ["transformers>=4.45.0", "torch>=2.8.0", "accelerate>=1.2.0"]
huggingface-quantization = ["transformers>=4.45.0", "torch>=2.8.0", "accelerate>=1.2.0", "bitsandbytes>=0.45.0"]
llamacpp = ["llama-cpp-python>=0.3.0"]
mlx = ["mlx-lm>=0.28.0"]
# Convenience bundles
all = ["textual>=6.6.0", "click>=8.3.1", "pyperclip>=1.11.0", "pillow>=10.0.0", "pypdf>=6.2.0", "beautifulsoup4>=4.12.0"]
[project.urls]
Homepage = "https://github.com/jaredrummler/consoul"
Documentation = "https://consoul.goatbytes.io"
Repository = "https://github.com/jaredrummler/consoul"
Issues = "https://github.com/jaredrummler/consoul/issues"
Changelog = "https://github.com/jaredrummler/consoul/blob/main/CHANGELOG.md"
[project.scripts]
consoul = "consoul.__main__:main"
# Poetry configuration
[tool.poetry]
name = "consoul"
version = "0.4.2"
description = "AI-powered terminal assistant with rich TUI - brings ChatGPT/Claude to your command line"
authors = ["Jared Rummler <jared@jaredrummler.com>"]
license = "Apache-2.0"
readme = "README.md"
homepage = "https://github.com/jaredrummler/consoul"
repository = "https://github.com/jaredrummler/consoul"
documentation = "https://consoul.goatbytes.io"
keywords = ["ai", "assistant", "terminal", "tui", "cli", "chatgpt", "claude", "langchain", "textual"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Terminals",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Typing :: Typed",
]
packages = [{include = "consoul", from = "src"}]
[tool.poetry.dependencies]
python = "^3.10"
# Core SDK dependencies
langchain = "^1.0.7"
langchain-openai = "^1.0.3"
langchain-anthropic = "^1.0.4"
langchain-google-genai = "^3.0.3"
langchain-ollama = "^1.0.0"
langchain-huggingface = "^1.0.1"
pydantic = "^2.12.4"
pydantic-settings = "^2.12.0"
python-dotenv = "^1.2.1"
pyyaml = ">=6.0.3,<7.0.0"
requests = "^2.32.5"
urllib3 = "^2.6.0" # Security fix for CVE-2025-66471, CVE-2025-66418
tiktoken = "^0.12.0"
# TUI dependencies (optional)
textual = {version = "^6.6.0", optional = true, extras = ["syntax"]}
tree-sitter-markdown = {version = "^0.5.1", optional = true} # Markdown syntax highlighting for TextArea
click = {version = "^8.3.1", optional = true}
pyperclip = {version = "^1.11.0", optional = true}
pillow = {version = "^10.0.0", optional = true}
# Feature-specific dependencies (optional)
pypdf = {version = "^6.2.0", optional = true}
beautifulsoup4 = {version = "^4.12.0", optional = true}
# HuggingFace local execution dependencies
transformers = {version = "^4.45.0", optional = true}
torch = {version = ">=2.8.0,<3.0.0", optional = true, python = "<3.14"} # Updated for CVE-2025-32434, CVE-2025-3730, CVE-2025-2953
accelerate = {version = "^1.2.0", optional = true}
bitsandbytes = {version = "^0.45.0", optional = true}
# Llama.cpp local execution (recommended for macOS)
llama-cpp-python = {version = "^0.3.0", optional = true}
# MLX local execution (Apple Silicon optimized, no PyTorch needed)
mlx-lm = {version = "^0.28.0", optional = true}
# Server dependencies (FastAPI backends with security middleware)
fastapi = {version = "^0.115.0", optional = true}
uvicorn = {version = "^0.34.0", optional = true, extras = ["standard"]}
slowapi = {version = "^0.1.9", optional = true}
redis = {version = "^5.2.0", optional = true}
arq = {version = "^0.26.0", optional = true} # Async Redis-based task queue for webhook delivery (SOUL-346)
httpx = {version = "^0.27.0", optional = true} # Async HTTP client for webhook delivery (SOUL-346)
# Observability dependencies (optional)
langsmith = {version = "^0.1", optional = true}
opentelemetry-api = {version = "^1.20", optional = true}
opentelemetry-sdk = {version = "^1.20", optional = true}
opentelemetry-exporter-otlp = {version = "^1.20", optional = true}
prometheus-client = {version = "^0.19", optional = true}
structlog = {version = "^24.4.0", optional = true}
# Code search dependencies (AST parsing and caching)
grep-ast = "^0.9.0" # AST parsing and tag extraction (used by Aider)
tree-sitter = "^0.25.2" # Tree-sitter parser core
tree-sitter-language-pack = "^0.11.0" # Multi-language parser bundle (100+ languages)
diskcache = "^5.6.3" # SQLite-backed disk caching
# Web search dependencies
duckduckgo-search = "^8.1.1" # Free web search via DuckDuckGo (zero setup)
[tool.poetry.extras]
# TUI dependencies (terminal user interface)
tui = ["textual", "tree-sitter-markdown", "click", "pyperclip", "pillow"]
# Feature-specific dependencies
pdf = ["pypdf"]
ollama-library = ["beautifulsoup4"]
# Server dependencies (FastAPI backends with security middleware)
server = ["fastapi", "uvicorn", "slowapi", "redis", "arq", "httpx"]
# Local model execution
huggingface-local = ["transformers", "torch", "accelerate"] # torch updated to 2.8+ for security fixes
huggingface-quantization = ["transformers", "torch", "accelerate", "bitsandbytes"]
llamacpp = ["llama-cpp-python"] # Recommended for local execution on macOS
mlx = ["mlx-lm"] # Apple Silicon optimized, best for M-series Macs
# Observability (production monitoring and tracing)
observability = ["langsmith", "opentelemetry-api", "opentelemetry-sdk", "opentelemetry-exporter-otlp", "prometheus-client", "structlog"]
langsmith = ["langsmith"] # LangSmith LLM tracing
otel = ["opentelemetry-api", "opentelemetry-sdk", "opentelemetry-exporter-otlp"] # OpenTelemetry distributed tracing
prometheus = ["prometheus-client"] # Prometheus metrics
logging = ["structlog"] # Structured JSON logging
# Convenience bundles
all = ["textual", "click", "pyperclip", "pillow", "pypdf", "beautifulsoup4"]
[tool.poetry.group.dev.dependencies]
pytest = "^8.4.2"
pytest-cov = "^7.0.0"
pytest-asyncio = "^1.2.0"
pytest-mock = "^3.15.1"
ruff = "^0.14.4"
mypy = "^1.18.2"
pre-commit = "^4.4.0"
attrs = "^25.4.0"
types-pyyaml = "^6.0.12.20250915"
types-requests = "^2.32.4.20250913"
types-pyperclip = "^1.9.0.20250801"
[tool.poetry.group.docs.dependencies]
mkdocs = "^1.6.1"
mkdocs-material = "^9.6.23"
mkdocs-glightbox = "^0.5.2"
mkdocstrings = {extras = ["python"], version = "^0.30.1"}
[tool.poetry.group.security.dependencies]
safety = "^3.7.0"
bandit = {extras = ["toml"], version = "^1.8.6"}
[tool.poetry.scripts]
consoul = "consoul.__main__:main"
# Pytest configuration
[tool.pytest.ini_options]
minversion = "7.4"
pythonpath = ["src"]
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"--strict-markers",
"--strict-config",
"--cov=consoul",
"--cov-report=term-missing",
"--cov-report=html",
"--cov-report=xml",
]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
"unit: marks tests as unit tests",
]
# Coverage configuration
[tool.coverage.run]
source = ["src"]
branch = true
omit = [
"*/tests/*",
"*/__pycache__/*",
"*/.venv/*",
]
[tool.coverage.report]
precision = 2
show_missing = true
skip_covered = false
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"@abstractmethod",
]
[tool.coverage.html]
directory = "htmlcov"
# Ruff configuration
[tool.ruff]
target-version = "py310"
line-length = 88
indent-width = 4
extend-exclude = [".claude"] # Exclude .claude directory from linting
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"Q", # flake8-quotes
"RUF", # Ruff-specific rules
]
ignore = [
"E501", # line too long (handled by formatter)
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # unused imports
"tests/*" = ["S101"] # use of assert
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "auto"
# Mypy configuration
[tool.mypy]
python_version = "3.10"
strict = true
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_any_generics = true
check_untyped_defs = true
no_implicit_reexport = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
follow_imports = "normal"
ignore_missing_imports = false
exclude = [
"^\\.claude/", # Exclude .claude directory from type checking
]
[[tool.mypy.overrides]]
module = [
"textual.*",
"langchain.*",
"langchain_openai.*",
"langchain_anthropic.*",
"langchain_google_genai.*",
"langchain_ollama.*",
"langchain_huggingface.*",
"pydantic.*",
"pydantic_settings.*",
"click.*",
"diskcache.*",
"grep_ast.*",
"pypdf.*",
"requests.*",
"transformers.*",
"torch.*",
"accelerate.*",
"bitsandbytes.*",
"llama_cpp.*",
# Observability optional dependencies
"prometheus_client.*",
"opentelemetry.*",
"langsmith.*",
"langchain_core.tracers.*",
# Server optional dependencies
"arq.*",
"httpx.*",
]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "consoul.tui.*"
disallow_untyped_decorators = false
disallow_subclassing_any = false
[[tool.mypy.overrides]]
module = "consoul.tui.app"
disable_error_code = ["func-returns-value"]
[[tool.mypy.overrides]]
module = "consoul.ai.tools.implementations.*"
disallow_untyped_decorators = false
[[tool.mypy.overrides]]
module = "consoul.__main__"
disallow_untyped_decorators = false
[[tool.mypy.overrides]]
module = "consoul.commands.*"
disallow_untyped_decorators = false
# Bandit security configuration
[tool.bandit]
exclude_dirs = [
"tests",
".venv",
]
skips = [
"B101", # assert_used (we use asserts in tests)
]