ctx / pyproject.toml
Stevesolun's picture
Add files using upload-large-folder tool
718665b verified
[build-system]
requires = ["setuptools>=77"]
build-backend = "setuptools.build_meta"
[project]
name = "claude-ctx"
version = "1.0.8"
description = "Skill and agent recommendation system for Claude Code — knowledge graph, wiki, and intake quality gates"
authors = [{ name = "Steve Solun" }]
license = "MIT"
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"markdown>=3.6,<4",
"networkx>=3,<4",
"numpy>=1.24,<3",
"plotly>=5,<7",
"pymdown-extensions>=10,<11",
"pyyaml>=6,<7",
]
[project.urls]
Homepage = "https://stevesolun.github.io/ctx/"
Repository = "https://github.com/stevesolun/ctx"
Documentation = "https://stevesolun.github.io/ctx/"
Changelog = "https://github.com/stevesolun/ctx/blob/main/CHANGELOG.md"
[project.scripts]
# Plan 001 phase R5: entrypoints for modules moved in R1-R4 now point at
# their canonical package path. Entrypoints for modules still at the
# flat layout (ctx_init, ctx_monitor, etc.) stay unchanged — they will
# move in a later R-phase. The legacy flat shims continue to exist so
# anyone invoking the CLIs via `python path/to/module.py` keeps working.
ctx-init = "ctx_init:main"
ctx-install-hooks = "ctx.adapters.claude_code.inject_hooks:main"
ctx-monitor = "ctx_monitor:main"
ctx-scan-repo = "scan_repo:main"
ctx-skill-quality = "skill_quality:main"
ctx-skill-health = "ctx.adapters.claude_code.skill_health:main"
ctx-toolbox = "toolbox:main"
ctx-lifecycle = "ctx_lifecycle:main"
ctx-skill-add = "skill_add:main"
ctx-skill-install = "ctx.adapters.claude_code.install.skill_install:main"
ctx-skill-mirror = "skill_mirror:main"
ctx-bundle-suggest = "ctx.adapters.claude_code.hooks.bundle_orchestrator:main"
ctx-recommend = "ctx.cli.recommend:main"
ctx-agent-add = "agent_add:main"
ctx-agent-mirror = "agent_mirror:main"
ctx-agent-install = "ctx.adapters.claude_code.install.agent_install:main"
ctx-harness-add = "harness_add:main"
ctx-harness-install = "harness_install:main"
ctx-mcp-add = "mcp_add:main"
ctx-mcp-fetch = "mcp_fetch:main"
ctx-mcp-ingest = "mcp_ingest:main"
ctx-mcp-enrich = "mcp_enrich:main"
ctx-mcp-install = "ctx.adapters.claude_code.install.mcp_install:install_main"
ctx-mcp-uninstall = "ctx.adapters.claude_code.install.mcp_install:uninstall_main"
ctx-mcp-quality = "mcp_quality:main"
ctx-mcp-rebuild-index = "mcp_rebuild_index:main"
ctx-wiki-graphify = "ctx.core.wiki.wiki_graphify:main"
ctx-wiki-worker = "ctx.core.wiki.wiki_queue_worker:main"
ctx-incremental-attach = "ctx.core.graph.incremental_attach:main"
ctx-incremental-shadow = "ctx.core.graph.incremental_shadow:main"
ctx-source-registry = "ctx.core.source_registry:main"
# Pre-ship dedup gate: flag entity pairs at or above the given cosine
# similarity threshold (default 0.85). Cross-type by design — finds
# duplicates across skills, agents, and MCPs in any combination.
ctx-dedup-check = "ctx.core.quality.dedup_check:main"
# Pre-ship tag-completeness gate: scan skills/agents for empty
# `tags:` frontmatter and propose backfills from slug tokens + body
# keywords + the existing tag vocabulary. Report-only by default;
# `--apply` to write.
ctx-tag-backfill = "ctx.core.quality.tag_backfill:main"
# Plan 001 phase H7: the generic harness CLI — `ctx run`,
# `ctx resume`, `ctx sessions`. Ships v1 of the model-agnostic
# harness; requires the [harness] optional dep for LiteLLM.
ctx = "ctx.cli.run:main"
# Plan 001 phase H8: standalone MCP server exposing ctx-core.
# Any MCP-aware host (Cline, Goose, Claude Code itself, Claude
# Agent SDK, custom harness) can attach this server and gain
# access to the skill/agent/MCP recommendation surface WITHOUT
# using our ``ctx run`` harness loop.
ctx-mcp-server = "ctx.mcp_server.server:main"
[project.optional-dependencies]
dev = [
"pytest>=8",
"pytest-cov>=5",
"hypothesis>=6",
"mypy>=1.8",
"ruff>=0.4",
]
browser = [
"playwright>=1.52",
]
embeddings = [
"sentence-transformers>=2,<4",
"torch>=2,<3",
]
ann = [
"hnswlib>=0.8,<0.9; platform_python_implementation == 'CPython'",
]
harness = [
# LiteLLM is the substrate for the model-agnostic harness
# (ctx.adapters.generic.providers). Every remote provider —
# OpenRouter (the tier-1 aggregator), Anthropic, OpenAI, Gemini,
# Mistral, ... — and local inference servers (Ollama, vLLM) all
# flow through a single litellm.completion() call. Keeping the
# dep optional means users who only want the Claude Code
# integration (ctx-skill-install, the hooks pipeline) don't pay
# the LiteLLM dependency-tree cost.
# LiteLLM 1.83.x pins click==8.1.8. Typer 0.17+ requires newer
# click, so cap Typer for users who install [embeddings,harness]
# together through sentence-transformers/transformers.
"click==8.1.8",
"typer>=0.16,<0.17",
"litellm>=1.40,<2",
]
[tool.setuptools]
# Incremental package-layout migration.
# During migration phases the codebase lives in TWO shapes simultaneously:
# - The legacy flat modules listed in ``py-modules`` below.
# - The target ``ctx`` package tree (ctx.core, ctx.adapters, ctx.cli,
# ctx.mcp_server, ctx.utils) declared in ``packages`` below.
# Each R-phase moves a small batch from the flat list into the package
# tree, updates imports, and drops the corresponding py-modules entry.
# Running both layouts at once is intentional — it lets the migration
# ship one commit at a time with the suite green at every step.
package-dir = {"" = "src"}
py-modules = [
"agent_add",
"agent_mirror",
"backup_config",
"backup_mirror",
"backup_retention",
"backup_watchdog",
"batch_convert",
"behavior_miner",
"catalog_builder",
"change_detector",
"corpus_cache",
"cosine_ranker",
"council_runner",
"ctx_audit_log",
"ctx_config",
"ctx_init",
"ctx_lifecycle",
"ctx_monitor",
"harness_add",
"harness_install",
"embedding_backend",
"flatten_agents",
"import_strix_skills",
"intake_gate",
"intake_pipeline",
"intent_interview",
"kpi_dashboard",
"link_conversions",
"mcp_add",
"mcp_canonical_index",
"mcp_enrich",
"mcp_entity",
"mcp_fetch",
"mcp_ingest",
"mcp_quality",
"mcp_quality_signals",
"mcp_rebuild_index",
"memory_anchor",
"scan_repo",
"skill_add",
"skill_add_detector",
"skill_category",
"skill_mirror",
"skill_quality",
"skill_telemetry",
"toolbox",
"toolbox_config",
"toolbox_hooks",
"toolbox_verdict",
"update_repo_stats",
"usage_tracker",
"versions_catalog",
"wiki_batch_entities",
"wiki_orchestrator",
"wiki_visualize",
]
# Do NOT ship the test suite to PyPI. The previous build inadvertently
# bundled src/tests/ because it was the only directory with __init__.py.
# The ``mcp_sources`` subpackage is listed here because setuptools'
# ``py-modules`` is flat-only; subpackages need an explicit ``packages``
# entry to be installed. Plan 001 (phase R0) adds the ``ctx`` tree
# alongside; both layouts coexist until R6 drops the flat modules.
packages = [
"mcp_sources",
"ctx",
"ctx.core",
"ctx.core.graph",
"ctx.core.quality",
"ctx.core.wiki",
"ctx.core.resolve",
"ctx.core.bundle",
"ctx.adapters",
"ctx.adapters.claude_code",
"ctx.adapters.claude_code.hooks",
"ctx.adapters.claude_code.install",
"ctx.adapters.generic",
"ctx.adapters.generic.providers",
"ctx.adapters.generic.tools",
"ctx.cli",
"ctx.mcp_server",
"ctx.utils",
]
[tool.setuptools.package-data]
ctx = ["config.json", "skill-registry.json"]
[tool.pytest.ini_options]
testpaths = ["src/tests"]
markers = [
"integration: marks tests that require external models or network (deselect with -m 'not integration')",
"browser: marks tests that drive a real browser with Playwright",
]
[tool.mypy]
python_version = "3.11"
mypy_path = "src"
namespace_packages = true
explicit_package_bases = true
ignore_missing_imports = true
[tool.ruff]
line-length = 100
target-version = "py311"