Metadata-Version: 2.4
Name: zmos
Version: 0.0.1.1
Summary: ZMOS 2.0 — the Z-Mall Operating System · an offline, generative terminal OS
Author: Z-Mall Incorporated
License: MIT
Project-URL: Homepage, https://pypi.org/project/zmos/
Project-URL: Documentation, https://pypi.org/project/zmos/
Keywords: terminal,tui,operating-system,z-mall,offline,generative,worldbuilding,simulation,sandbox,images,formats,filesystem,local-ai,llama.cpp
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Desktop Environment
Classifier: Topic :: Terminals
Classifier: Topic :: Education
Classifier: Topic :: Multimedia :: Graphics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == "dev"
Provides-Extra: images
Requires-Dist: Pillow>=10.0; extra == "images"
Dynamic: license-file

# ZMOS · Aurora · 0.0.1.1

**Z-Mall Operating System** — an offline, generative terminal operating system
published by **Z-Mall Incorporated**, Offline Systems Division.

ZMOS is the official 2.0 edition successor to the RootOS starting study. This
PyPI package is version **0.0.1.1**. It keeps the same closed, seeded engine and
grows it into a complete operating-system standard: a formal shell vocabulary,
a 500+ extension file-format catalogue, a much larger procedural image engine,
real media codecs, complete office and archive formats, and a calm,
Macintosh-inspired interface.

```text
        ▛Z▟  ZMOS · AURORA · 0.0.1.1
             an offline operating system · Z-Mall Incorporated
```

---

## Install

ZMOS is dependency-free. Python 3.10+ is the only requirement.

```bash
python3 -m pip install --user zmos
zmos
```

From a checkout:

```bash
git clone <your-repository> ZMOS
cd ZMOS
python3 -m pip install -e .
zmos
```

Optional extras:

```bash
python3 -m pip install "zmos[images]"   # Pillow for extra web-image handling
python3 -m pip install "zmos[dev]"      # build tooling
```

Entry points: `zmos`, `zm`, `zmall`, `zs`, and `zmos-local-ai`.

---

## First run

```
zmos                 # interactive desktop shell, with the Z-Mall intro splash
zmos splash          # print the intro page and exit
zmos --no-splash     # skip the intro
zmos world           # list the generated networks
zmos scan all --fast # live-scan every network
zmos enter oracle-01 # inhabit a machine
zmos gen all --count 4
zmos formats --all
```

The first run creates `$ZMOS_HOME` (default `~/.local/share/zmos`) with a
sandboxed `workspace/`, `state.json`, `secret.json` (mode 0600) and an
`exports/` directory. Set `ZMOS_HOME` to use another root. Legacy RootOS
directories are not used by default.

---

## The intro splash

The splash is the Z-Mall Incorporated identity screen. It is Macintosh-quiet:
traffic-light dots, a large rounded mark, the wordmark, the release name and a
short boot sequence.

- `splash` — print it
- `splash --save /drop/splash.txt` — save a copy
- `settings splash false` — disable it
- `zmos --splash-only` — print it and exit

The splash names **Z-Mall Incorporated** explicitly and never depends on a
network connection.

---

## Empty Enter · Diction: code

Press **Enter on an empty prompt** and ZMOS prints a quiet Diction: code line
in the style of MProcs' `diction: code`:

```text
&  アカネ  Locations  Quiet  Ember  2026-11-29 18:07:56
```

The code vocabulary contains **10,000 words** from the bundled
`diction_code.txt`; `diction theme` uses the Z-Mall generative vocabulary
instead. The generator is theme-aware and stays inside the active palette.

```bash
diction                 # one line
diction code            # 10,000-word code vocabulary
diction theme           # Z-Mall theme vocabulary
diction count           # vocabulary sizes and empty-input state
diction list            # sample words
diction off             # disable empty-Enter generation
diction on
```

`settings empty_input off` does the same as `diction off`.

---

## nano

ZMOS includes a small full-screen nano-style editor:

```bash
nano /notes/todo.md
nano /net/willow-row/pocket-aster/etc/motd --read-only
nano --help
```

