Metadata-Version: 2.4
Name: rastion
Version: 0.1.2
Summary: Local-first portable decision plugins and solver plugins
Author: rastion contributors
License: Apache-2.0
License-File: LICENSE
Requires-Python: >=3.11
Requires-Dist: httpx>=0.27
Requires-Dist: numpy>=1.24
Requires-Dist: pydantic>=2.6
Requires-Dist: pyyaml>=6.0
Provides-Extra: all
Requires-Dist: dwave-neal>=0.6; extra == 'all'
Requires-Dist: highspy>=1.7; extra == 'all'
Requires-Dist: ortools>=9.10; extra == 'all'
Requires-Dist: pyscipopt>=5.0; extra == 'all'
Requires-Dist: pytest>=8.0; extra == 'all'
Requires-Dist: qiskit-algorithms>=0.3; extra == 'all'
Requires-Dist: qiskit>=0.45; extra == 'all'
Requires-Dist: ruff>=0.6; extra == 'all'
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Provides-Extra: highs
Requires-Dist: highspy>=1.7; extra == 'highs'
Provides-Extra: neal
Requires-Dist: dwave-neal>=0.6; extra == 'neal'
Provides-Extra: ortools
Requires-Dist: ortools>=9.10; extra == 'ortools'
Provides-Extra: qaoa
Requires-Dist: qiskit-algorithms>=0.3; extra == 'qaoa'
Requires-Dist: qiskit>=0.45; extra == 'qaoa'
Provides-Extra: qiskit
Requires-Dist: qiskit-algorithms>=0.3; extra == 'qiskit'
Requires-Dist: qiskit>=0.45; extra == 'qiskit'
Provides-Extra: scip
Requires-Dist: pyscipopt>=5.0; extra == 'scip'
Description-Content-Type: text/markdown

<p align="center">
  <img src="assets/owl-favicon.png" alt="Rastion owl logo" width="96" />
</p>

# Rastion

Local-first optimization lab for decision plugins.

## MVP Scope

- Core MVP is local-first: model, run, and inspect decision plugins on your own machine.
- Hub/community features are optional and can be added after local workflow is stable.
- User-facing artifact is the decision plugin (`spec.json` + `instances/` + metadata/card).

[![PyPI version](https://img.shields.io/pypi/v/rastion.svg)](https://pypi.org/project/rastion/)
[![Python versions](https://img.shields.io/pypi/pyversions/rastion.svg)](https://pypi.org/project/rastion/)
[![License](https://img.shields.io/pypi/l/rastion.svg)](LICENSE)

## Install

Latest release:

```bash
pip install rastion
```

Run the app:

```bash
rastion
```

## Agent-First Quickstart

Scaffold a Codex-friendly workspace:

```bash
rastion init-agent --path .
```

This creates:
- `AGENTS.md` with a local-first optimization workflow policy.
- `decision_plugins/calendar_week_off/` starter files (half-day model).
- `decision_plugins/calendar_week_off_30m/` starter files (30-minute slots + fixed meeting blackout).
- `agent_requests/*.json` structured requests for `rastion agent-run`.

Then run the starter template:

```bash
export RASTION_HOME=.rastion-home
rastion init-registry
rastion agent-run ./agent_requests/calendar_week_off_30m.json
```

To allow agent-orchestrated solver download fallback (trusted URL list in request JSON):

```bash
rastion agent-run ./agent_requests/calendar_week_off_30m_remote_solver.json
```

## Talk To Your Optimization Lab

Use this prompt shape with your coding agent:

```text
Convert this request into a Rastion decision plugin.
Goal: <what outcome you want>
Hard constraints: <must hold>
Soft preferences: <nice to have>
Horizon: <time window>
Timezone: <timezone>
Return: decision_plugins/<name>/spec.json, instances/default.json, and an agent_request JSON.
```

Then run:

```bash
rastion plugin install ./decision_plugins/<name> --overwrite
rastion info --verbose <name> default
rastion solve <name> default --solver auto --time-limit 30
```

Inspect state deterministically:

```bash
rastion plugin list --json
rastion plugin dev-list --path ./decision_plugins --json
rastion plugin status <name> --path ./decision_plugins --json
rastion runs list --json
```

## Decision Plugin Workflow

Install a local plugin folder into your registry:

```bash
rastion plugin install ./decision_plugins/calendar_week_off_30m --overwrite
```

List installed plugins:

```bash
rastion plugin list
```

List local workspace plugins (not yet installed):

```bash
rastion plugin dev-list --path ./decision_plugins
```

View run history:

```bash
rastion runs list
```

Push a plugin to Rastion Hub:

```bash
rastion login
rastion plugin push ./decision_plugins/calendar_week_off_30m
```

Search and pull from Rastion Hub:

```bash
rastion plugin search calendar
rastion plugin pull calendar_week_off_30m --overwrite
```
