Metadata-Version: 2.4
Name: zeno-local
Version: 0.1.3
Summary: Local companion daemon that exposes your installed humex to the zeno cloud UI (zeno's ?mode=local).
Author: The Zeroth Law
License-Expression: Apache-2.0
Project-URL: Homepage, https://zerothlaw.io
Keywords: zeno,humex,autonomous-vehicle,scenario,metrics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: humex>=0.2.2
Requires-Dist: click>=8
Dynamic: license-file

# zeno-local

A small local companion daemon for the **zeno** cloud UI. It imports the
**humex** library you've installed and exposes it over a loopback HTTP server
(the Zeno Compute Protocol) so the cloud-hosted zeno SPA can run
simulate / evaluate / import / export against *your* local humex — including any
custom monitors, operators, or converters you've installed.

`humex` stays a pure library (it does not serve). `zeno-local` is the process
that owns the server.

## Install

```bash
pip install zeno-local      # installs into the same env as your humex
```

`humex` is a dependency, so it comes along — but if you want to use *your own*
(modified / customized) humex, install it in the same environment first, or
`pip install -e` your humex checkout there.

## Run

Quick start from a checkout (sets up a venv, installs zeno-local + humex, runs):

```bash
scripts/start.sh                 # http://127.0.0.1:8900
PORT=9100 scripts/start.sh       # different port
VENV=../zeno/.venv scripts/start.sh   # reuse an existing venv (and its converters)
```

Or run the installed CLI directly:

```bash
zeno-local                                   # http://127.0.0.1:8900
zeno-local --port 9100 --cors-origin https://zeno.dev.zerothlaw.io
```

Then open zeno with `?mode=local` (and `?localUrl=` if you changed the
host/port). zeno's "compute source" selector will route everything through this
server instead of the in-browser Pyodide runtime.

## Browser support

An HTTPS-deployed zeno reaching `http://localhost` works in **Chrome** and
**Firefox** (loopback mixed-content exemption + Chrome Private Network Access
headers are handled). **Safari blocks it** — use Chrome/Firefox, or run zeno over
`http://localhost` too.

## Endpoints (Zeno Compute Protocol, v1)

`GET /health` · `POST /parse-yaml` · `POST /test-dag` · `POST /import-package`
(raw `.hpkg` bytes) · `POST /run-simulation` · `POST /evaluate-metrics` ·
`POST /build-hpkg`. Per-tab state is keyed by the `X-Humex-Session` header.

> Roadmap: filesystem endpoints (`/fs/*`) and converter endpoints
> (`/converters`, `/convert`) so the UI can browse local dataset directories,
> run native converters, and write outputs back to disk — the capabilities the
> in-browser runtime fundamentally can't provide.