Keys: `Ctrl-O` write, `Ctrl-X` exit, `Ctrl-W` search, `Ctrl-K` cut,
`Ctrl-U` uncut, `Ctrl-G` help, `Ctrl-C` position, `Ctrl-L` refresh, arrows /
Home / End / PgUp / PgDn to move. On a pipe or non-interactive terminal,
`nano` points you at `edit`, `write` or `append` instead of hanging.

---

## Scrollback

The shell keeps its own transcript, so long output stays reachable even in
terminals that send Page Up / Page Down to the application (or not at all).

- **PgUp** opens the scrollback pager one page back; press it again to keep
  going.
- Inside: **PgUp/PgDn** page, **↑/↓** one line, **Home/End** oldest/newest,
  `q` / `Esc` / `Enter` to return.
- **PgDn** at the prompt returns to a stored view, and does nothing when you
  are already at the newest page.
- The line you were typing is restored after the pager closes.

---

## Updates

ZMOS checks PyPI once per day at startup. Disable that quiet notice with
`settings update_check false` or `ZMOS_NO_UPDATE_CHECK=1`. Running `zmos update`
always performs a fresh check.

```bash
zmos update                                  # check now and offer the upgrade
zmos update --check                          # check only, no prompt, no install
zmos update --yes
zmos update --yes --restart
zmos update --yes --break-system-packages   # PEP 668 / permission fallback
zmos restart
```

The updater first runs a normal `pip install --upgrade zmos`. If pip reports
an externally managed environment or a permission failure, it retries with
`--user --break-system-packages`. `--restart` replaces the process with a
fresh `python -m zmos`.

---

## The interface

The visual language is inspired by classic and modern Macintosh:

- quiet neutral space with one strong accent;
- glass panels and rounded **windows** with traffic-light controls;
- a top **menu bar** and a bottom **dock**;
- a flat, direct command vocabulary;
- graceful degradation to ASCII and `NO_COLOR`.

Themes: `aqua` (default), `graphite`, `midnight`, `starlight`, `rose`, `mint`,
`sky`, `sunset`, plus the original RootOS palettes `phosphor`, `amber`, `ice`,
`violet`, `red` and `mono`. Use `theme <name>` or `zmos --theme <name>`.

---

## The world

The world is deterministic from a seed:

- networks use RFC 5737 / RFC 3849 documentation space and private ranges;
- hosts are fictional "glass" computers with services, users, shares and
  synthetic signals;
- ordinary people and their personal devices are generated alongside
  infrastructure;
- scanning and access are live simulations; no socket is opened.

Nothing generated is real. Only `scour`, `fetch` and a configured AI provider
open network connections, and each of those is an explicit opt-in.

---

## Generation

`gen` writes a complete, unique file. The catalogue is deliberately broad:

```bash
gen doc --count 3
gen python --size large
gen image --size large --style macwall
gen wallpaper --size wallpaper --style aurora
gen poster --size poster --style mesh
gen gif --size small --frames 18
gen audio --size small
gen model --size tiny
gen font --size tiny
gen diagram --size tiny
gen map --size tiny
gen office --size small
gen pcap --size small
gen all --count 6
```

Useful flags:

| flag | meaning |
| --- | --- |
| `--count N` | generate up to 24 files |
| `--size BAND` | `tiny small medium large huge epic colossal` |
| `--size PRESET` | `thumb tiny small medium large huge epic poster portrait square panorama banner wallpaper ultrawide retina billboard mural` |
| `--style NAME` | a procedural image style |
| `--quality Q` | `draft standard high ultra` |
| `--frames N` | animated GIF frames (2–48) |
| `--host HOST` | write into a generated machine |
| `--dir DIR` | choose the destination directory |
| `--online` | optional AI text (never images) |
| `--format NAME` | choose an HTML page format |
| `--json` | machine-readable result |

`gen types` lists every family. `formats --all` lists every extension.

---

## Complete format catalogue

ZMOS recognises 500+ file extensions and ships generators for more than 130
families. Highlights:

### Images and media

PNG · PPM · BMP · GIF (animated) · JPEG (baseline) · TIFF · TGA · QOI ·
farbfeld · PAM · PGM · PBM · XPM · XBM · ICO · ICNS · SVG · WAV · AIFF · MIDI

