Metadata-Version: 2.4
Name: rungent
Version: 0.1.0
Summary: A small, typed agent runtime for Python applications
Project-URL: Homepage, https://github.com/rungent/rungent
Project-URL: Documentation, https://github.com/rungent/rungent/tree/main/docs
Project-URL: Repository, https://github.com/rungent/rungent
Project-URL: Issues, https://github.com/rungent/rungent/issues
Project-URL: Changelog, https://github.com/rungent/rungent/releases
Author: Rungent Contributors
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: agent,fastapi,llm,sse,tool-calling
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: httpx>=0.28.0
Requires-Dist: pydantic>=2.10.0
Provides-Extra: dev
Requires-Dist: aiosqlite>=0.20.0; extra == 'dev'
Requires-Dist: fastapi>=0.115.0; extra == 'dev'
Requires-Dist: pyright>=1.1.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
Requires-Dist: pytest>=8.3.0; extra == 'dev'
Requires-Dist: ruff>=0.8.0; extra == 'dev'
Requires-Dist: sqlalchemy[asyncio]>=2.0.36; extra == 'dev'
Provides-Extra: fastapi
Requires-Dist: fastapi>=0.115.0; extra == 'fastapi'
Provides-Extra: sqlalchemy
Requires-Dist: sqlalchemy[asyncio]>=2.0.36; extra == 'sqlalchemy'
Description-Content-Type: text/markdown

# Rungent

Rungent is a small, typed agent runtime that embeds into an existing Python application. It
standardizes tool calling, the harness loop, durable sessions and runs, user interactions,
deterministic approval gates, and an SSE event protocol.

Its headless activity protocol exposes model steps, safe public progress, tools, and interactions as
persisted events. It never exposes raw provider reasoning or hidden chain of thought.

```python
from typing import Annotated

from rungent import Agent, RunActivity, Runtime, ToolContext, ToolResult, tool
from rungent.llm import OpenAICompatibleModel
from rungent.store import MemoryStore


@tool(effect="write", approval="never")
async def move_place(
    ctx: ToolContext,
    name: Annotated[str, "Exact place name"],
    day_number: Annotated[int | None, "Target day; null means unplanned"],
) -> ToolResult:
    await ctx.deps["trips"].move(ctx.resource["trip_id"], name, day_number)
    return ToolResult(message=f"Moved {name}")


agent = Agent(
    name="trip_planner",
    instructions="Help the user update their trip. Use tools for every change.",
    tools=[move_place],
    run_activity=lambda _ctx, _content: RunActivity(
        message="Received the request",
        waiting_message="Still preparing; no changes have been made",
        long_wait_message="The request is detailed; still preparing",
        continuation_message="Preparing the result",
    ),
)

runtime = Runtime(
    agents=[agent],
    model=OpenAICompatibleModel.from_env(),
    store=MemoryStore(),
)
```

The canonical documentation lives in `docs/` and is rendered by the Fumadocs app in `apps/docs`.
AI coding agents should start with [`RUNGENT.md`](RUNGENT.md); the running site also exposes
`/llms.txt`, `/llms-full.txt`, and per-page raw Markdown under `/markdown/*`.

## Development

```bash
uv sync --all-extras
uv run pytest -W error
uv run ruff check src tests

pnpm install
pnpm dev:docs
pnpm test
pnpm build
```

## Release

`rungent` (PyPI) and `@rungent/sdk` (npm) share one semver. Publishing is done by GitHub Actions
on `v*` tags — do not `uv publish` / `npm publish` from your laptop.

```bash
./scripts/release.sh 0.2.0
git push origin main --tags
```

One-time Trusted Publishing setup: see [`RELEASING.md`](RELEASING.md).
