Metadata-Version: 2.4
Name: indusagi
Version: 0.1.0
Summary: Indusagi — a terminal-first AI coding agent framework. Python rebuild.
Project-URL: Homepage, https://github.com/varunisrani/indusagi-ts
Project-URL: Repository, https://github.com/varunisrani/indusagi-ts
Project-URL: Issues, https://github.com/varunisrani/indusagi-ts/issues
Author: Varun Israni
Author-email: IndusAGI Team <team@indusagi.ai>
License-Expression: MIT
License-File: CREDITS.md
License-File: NOTICE
Keywords: agent,ai,cli,framework,llm,mcp,tui
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic>=2.7
Requires-Dist: python-ulid>=2.7
Requires-Dist: regex>=2024.4.16
Requires-Dist: wcwidth>=0.2.13
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Provides-Extra: mcp
Requires-Dist: mcp>=1.0; extra == 'mcp'
Provides-Extra: tui
Requires-Dist: markdown-it-py>=3.0; extra == 'tui'
Requires-Dist: pygments>=2.18; extra == 'tui'
Requires-Dist: textual>=0.80; extra == 'tui'
Description-Content-Type: text/markdown

# indusagi (Python rebuild)

Python rebuild of **indusagi** — a terminal-first AI coding agent framework.
Ported from the TypeScript implementation in `../indus-rebuild/` following the
conversion plan in `../indus-rebuild/PYTHON_PORT_PLAN/`.

Status: 0.1.0 — all plan milestones (M0-M8) built; 749 tests passing.
See [PARITY_REPORT.md](PARITY_REPORT.md) for the item-by-item audit against the
TypeScript build and [CHANGELOG.md](CHANGELOG.md) for the release summary.

## Layout

```
src/indusagi/
├── _internal/      # CancelToken (AbortSignal replacement), env registry
├── llmgateway/     # zero-SDK LLM provider gateway (httpx wire connectors)
├── tracing/        # observability: segments, sinks, redaction, sampling
├── runtime/        # pure-FSM agent runtime: reducer, conductor, sessions
├── capabilities/   # built-in tool suite over Fs/Shell seams
├── interop/        # MCP bridge (official `mcp` SDK)
├── connectors/     # Composio SaaS connectors
├── swarm/          # file-backed multi-agent crew layer
├── smithy/         # agent-builder meta-tool
├── shell_app/      # CLI: print / NDJSON wire / REPL runners, OAuth login
├── tui/            # terminal primitives: keys, text width, fuzzy, bindings
├── react_ink/      # Textual widgets (markdown stream, diff view, dialogs)
├── ui_bridge/      # runtime ↔ TUI projection + interactive Textual app
├── react_host/     # backend-pinning shim (TS react-host collapsed)
└── ai/ agent/ mcp/ memory.py   # compat facades (thin shims over the core)
```

## Install

Not yet on PyPI (publish pending). Install from the built wheel:

```bash
pip install dist/indusagi-0.1.0-py3-none-any.whl
```

Extras:

- `indusagi[tui]` — Textual + Pygments + markdown-it-py; required for the
  interactive terminal UI.
- `indusagi[mcp]` — official `mcp` SDK; required for `--mcp` server mounting
  and the `indusagi.interop` / `indusagi.mcp` surfaces.

```bash
pip install "dist/indusagi-0.1.0-py3-none-any.whl[mcp,tui]"
```

The core (gateway, runtime, tools, CLI print/wire modes) needs only
httpx, pydantic, wcwidth, python-ulid, and regex.

## Development

Python >= 3.11 (developed and verified on 3.13).

```bash
python3.13 -m venv .venv
.venv/bin/pip install -e ".[dev,mcp,tui]"
```

Test:

```bash
.venv/bin/pytest            # 749 tests; network-free (mock connector, respx, Textual Pilot)
```

Gates (run from the repo root; both must pass before publishing):

```bash
.venv/bin/python scripts/lineage_scan.py  # lineage gate: exits 1 if any pi-mono lineage marker survives in src/indusagi (compat shims excluded)
npx -y pyright@1.1.405                    # typecheck gate: 0 errors/0 warnings over the pyrightconfig.json ratchet scope (expand include as packages come clean)
```

Build sdist + wheel (hatchling):

```bash
.venv/bin/pip install build
.venv/bin/python -m build   # → dist/indusagi-0.1.0.tar.gz + .whl
```

The wheel ships `py.typed`, the model-catalog data
(`llmgateway/catalog/models_data.json`), the smithy knowledge pack
(`smithy/knowledge/manifest.json` + guides), and NOTICE/CREDITS under
`dist-info/licenses/`.

## Run

```bash
indusagi --help                      # usage; exit 0
indusagi --version                   # "indusagi 0.1.0"
indusagi -p "explain this repo"      # one-shot print mode to stdout
indusagi --json                      # NDJSON wire mode over stdio (for hosts)
indusagi                             # interactive TUI in a terminal (needs [tui] extra)
indusagi auth login                  # OAuth + PKCE; writes ~/.pindusagi/auth.json
indusagi auth status                 # reads this build's own auth.json
```

Flags also include `--model/-m`, `--interactive/-i`, `--cwd`, `--system`,
`--no-tools`, and repeatable `--mcp <server>` — see `indusagi --help`. With a
prompt and no TTY it answers once and exits; attended with no prompt it opens
the interactive loop.

The TUI (Textual, alternate screen) provides streaming markdown, structured
diff and tool cards, twelve dialogs (model/session/theme/login/...), footer
token/cost/context stats, Esc to abort a run and Ctrl-C to exit. API keys are
read from the usual provider env vars (e.g. `ANTHROPIC_API_KEY`); state lives
under `~/.pindusagi/` (override with `INDUSAGI_HOME`). This is the Python
build's own state directory — deliberately separate from the TypeScript
installs' `~/.indusagi`, which this build never reads or writes (owner
decision, 2026-06-10).

## Licensing

MIT. See [NOTICE](NOTICE) and [CREDITS.md](CREDITS.md) (both included in the
wheel).