All image writers are pure Python. GIF uses a median-cut palette and a real
LZW stream. JPEG uses standard tables and a baseline encoder. TIFF, TGA, QOI,
farbfeld, PNM, XPM/XBM and ICO/ICNS are complete and open with ordinary tools.

### Documents and office

PDF · DOCX · XLSX · PPTX · ODT · ODS · ODP · EPUB · RTF · LaTeX · Markdown ·
reStructuredText · AsciiDoc · Org · Typst · Jupyter notebook

### Data, configuration and databases

JSON · JSONL/NDJSON · YAML · TOML · CSV · TSV · XML · RSS · Atom · SQLite ·
INI · properties · systemd units · Terraform · HCL · Nix · KDL · desktop entries

### Code

Python · JavaScript/TypeScript · Go · Rust · C/C++ · Java · Ruby · Lua · PHP ·
Kotlin · Swift · shell · PowerShell · batch · SQL · GraphQL · Protocol Buffers ·
Vue · Svelte · notebooks and more.

### Security and operations

YARA/Sigma-style rules · PEM/key/certificate material · real libpcap captures ·
HAR archives · incident reports · postmortems · threat models · runbooks ·
forensics timelines · chain-of-custody records · compliance maps.

### Structured extras

OBJ · STL · glTF · BDF bitmap fonts · SRT/VTT subtitles · LRC lyrics ·
GPX · KML · GeoJSON · BibTeX · RIS · Mermaid · PlantUML · draw.io ·
Excalidraw · Makefile · CMake · Dockerfile · Nix expressions.

---

## The image engine

40 procedural styles, 17 size presets, four quality levels and 17 codecs.

Styles include:

```text
signal glitch circuit bloom topography void dream pressure lattice weather
aurora dunes ocean forest skyline nebula coral glacier blossom rain snow
desert sunset monochrome blueprint macwall mesh glass ribbon tide ember
minimal gradient halftone stainedglass paper fractal rings waves horizon
```

Large images render at a detail-capped internal resolution and are smoothly
upscaled, so 4K/5K wallpapers and billboards remain practical on CPU-only
machines.

```bash
media                 # engine summary
media styles          # every style
media presets         # every size preset
gallery               # visual index
image /gallery/x.png  # render in the terminal
```

---

## Local AI (optional, offline)

ZMOS can download and run a small llama.cpp model locally. No key is needed
and local tokens are free. The chosen model is the default: ZMOS no longer
silently switches models based on RAM unless you explicitly ask for `auto`.

```bash
ai local models                 # catalogue, selected model, server + installed models
ai local choose llama-3.2-1b-instruct
ai local start                  # uses the selected model
ai local wait 300               # wait for download/load
ai test                         # confirm it replies
ai local status
ai local stop
```

Catalogue:

| model | size | min RAM | note |
| --- | --- | --- | --- |
| `llama-3.2-1b-instruct` | ~850 MB | ~1.2 GB | default · balanced CPU model |
| `qwen2.5-0.5b-instruct` | ~420 MB | ~800 MB | smallest · phones |
| `qwen2.5-1.5b-instruct` | ~1.1 GB | ~1.6 GB | stronger writing |
| `deepseek-r1-distill-qwen-1.5b` | ~1.1 GB | ~1.8 GB | reasoning |
| `llama-3.2-3b-instruct` | ~2.1 GB | ~3 GB | larger |
| `phi-3.5-mini-instruct` | ~2.4 GB | ~3.4 GB | technical prose |
| `mistral-7b-instruct` | ~4.4 GB | ~6 GB | workstation class |

`ai local choose auto` restores RAM-based selection. `ai local models` shows
both the curated catalogue and the models the running server reports, plus any
GGUF files already installed. Model downloads now land in
`~/.local/share/zmos/models/` by default; llama.cpp's `-hf`/Hugging Face cache
is only a fallback if that pre-download fails. The endpoint defaults to
`http://127.0.0.1:8080/v1`; `ai local` detects Ollama, llama.cpp, LM Studio
and vLLM as well.

