semvec/pypi-packages huggingface dataset:
process-watchman 0.2.0
A small, focused Python library for tracking Linux process trees rooted at a specific PID.
License: MIT
Requires Python: >=3.10

# process-watchman

**process-watchman** is a small, focused Python library for tracking Linux process trees rooted at a specific PID.

It answers questions like:
- Which subprocesses are currently alive?
- Which processes exited since the last poll?
- Is the root process still valid (PID reuse safe)?
- What is the current live descendant set?

---

## Why process-watchman?

Workflow monitoring often fails because:
- parent wrappers exit while compute children keep running
- PIDs get reused
- process discovery is unreliable across polling intervals

process-watchman solves this by:
- tracking process identity as `(pid + create_time)`
- maintaining a live descendant set
- emitting clean deltas (added / removed processes)

---

## Installation

```bash
pip install process-watchman
```

For development:

```bash
git clone https://github.com/ATTMOS/process-watchman.git
cd process-watchman
pip install -e ".[dev]"
```

---

## Quick start

```python
from process_watchman import ProcessTreeWatcher, WatcherConfig

# Attach to a running process by PID
watcher = ProcessTreeWatcher.attach(root_pid=12345)

# Poll the process tree
snapshot = watcher.poll()

print(f"Root alive: {snapshot.root_alive}")
print(f"Descendants: {len(snapshot.processes)}")
print(f"New PIDs: {snapshot.delta.added_pids}")

# Poll again later to see what changed
snapshot2 = watcher.poll()
print(f"Added: {snapshot2.delta.added_pids}")
print(f"Removed: {snapshot2.delta.removed_pids}")

# Get the current live set at any time
live = watcher.live_pids()
```

---

## Configuration

Pass a `WatcherConfig` to customize behaviour:

```python
from process_watchman import ProcessTreeWatcher, WatcherConfig

cfg = WatcherConfig(
    max_depth=8,              # limit tree traversal depth
    include_root=True,        # include the root process in results
    max_descendants=1000,     # cap collected descendants per poll
    strategy="scan_ppid",     # use BFS fallback instead of default
    capture_cmdline=True,     # collect command lines
    cmdline_max_chars=100,    # truncate long command lines
    keep_tombstones=True,     # retain info for removed processes
)

watcher = ProcessTreeWatcher.attach(root_pid=12345, config=cfg)
```

See [docs/api.md](docs/api.md) for the full list of configuration options.

---

## API overview

| Type | Description |
|------|-------------|
| `ProcessTreeWatcher` | Main class — `attach()`, `poll()`, `live_pids()` |
| `WatcherConfig` | Configuration with sensible defaults |
| `Snapshot` | Point-in-time observation returned by `poll()` |
| `Delta` | Changes between consecutive polls |
| `ProcessIdentity` | PID + create_time (safe against PID reuse) |
| `ProcessInfo` | Per-process metadata (name, cmdline, status) |

Full API reference: [docs/api.md](docs/api.md)

---

## License

MIT
repo-lens 0.1.3
A powerful Git-aware repository assistant powered by LiteLLM and smolagents.
License: MIT
Requires Python: >=3.11
Keywords: git, ai, agent, llm, codebase, smolagents

# 👁️ repo-lens

**Your repository's third eye.** 

Forget manually digging through git logs and grepping for context. `repo-lens` combines deep Git history analysis with advanced AI reasoning to give you instant clarity on your codebase. Whether you're hunting for the origin of a bug or summarizing years of commits, `repo-lens` sees what you might miss.

Powered by **smolagents** for iterative reasoning and **LiteLLM** for universal model support (OpenAI, Anthropic, Ollama, Qwen, and more).

---

### 🛠️ Prerequisites

Before you start peering into your repos, ensure you have:
- **Python 3.11** or higher.
- **Git** installed and available in your PATH.
- Access to an LLM provider:
    - **Cloud**: OpenAI, Anthropic, etc. (API Key required).
    - **Local**: LM Studio, Ollama, or vLLM (OpenAI-compatible server running).

---

### 🚀 Installation

Install `repo-lens` directly from this repository for the latest features:

```bash
# Using uv (recommended)
uv tool install repo-lens

# Using pip
pip install repo-lens
```

To build from source:
```bash
git clone https://github.com/satishjasthi/repo-lens.git
cd repo-lens
uv sync
```

---

### ⚙️ Getting Started

`repo-lens` is configured via environment variables or a `.env` file in your current directory.

Create a `.env` file:
```ini
# LLM Configuration
REPO_LENS_PROVIDER=openai               # openai, anthropic, ollama, etc.
REPO_LENS_MODEL=openai/gpt-oss-20b      # Your model identifier
REPO_LENS_API_BASE=http://localhost:1234/v1  # Base URL for local SLMs
REPO_LENS_API_KEY=sk-...                # Your API key (if needed)

# Repo Settings
REPO_LENS_REPO=/path/to/your/repo        # Optional defaults to current dir
REPO_LENS_TIMEOUT=60                     # HTTP timeout
```

---

### 🤖 Running the Agent

#### The `agent` command (Iterative Reasoning)
The `agent` command is the powerhouse of `repo-lens`. It doesn't just guess; it **reasons**. It plans Git commands, observes the results, and refines its search until it finds the answer.

```bash
repo-lens agent "Who added the bedrock support and what files did they change?"
```

#### The `ask` command (Quick Context)
For simple questions based on the recent history and current state:

```bash
repo-lens ask "Summarize the changes in the last 5 commits"
```

#### Thin Git Wrappers
`repo-lens` also includes thin wrappers for common Git tasks:
```bash
repo-lens git status
repo-lens git log --limit 5
repo-lens shell "ls -la"
```

---

### 📦 PyPI Publishing

Built with `uv`, `repo-lens` is ready for the world. To publish your own version:

1. Update `pyproject.toml` with your details.
2. Build the package:
   ```bash
   uv build
   ```
3. Publish to PyPI:
   ```bash
   uv publish
   ```

---

**Author:** [Satish Jasthi](https://github.com/satishjasthi)  
**License:** MIT