Metadata-Version: 2.4
Name: mira-process
Version: 0.1.0
Summary: Modular CLI and LLM tool engine for project operations
Author: Xavuye
Requires-Python: >=3.11
Description-Content-Type: text/markdown

# MIRA-ENGINE

MIRA-ENGINE is a modular Python CLI for project-aware file operations and LLM-friendly tool wrappers.

## Commands

AI-facing commands:
- `mira help` or any unknown command prints only the visible AI-facing command list instead of trying to index a path.
- `mira create` creates files or folders. Interactive file creation asks for the file description only after `CONTINUE` or after the immediate edit flow.
- `mira delete` removes files or folders after confirmation, using root-style paths for root-style input and absolute paths only for absolute input.
- `mira edit` replaces selected lines in a file, with optional explore checks and targeted comment or description updates for the affected ranges.
- `mira project` prints the project tree.
- `mira explore` analyzes a file, offers `VIEW / EDIT / EXIT / ADD OR EDIT DESCRIPTION`, and only asks for chunk comments when the full chunk range was actually viewed.
- `mira memory` and `mira plan` manage `.mira/memory.md` and `.mira/plan.md`.
- `mira terminal` runs commands through one of two persistent PowerShell-backed terminals.

Admin commands:
- `mira .` or `mira sync [path]` updates the stateful index and only reprocesses changed files.
- `mira index add <path>` and `mira index remove <path>` manage manual include or exclude rules.
- `mira history` shows the latest session activity.
- `mira diff [version] [other_version]` shows history, compares a version to the current file, or compares two versions of the same file.
- `mira restore <version>` restores a recorded version.

## LLM wrappers

Use `--llm` to wrap output in configurable tags from `mira.config.json`:

```text
<tool_use>
create
path: notes.txt
</tool_use>
<tool_response>
Created file: notes.txt
</tool_response>
```

## Chunking

Python files use AST-aware structure extraction. Other files use fallback chunking from `languages/default/analyzer.py`, targeting 80 lines with chunk boundaries selected at nearby blank lines up to 200 lines, then falling back to 100 lines when no natural boundary is found.

## Stateful Index

Running `mira .` materializes a lightweight project state under `.mira/`:

- `.mira/project.txt` stores the tracked project tree with file descriptions.
- `.mira/commands.txt` stores the command catalog with one-line descriptions.
- `.mira/files/<path>/skeleton.txt` stores the explore-style file summary.
- `.mira/versions/<path>/<version>.txt` stores the first retained snapshot for a file.
- `.mira/versions/<path>/<version>.ndiff` stores later retained revisions as independent `ndiff` payloads instead of full snapshots.

Descriptions and structure comments are manual metadata. They are added or updated through interactive `create`, `explore`, and `edit` flows instead of being autogenerated from AST docstrings or fallback heuristics. Skeleton output omits empty description, dependency, and comment metadata to keep low-noise files compact.

The sync path skips unchanged files by mtime, size, hash, and artifact presence, so rerunning `mira .` stays cheap when only a few files changed.