While a GGUF is downloading or loading, llama.cpp answers `503 Loading model`.
ZMOS now treats that as “alive and loading” rather than “no server found”:

```text
ai local status
local AI running (pid 7308) · downloading 216.8 MiB
ai local wait 300
ai test
```

---

## The standard

`standard` prints the official operating-system standard. Topics:

```bash
standard identity
standard filesystem
standard formats
standard images
standard vocabulary
standard security
standard conformance
standard releases
standard splash
standard theme
```

A conformant ZMOS artifact is **complete**, **labelled**, **reproducible** and
**contained** in the workspace.

---

## Commands at a glance

| area | commands |
| --- | --- |
| system | `help` `about` `version` `settings` `theme` `splash` `standard` `selftest` `seed` `script` `update` `restart` |
| files | `ls` `cd` `cat` `head` `tail` `write` `append` `add` `edit` `nano` `rm` `cp` `mv` `find` `grep` `stat` `zip` `unzip` |
| views | `view` `image` `hex` `code` `tree` `map` `graph` `topology` `dash` `gallery` `timeline` |
| network | `world` `network` `scan` `hosts` `host` `enter` `leave` `access` `services` `civilians` `devices` `persona` `ping` `traceroute` `dns` |
| forge | `gen` `types` `formats` `media` `wallpaper` `poster` `ai` `scour` `pack` |
| standard | `formats` `media` `standard` |
| notes | `remember` `recall` `forget` `things` `mantra` `cheat` `journal` `stats` `diction` |
| mind | `ask` `brief` `recommend` `anomalies` `dossier` `plan` `agent` `do` `dream` `compose` |
| casework | `findings` `finding` `incidents` `incident` `evidence` `objectives` `artifacts` `provenance` `curate` `commission` `salon` `scope` `casepack` `metrics` |

Run `help --all` for the complete live index and `help <command>` for usage.

---

## Sandbox and ethics

ZMOS is a closed, synthetic sandbox.

- Networks, computers, users, addresses, files and images are generated on this
  machine from a seed.
- Scanning and access are performances over generated data. No socket is
  opened.
- Addresses use documentation and private space; names use fictional TLDs.
- Only `scour`, `fetch` and a configured AI provider open network connections,
  and each is explicit.
- Synthetic keys, certificates and credentials are decorative. Never use them
  outside the sandbox.

For real systems: written permission, a defined scope, a stop condition, and
respect for other people's data.

---

## Project layout

```text
ZMOS/
├── pyproject.toml
├── README.md
├── docs/
│   ├── OS-STANDARD.md
│   ├── ARCHITECTURE.md
│   ├── COMMANDS.md
│   ├── MEDIA.md
│   └── RELEASE-NOTES-2.0.md
├── src/zmos/
│   ├── cli.py          entry point and splash/boot flags
│   ├── splash.py       Z-Mall Incorporated intro page
│   ├── theme.py        Macintosh-inspired ANSI theme engine
│   ├── graphics.py     procedural pixel engine and PNG/PPM/SVG
│   ├── media.py        complete image codecs (GIF/JPEG/TIFF/TGA/QOI/...)
│   ├── formats.py      structured formats (PCAP/PPTX/ODT/OBJ/BDF/...)
│   ├── generator.py    the forge: context, naming, dispatch, prose
│   ├── universe.py     networks, hosts, people, services
│   ├── workspace.py    sandboxed filesystem and seed files
│   ├── shell.py        pipelines, prompt, banner
│   ├── tui.py          interactive loop and desktop dashboard
│   └── commands/       registry-driven command modules
├── tests/
└── tools/
```

See `docs/OS-STANDARD.md` for the formal standard and
`docs/RELEASE-NOTES-2.0.md` for the 2.0 changelog.

---

## Development

```bash
python3 -m pip install -e .
python3 -m unittest discover -s tests -v
python3 -m build
```

The test suite covers the world, workspace, shell, theme, formats, all media
codecs, splash identity, casework and the local mind. No test opens a socket.

---

## License

MIT. ZMOS, the Z-Mall name and the generated worlds are works of fiction.
Z-Mall Incorporated is a fictional publisher inside the sandbox.

> A format is a contract; honour the whole contract.
