BSD Ports

ai/lean-ctx 3.11.4 MidnightBSD

Hybrid Context Optimizer: MCP Server, reduces LLM token consumption

System
MidnightBSD
Repository
mports
Maintainer
[email protected]
Last update
Commit
be77d896fe
License
Apache-2.0
Categories
ai

Description

LeanCTX is a hybrid context optimizer designed to reduce token consumption in AI-assisted software engineering workflows. It acts as a cognitive filter between AI tools and Large Language Models (LLMs), stripping noise like comments and whitespace to lower costs and maximize context efficiency.

Features:

  • AST-Aware Compression: Uses Tree-sitter to parse 14 languages, preserving critical types and logic while reducing token counts by up to 90%.
  • MCP Server Integration: Provides 24 tools that replace standard file reads with compressed alternatives for any MCP-enabled AI client.
  • Automated Shell Hook: Intercepts and compresses output from over 90 common command patterns (git, npm, cargo, docker, kubectl, etc.).
  • Privacy and Performance: Single Rust binary with zero dependencies and no cloud requirements.

In the other systems

SystemPortVersion
MidnightBSDai/lean-ctx3.11.4
FreeBSDmisc/lean-ctx3.11.4_1
HardenedBSDmisc/lean-ctx3.10.5.146
GhostBSDmisc/lean-ctx3.8.11_2

Install

Binary package:

mport install lean-ctx

From mports:

cd /usr/mports/ai/lean-ctx && make install clean

To depend on this port in another port's Makefile:

RUN_DEPENDS=	lean-ctx>0:ai/lean-ctx

Dependencies

As this port's Makefile names them.

Build 1

Library 1

Build dependencies 2
Run dependencies 1

No port depends on this one.

Configuration

No options to configure.

USES
cargo
Service scripts
lean-ctx

Files

distinfo 585
FileSizeSHA256
rust/crates/adler2-2.0.1.crate13366320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa
rust/crates/adobe-cmap-parser-0.4.1.crate3841ae8abfa9a4688de8fc9f42b3f013b6fffec18ed8a554f5f113577e0b9b3212a3
rust/crates/aead-0.5.2.crate15509d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0
rust/crates/aes-0.8.4.crate124812b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0
rust/crates/aes-0.9.2.crate112494f8eb277bec05f56a0e0591f155a484cbd0f4f07ff2905051a48c72f004f7ed58
rust/crates/ahash-0.8.12.crate434135a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75
rust/crates/aho-corasick-1.1.5.crate184315c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba
rust/crates/alloca-0.4.0.crate4257e5a7d05ea6aea7e9e64d25b9156ba2fee3fdd659e34e41063cd2fc7cd020d7f4
rust/crates/allocator-api2-0.2.21.crate63622683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923
rust/crates/android_system_properties-0.1.6.crate5625ae221649c9976a6f6c56ae1facf410f3ddb33cc661c4b7b61020a912d4237fbc
rust/crates/anes-0.1.6.crate238574b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299
rust/crates/anstream-1.0.0.crate28916824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d
rust/crates/anstyle-1.0.14.crate17787940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000
rust/crates/anstyle-parse-1.0.0.crate2204252ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e
rust/crates/anstyle-query-1.1.5.crate1026440c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc
rust/crates/anstyle-wincon-3.0.11.crate12638291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d
rust/crates/anyhow-1.0.104.crate48819330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470
rust/crates/argon2-0.5.3.crate287953c3610892ee6e0cbce8ae2700349fcf8f98adb0dbfbee85aec3c9179d29cc072
rust/crates/arrayref-0.3.9.crate918676a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb
rust/crates/arrayvec-0.7.8.crate33260d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56

Commit history 2

DateCommitCreditsLog message
be77d896fe Lucas Holt ai/lean-ctx: update to 3.11.4 (#1870)
## Summary - Update lean-ctx 3.6.9 → 3.11.4; regenerate `CARGO_CRATES` / distinfo - Correct `LICENSE` from `mit` to `Apache-2.0` (upstream `LICENSE` and `Cargo.toml` are Apache-2.0, already true at 3.6.9) - Add FreeBSD's `ort` crate patch so `libonnxruntime.so` is the default on `target_os = "freebsd"` (build otherwise fails with E0004 non-exhaustive match) - Set `NO_TEST`: upstream `proxy_autostart.rs` tests are gated on `cfg(unix)` but use helpers only compiled on macOS/Linux, so `cargo test` fails to compile FreeBSD's `patch-src_core_engine__artifact_unix.rs` was intentionally not imported: it isn't needed for 3.11.4 to build, and it hard-codes syscall 602 (renameat2), which exists only on FreeBSD 15+. ## Testing (amd64, master) …
dee1e47e52 Lucas Holt ai: add new category and move AI/ML ports from misc
Create the ai category (Artificial intelligence and machine learning) and relocate 42 AI/ML ports from misc into it. - Register ai in Mk/bsd.mport.mk VALID_CATEGORIES and the top-level Makefile - Add ai/Makefile; drop the moved entries from misc/Makefile (also removes the stale linux-claude SUBDIR left over from the claude-code rename) - git mv 42 ports and set their primary CATEGORIES to ai - Rewrite misc/<port> dependency origins to ai/<port> in external dependents (devel/py-beartype, math/py-faiss, multimedia/py-torchcodec, textproc/py-tokenizers) and among the moved ports themselves - Record the origin migrations in MOVED Ports moved: chatgpt-shell-cli, claude-code, claude-code-legacy, clawhub, codex, gemini-cli, github-copilot-cli, grok-cli, lean-ctx, llama-cpp, ollama, …