Metadata-Version: 2.4
Name: inact
Version: 0.1.0
Summary: AI-oriented web framework built on Flask
Project-URL: Repository, https://github.com/EvoEvolver/inact
Author-email: Zijian Zhang <78zaz003@gmail.com>
License: Copyright 2026 Zijian Zhang
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        
License-File: LICENSE
Requires-Python: >=3.11
Requires-Dist: flask>=3.0
Requires-Dist: markdown>=3.5
Requires-Dist: pyyaml>=6.0
Requires-Dist: tomli-w>=1.0
Description-Content-Type: text/markdown

# inact

AI-oriented web framework built on Flask. Every route returns plain text by default (curl/agent-friendly), with automatic HTML rendering at `/_human/<path>` for humans.

## Install

```bash
pip install inact
```

## Quick start

```python
from inact import Inact, MdContent, TomlContent

app = Inact(__name__)

@app.inact_md("/")
def index():
    return MdContent("# Hello\n\nThis is an agent-friendly page.", title="Home")

@app.inact_toml("/status")
def status():
    return TomlContent({"service": {"status": "running"}}, annotation="GET /status")

app.mount("/docs", "./docs/")

app.run()
```

## Features

- **`inact_md`** — Markdown + frontmatter routes. Plain text for agents, rendered HTML at `/_human/<path>`.
- **`inact_toml`** — TOML routes with optional `# annotation` lines at the top.
- **`/_human/<path>`** — Auto-registered HTML rendering for every route and mounted file.
- **`/.help`** — Contextual help on every path, inherited from nearest ancestor if not defined.
- **`mount(prefix, folder)`** — Serve a local folder with `/.ls` (file listing) and `/.grep?q=` (content search).

## Response types

| Handler returns | Agent sees | Human sees (`/_human/`) |
|---|---|---|
| `MdContent(body, **meta)` | plain markdown | rendered HTML |
| `TomlContent(data, annotation=...)` | TOML with `# comment` header | structured HTML |
| raw `str` | string as-is | detected and rendered |

## License

MIT
