Metadata-Version: 2.4
Name: dedroom
Version: 0.1.1
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Rust
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Dist: pytest ; extra == 'dev'
Requires-Dist: pytest-asyncio ; extra == 'dev'
Provides-Extra: all
Provides-Extra: dev
License-File: LICENSE
Summary: Unified agent runtime: loop detection + context compression for AI coding agents
Keywords: ai-agent,claude-code,copilot,codex,aider,cursor,cline,loop-detection,context-compression,proxy,token-savings
Author: DedrooM contributors
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: documentation, https://github.com/Devaretanmay/dedroom#readme
Project-URL: homepage, https://github.com/Devaretanmay/dedroom
Project-URL: repository, https://github.com/Devaretanmay/dedroom

# DedrooM

**Loop detection + context compression for AI coding agents.**

DedrooM sits between your AI agent (Claude Code, Codex, Aider, Cursor, Cline, OpenCode) and the LLM provider to:

- **Detect and block infinite loops** — saves wasted API calls when tools repeat
- **Compress context** — reduces token usage by 60–95% without changing behavior
- **Redact sensitive data** — strip API keys, tokens, and secrets from tool outputs
- **Track ROI** — attribution engine shows exactly how much each tool saves

## Quick Start

```bash
pip install dedroom

# Wrap an AI agent through the proxy
dedroom wrap claude         # Claude Code
dedroom wrap codex           # OpenAI Codex CLI
dedroom wrap aider           # Aider
dedroom wrap cursor          # Cursor Editor
dedroom wrap cline           # Cline (VS Code)
dedroom wrap opencode        # OpenCode
```

## Commands

| Command | Description |
|---------|-------------|
| `dedroom wrap <agent>` | Start proxy + launch agent through it |
| `dedroom unwrap <agent>` | Restore agent config to pre-wrap state |
| `dedroom doctor` | Run diagnostics (proxy, routing, savings) |
| `dedroom proxy` | Start standalone proxy server |
| `dedroom dash` | Launch the TUI dashboard |

## Python API

```python
from dedroom import DedrooM

pipeline = DedrooM("""
loop_detection:
  max_repeats: 3
""")

# Check for loops
verdict = pipeline.verify("write_file", '{"path": "/tmp/x.txt"}')
# 0 = Allow, 1 = Warn, 2 = BlockRetry, 3 = BlockHalt

# Compress content
compressed = pipeline.compress(tool_output, content_type="code")

# Full pipeline
result = pipeline.process_tool("write_file", '{}', tool_result)
print(f"Blocked: {result['is_blocked']}")
print(f"Saved {result['original_tokens'] - result['compressed_tokens']} tokens")
```

## Development

```bash
# Clone and build
git clone https://github.com/Devaretanmay/dedroom
cd dedroom
cargo build -p dedroom-cli -p dedroom-proxy

# Install Python package in dev mode
pip install -e .

# Run tests
pytest python/tests/
```

