Metadata-Version: 2.4
Name: rootos
Version: 1.0.1
Summary: ROOT // a sandboxed personal operating system, root of all things
Author: kredt
License: MIT
Project-URL: Homepage, https://pypi.org/project/rootos/
Project-URL: Documentation, https://pypi.org/project/rootos/
Keywords: terminal,tui,root,sandbox,operating-system,cybersecurity,hacking,generative,offline,worldbuilding,simulation
Classifier: Environment :: Console
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Security
Classifier: Topic :: Terminals
Classifier: Topic :: Education
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

# ROOT //

**A sandboxed personal operating system. Root of all things.**

Codename `ABSOLUTE` · version `1.0.1` · commands `rootos` / `rt`.

```text
╔══════════════════════════════════════════════════════════════════════╗
║  R O O T / /                                                         ║
║  a personal operating system · root of all things                    ║
║  v1.0.1 · ABSOLUTE · synthetic world                                 ║
╚══════════════════════════════════════════════════════════════════════╝
```

ROOT is a self-contained terminal OS for one person: you, uid 0. It generates
an entire world inside one workspace — networks, servers, phones, laptops,
cameras, cars, home appliances, ordinary people, their files, images, logs and
synthetic secrets — and then gives you the most direct commands possible to
read, edit and add anything.

It is deliberately **not** a model of real operating systems or real attack
tooling. There is no SSH, no packet socket, no DNS lookup, no scanner, no
exploit. "Scanning" is a live performance over generated data. The world is
made of glass; the interface is flat.

```text
$ rootos
root@root:/// # world
root@root:/// # scan all --fast
root@root:/// # civilians
root@root:/// # enter pocket-aster
root@pocket-aster:///net/willow-row/pocket-aster # ls
root@pocket-aster:///net/willow-row/pocket-aster # view home/aster-vale/Chats/chat-*.chat
root@root:/// # gen all --count 4
root@root:/// # scour "night city" --count 3     # opt-in web images
root@root:/// # dash
```

---

## Quick start

Install from PyPI:

```bash
python3 -m pip install --upgrade rootos
rootos
# or
rt
```

Upgrade an existing install:

```bash
python3 -m pip install --upgrade rootos
hash -r
rootos --version
```

From this directory (development):

```bash
python3 -m pip install .
rootos
```

Requires **Python 3.10+**. There are **no runtime dependencies**: the standard
library is enough. For an offline install from source, build a wheel:

```bash
python3 -m pip wheel . --no-deps --no-build-isolation -w dist
python3 -m pip install --no-index dist/rootos-1.0.1-py3-none-any.whl
```

On a distribution that marks Python as externally managed (PEP 668), add
`--user --break-system-packages` to the pip command, or install inside a virtual
environment.

Run one command without entering the shell:

```bash
rootos world
rootos scan all --fast
rootos hosts --civilian
rootos enter laptop-iris
rootos ask "what should I do next?"
rootos brief
rootos dossier laptop-iris --write
rootos pack "a field kit for a relay engineer" --count 8
rootos gen html --format dashboard
rootos usage
rootos gen life --count 4
rootos gen types
rootos selftest
```

Run a workspace script from the shell:

```bash
script /scripts/tour.rt
script /scripts/tour.rt --stop-on-error
```

Or from the launcher:

```bash
rootos --script /scripts/tour.rt
rootos --script /scripts/boot.rt --stop-on-error
```

Useful flags:

| flag | meaning |
| --- | --- |
| `--home DIR` | data directory (default `$ROOTOS_HOME` or `~/.local/share/rootos`) |
| `--seed N` | world seed for this run |
| `--theme NAME` | `phosphor`, `amber`, `ice`, `violet`, `red`, `mono` |
| `--ascii` | ASCII glyphs only |
| `--no-color` | disable ANSI colour |
| `--no-boot` | skip the boot banner |
| `--no-live` | disable streaming scan output |
| `--script PATH` | execute a `.rt` workspace script |
| `--stop-on-error` | stop a script at the first error |

---

## Tab completion

Tab completion is context-aware. It covers:

- every command and alias
- every flag and short flag from the command's help
- network slugs, hostnames, IPs, civilian names and handles
- file and directory paths, including host-relative paths for `download`/`upload`
- generation kinds, extensions, sizes, HTML formats and aliases
- themes, settings keys, aliases, AI modes, sources, effect types, subcommands
- `mshesh`, `synth`, `effects`, `ai` subcommands
- `--network`, `--host`, `--format`, `--size`, `--mode`, `--source` values

```text
scan wi<TAB>             → scan willow-row
gen h<TAB>               → gen html / htm / huge
gen html --format d<TAB> → dashboard / docs
theme <TAB>              → amber / ice / phosphor ...
ls /n<TAB>               → /net/ /notes/
host pocket<TAB>         → pocket-aster ...
```

`monitor`/`watch`-style live screens and the full-shell path completion use the
same engine.

---

## The design rule

> The world is deep; the interface is flat. The most direct path wins.

ROOT does not ask you to remember a hundred subcommands. A small set of verbs
does everything:

| verb | direct meaning |
| --- | --- |
| `world` | see every network |
| `scan` | probe a network (live synthetic output) and write its files |
| `hosts` | list every machine, including civilian devices |
| `civilians` | meet the people |
| `enter` | inhabit a machine; you are root |
| `ls`, `cat`, `view` | read anything |
| `edit`, `add`, `write` | change or create anything |
| `gen` | generate a complete unique file of any kind |
| `scour` | opt-in web image search with attribution |
| `leave` | return to `/` |

Everything else is a natural extension: `tree`, `graph`, `map`, `hex`,
`image`, `dash`, `timeline`, `grep`, `find`, `hash`, `address`, `remember`.

### Reseeding the world

```bash
seed show
seed new
seed new --fresh
seed new --stable
seed new --scan
seed 12345 --fresh
```

By default the 18 base networks keep their familiar blueprint names
(`null-harbor`, `willow-row`, …) while hosts, civilians, services and signals
are regenerated from the new seed. `--fresh` generates new network names and
slugs too. `--stable` returns to the base names. Reseeding clears scans,
dreamed regions and runtime state, but leaves workspace files in place.

`seed new` does **not** run the content/file forge. Add `--scan` to run
`scan all --fast` immediately, or use `scan all` / `dream` / `pack` afterward.

---

## Runtime: living algorithms and heartbeats

Every generated machine runs a simulated OS. It has an algorithm, scheduler,
heartbeat, tick counter, CPU/memory/temperature, process table, service states,
kernel parameters and a power state. Every network has a controller with its
own heartbeat, firewall, routes, DNS and policy.

```bash
os pocket-aster                 # full OS + runtime state
runtime --limit 10              # overview of running machines
ps pocket-aster                 # process table
monitor pocket-aster            # live screen, refreshed by heartbeat
pulse pocket-aster --count 12   # streaming heartbeat/CPU lines
heartbeat pocket-aster --rate 250
events pocket-aster            # persisted reactions and neighbour/controller alarms
events willow-row
```

Manipulation now has consequences. Powering off a host stops its services and
heartbeat, notifies the network controller, and makes a neighbour log a lost
peer. Stopping a service closes its port and alerts the controller. Releasing
`root_lock`, killing a kernel/daemon process, changing routes or adding a deny
rule all produce deterministic reactions and a persisted event trail.

```bash
events --limit 20
monitor pocket-aster   # the live frame shows the latest alarms
```

### File manipulation

File edits land in the runtime too:

```bash
edit /net/willow-row/pocket-aster/home/yara-flint/notes.txt --append "new line"
add /net/willow-row/pocket-aster/inbox/new.txt --text "hello"
rm /net/willow-row/pocket-aster/inbox/old.txt
upload /notes/field.md pocket-aster /inbox/field.md
fs pocket-aster
events pocket-aster
```

Every file write/edit/delete/upload changes:

- host disk usage and inode counts
- the `meshwatch` / `glassd` / `quietd` watcher process activity
- a persisted `file` runtime event
- `_runtime/events.log` under the host or network
- the network controller (upload/delete events)
- **the owner's attention**: civilian owners may write a notice into their
  `Chats/` folder, increment `attention` and leave an unread message

`fs` shows disk pressure, inodes, mounts, manipulation count and the latest
file reactions for the active host.

### Talking to the people

```bash
say pocket-aster "hello"
say "Aster Vale" "I noticed your door camera"
inbox pocket-aster
inbox pocket-aster --read
notices pocket-aster
```

`say` writes a real chat artefact into the owner's `Chats/` folder, produces a
local in-character reply, and records an `interaction` event. `inbox` reads
owner notices and operator conversations, shows attention/unread counts, and
`--read` clears unread. Replies follow the person's job, device, routine and
note.

Manipulate it with one easy verb, or with the explicit commands:

```bash
ctl pocket-aster off
ctl pocket-aster on
ctl pocket-aster rate 250
ctl pocket-aster kernel root_lock 0
ctl pocket-aster stop meshwatch
ctl pocket-aster svc stop lattice
ctl pocket-aster tick 10

proc pocket-aster restart meshwatch
svc pocket-aster start lattice
kernel pocket-aster scheduler mesh
power pocket-aster cycle
sched pocket-aster --tick 20
```

Network controllers are just as direct:

```bash
netos willow-row
monitor willow-row
netctl willow-row heartbeat off
netctl willow-row rate 500
netctl willow-row rule add deny 10.99.0.0/16
netctl willow-row route add 10.99.0.0/16 via 10.72.0.1
netctl willow-row dns add quiet.void 10.72.0.9
netctl willow-row pulse 10
```

Changes are persisted in `state.json`. Powering a machine off makes `enter`
refuse until you power it back on (or use `--force`). Stopped services show in
`svc`, `services`, `ports` and `netstat`. The dashboard and `host` view show
the active machine's heartbeat, tick and load. All of this is simulated.

---

## DeepSeek world synthesis

When a DeepSeek key is available, the model can generate **complete** new
networks and hosts — names, addresses, cities, services, users, shares,
signals, notes, civilian personas and lore. ROOT validates the JSON, repairs
unsafe or missing fields, assigns unique paths and persists the result.

```bash
synth status
synth network "a winter civic network of carpenters and old laptops"
synth network "a coastal cooperative" --hosts 7 --files 3 --online
synth network "a metadata-only region" --metadata-only
synth host willow-row "a retired translator's home laptop" --files 2 --online
synth host saltmarsh-wood "a shared workshop desktop"
```

Generated networks and hosts appear everywhere:

```bash
world
network saltmarsh-wood
host sail-loft
enter sail-loft
civilians
map saltmarsh-wood
dossier saltmarsh-wood --write
effects log 10
```

The model proposes; the local code validates:

- IPv4 must be documentation/private space
- IPv6 must be `2001:db8::/32`
- networks and hostnames must be unique
- CIDR collisions fall back to a safe private block
- ports, users, services, personas and signals are sanitised
- the record survives reloads via `custom_networks` / `custom_hosts`

`synth` is **comprehensive by default**: it writes a content pack into every
new host, plus a factual `_mind/assessment.md`, network `_mind` manifest and
image, and records the scan. `--files N` controls files per host (default 6),
`--size BAND` controls length, and `--online` forces DeepSeek text content.
Use `--metadata-only` when you only want the validated records. With DeepSeek
in auto/online mode, the first text file per host can be model-written; graphics
and remaining files stay local. For more content:

```bash
compose saltmarsh-wood --count 4 --online
enter sail-loft --ai --count 5
gen journal --host elspeth-laptop --online
```

---

### DeepSeek effects and interactions

Manipulations and conversations can be handled by DeepSeek as a consequence
engine. The model proposes a narration and up to four validated effects:
alarms, owner attention, network load, service/process changes, neighbour
reactions, notices and network alarms. ROOT applies only whitelisted effects.

```bash
effects status
effects off
effects on
effects log 20
effects test pocket-aster "stopped a process without warning"
```

This is automatic when a key is present and mode is `auto`/`online`, for:

- runtime manipulations (`ctl`, `proc`, `svc`, `kernel`, `power`, `heartbeat`, `netctl`)
- file manipulations (`edit`, `add`, `rm`, `upload`, `download`, `mshesh save`)
- conversations (`say`)
- explicit `effects test`

Disable it with `effects off` or `settings ai_effects false`. The local
deterministic reactions still run; DeepSeek adds the narration and extra
validated consequences. Every call is metered by `ai usage`.

---

## mshesh hash terminal

The `BDCS/mshesh` functions are now native:

```bash
mshesh                    # one random hash (the default)
mshesh random             # also one random hash
mshesh random 3
mshesh value hello
mshesh words 2
mshesh unwords "coconut mystery hub satoshi any mandate option alter client column judge destroy ramp august idea visual drastic vicious scissors grocery circle shift gauge naive"
mshesh monitor 1 50 5
mshesh log 20
mshesh save /vault/mshesh/log.txt --lines 10
mshesh record /vault/mshesh/live.txt
mshesh record off
mshesh user operator
mshesh status
```

- deterministic SHA-256 value hashes and 64-character random hashes
- BIP39 24-word encoding and checksum-validated decoding
- jittered monitor mode with value chance and optional tick limit
- persistent hash log, live recording and save-last-N
- all files live under `/vault/mshesh/`

---

## The onboard mind

ROOT is not just a pile of commands. It has a local intelligence layer that
reads the generated world, explains it, spots anomalies and plans work:

```bash
ask "what should I do next?"
ask "why is this machine risky?"
ask "who are the civilians?"
brief
recommend
anomalies
plan "civilian audit"
agent "civilian audit" --run
dossier pocket-aster --write
risk pocket-aster
analyze willow-row
council "what is interesting here?"
```

In an interactive session you can skip the `ask` prefix. A line such as
`what should I do next?` is handed to the mind automatically when it does not
match a command.

The local mind is deterministic and works offline. It can:

- interpret natural-language questions and resolve hosts, people and networks;
- explain risk factors from services, signals, shares, trust and device type;
- find unusual combinations (civilian criticals, role mismatches, dormant
  networks with critical signals);
- recommend the next best commands with reasons;
- write durable Markdown dossiers into `/notes/dossiers/`;
- plan an objective and execute only safe internal steps (`agent --run`);
- search machines, people, notes and file contents.

DeepSeek is an optional **second source of intelligence**, not a replacement:

```bash
ask "..." --online          # model answers over the local context
council "..."               # local mind + DeepSeek, side by side
brief --online
dossier willow-row --online
plan "civilian audit" --online
agent "civilian audit" --online --run
analyze pocket-aster --online
```

A model plan is validated against a whitelist of safe ROOT commands before it
can be run. The local mind remains the fallback if the key is missing, the
network is down, or the model returns an unsafe plan.

### Generative execution

The mind does not only talk; it can change the world generatively.

```bash
do "scan willow-row"
do "create a new orbital district"
do "write a dossier on Willow Row"
compose pocket-aster --count 5
dream "a residential street by the sea"
extend orbital
```

- `do` interprets an instruction and executes safe internal steps. `--dry-run`
  shows the steps first.
- `dream` / `extend` asks the local mind to **generate a new network**: a
  deterministic region with hosts, civilians, services, signals and lore. It
  populates it, writes a field note and an image under `_mind/`, and records the
  region in the world counter so it survives reloads.
- `compose` generates a coherent content pack for a host, person or network,
  choosing file families from the role, job, routine and current world state.
- Every scan/enter also writes `_mind/assessment.md` into the machine: a
  factual, context-aware sheet built from the actual host, not a random
  template.
- The forge chooses families intelligently: relays get packets and logs, vaults
  get keys and configs, photographers get photos and journals, bakers get
  receipts and to-dos, and so on.

Dreamed networks participate in `world`, `scan`, `scan all`, `map`, `hosts`,
`civilians`, `dossiers` and every other command exactly like the base world.

---

## A world with people in it

The generated world contains two kinds of machines.

**Infrastructure**: relays, mirrors, oracles, vaults, archives, build forges,
sensors, databases, bastions, routers, orbital uplinks and ghost nodes.

**Civilian**: ordinary people's phones, laptops, tablets, watches, door
cameras, living-room displays, games consoles, cars, drones, fridges,
doorbells, e-readers, home routers, medical wearables, street kiosks, speakers,
handheld consoles, connected bicycles and utility meters.

Each civilian machine belongs to a fictional person with a name, handle, age,
job, home address, household, routine and a small note. The generator writes
personal artefacts into their machine when you scan or browse it: chats,
journals, calendars, contact cards, receipts, to-do lists, playlists, photos,
notes, source code, logs and more.

```text
root@root:/// # civilians
name           handle           age  job              network        devices
Aster Vale     aster.vale23     63   archivist        Willow Row     pocket-aster
...
root@root:/// # persona Aster
root@root:/// # enter pocket-aster
root@root:/// # ls
root@root:/// # tree home
```

Networks include corporate enclaves, a glass bazaar, relay chains, research
labs, self-healing meshes, cold archives, vaults, compute farms, transit
backbones, an orbital uplink, a ghost network, residential streets, a public
square, a mobile fleet, a civic hall and a housing cooperative.

---

## Live scanning and the growing workspace

`scan` streams plausible probe lines when you are in a TTY, then writes files
into the workspace. **Every scan writes new files.** Scanning the same network
again does not overwrite anything; the forge uses a monotonic counter plus the
world seed and the current time, so every artefact is unique.

```bash
scan all --fast
scan willow-row --files 3 --size medium
scan --host pocket-aster --files 5
```

Each scanned network gets:

- a host directory for every machine, e.g. `/net/willow-row/pocket-aster/`
- generated personal/technical files under that machine
- a network signal log under `/net/<network>/_signals/`
- a synthetic scan report under `/net/<network>/_scans/`

`enter <host>` / `browse <host>` generates more unique files and sets your
current directory to the machine's root. You keep full root access.

```text
root@root:/// # scan willow-row
root@root:/// # enter pocket-aster
root@pocket-aster:///net/willow-row/pocket-aster # ls
root@pocket-aster:///net/willow-row/pocket-aster # view home/aster-vale/Journal/...
root@pocket-aster:///net/willow-row/pocket-aster # image home/aster-vale/Pictures/...
root@pocket-aster:///net/willow-row/pocket-aster # edit home/aster-vale/Notes/... --append "a new line"
root@pocket-aster:///net/willow-row/pocket-aster # leave
```

All addresses are documentation/private space (`192.0.2.0/24`,
`198.51.100.0/24`, `203.0.113.0/24`, `10.66.0.0/16`-ish private ranges,
`2001:db8::/32`). Names use fictional TLDs (`.void`, `.mesh`, `.null`,
`.ghost`, `.root`, `.relay`, `.hollow`, `.lab`). Nothing resolves or routes.

---

## The offline forge

`gen` is a complete local content engine. It writes **real files** of every
kind, at six size bands, with unique content on every call.

```bash
gen all --count 4
gen doc --size huge
gen python --size large --host oracle-01
gen chat --host pocket-aster --size medium
gen photo --size epic
gen svg
gen image
gen security
gen key
gen archive
gen life
gen types
```

Families include:

| family | output |
| --- | --- |
| `doc`, `note` | Markdown, text, reStructuredText, Org, AsciiDoc |
| `log`, `packet` | logs, audit trails, synthetic capture sketches |
| `data` | JSON, JSONL, CSV, TSV, YAML, TOML, XML |
| `config` | INI, conf, env, properties, systemd, Terraform |
| `python`, `js`, `web`, `c`, `go`, `rust`, `shell`, `sql` | working-looking source |
| `security` | Sigma/YARA-flavoured detection rules (fictional) |
| `key` | clearly labelled synthetic PEM/certificate material |
| `mail`, `chat`, `journal`, `calendar`, `contact`, `receipt`, `todo`, `playlist` | personal content |
| `svg`, `image`, `photo`, `art` | procedural SVG, PNG, PPM and ANSI art |
| `archive`, `binary`, `disk`, `packet` | ZIP, TAR, binary blobs, disk images |
| `html`, `css`, `feed` | 21 HTML formats, stylesheets, RSS/Atom feeds |
| `pdf`, `database`, `midi`, `audio` | PDF reports, SQLite databases, MIDI scores, WAV tones |
| `office`, `epub`, `rtf`, `tex`, `notebook`, `vue`, `gzip` | DOCX, XLSX, EPUB, RTF, LaTeX, Jupyter, Vue, gzip |
| `book` | long-form Markdown, PDF or EPUB |
| `powershell`, `batch`, `graphql`, `proto`, `dot` | PS1, BAT, GraphQL, protobuf and Graphviz |
| `life`, `all` | random mixtures, including civilian artefacts |

HTML alone has 21 distinct formats, each with its own palette, CSS, layout,
SVG/canvas art and content: `landing`, `docs`, `blog`, `dashboard`, `gallery`,
`terminal`, `portfolio`, `wiki`, `status`, `login`, `store`, `forum`,
`changelog`, `404`, `spa`, `canvas`, `cssart`, `newspaper`, `archive`, `map`
and `email`.

### Content packs

`pack` writes a **coherent folder**, not one random file at a time:

```bash
pack "a field kit for a relay engineer" --count 8
pack "family archive" --host pocket-aster --count 10
pack "incident response kit" --count 12 --size large --online
```

It generates docs, source, configs, data, logs, security rules, images and a
`_pack.md` manifest in one directory. `tree <dir>` shows the pack.

```bash
gen html --format dashboard --size large
gen html --format newspaper
gen types html
```

Size bands: `tiny`, `small`, `medium`, `large`, `huge`, `epic` (roughly 2 to
4000 lines, or correspondingly larger images/binaries).

Graphics are generated locally with a tiny value-noise / palette engine:
signal fields, glitch studies, circuit traces, radial blooms, topographic
drift, void fields, synthetic dreams, pressure maps, lattices and weather
memories. The console can render PNG, PPM and SVG in the terminal, using
24-bit/xterm half-blocks or ASCII.

---

## Optional DeepSeek

ROOT is offline by default. To let a real model write text files:

```bash
ai key sk-...          # stored in secret.json (0600); enables auto mode
ai mode auto           # offline | auto | online
ai test                # explicit connectivity probe
ai usage               # tokens, calls and approximate USD
ai pricing             # approximate USD / 1M tokens
ai budget 1.00         # cap spend; 0 = unlimited
gen doc --online       # one explicit online generation
ai model deepseek-chat
ai temp 1.0
```

Or set `DEEPSEEK_API_KEY` in the environment (it takes precedence).

What the API can generate: **text files** — docs, code, logs, data, configs,
mail, chats, rules and the rest. Images, binaries and archives remain local.
If the API is unreachable or the key is invalid, the forge falls back to the
offline engine and records that in the generated file's note. The key is never
printed and is sent only to `api.deepseek.com`.

`scan --ai` / `enter --ai` use the API for one text file per host (bounded
budget) when a key is configured. Default scans stay offline and fast.

DeepSeek can also act as a **second intelligence source**:

```bash
ask "why is this network interesting?" --online
council "what should a careful operator do next?"
brief --online
dossier willow-row --online
plan "civilian audit" --online
agent "civilian audit" --online --run
analyze pocket-aster --online
say pocket-aster "did you notice the file?" --online
events pocket-aster --explain --online
```

The local mind builds the facts and the context; DeepSeek adds a second
interpretation. A model-proposed plan is restricted to a whitelist of safe ROOT
commands and rejected if it contains shell operators. If anything fails, the
deterministic local mind answers instead.

DeepSeek can cover the **language layer** of nearly every feature: personas,
notices, analysis, plans, dossiers, lore and generated files. When a key is
present and mode is `auto`/`online`, it is used automatically by the mind, the
forge, `say`, owner notices, `dream`, `compose` and `events --explain`. It does
not perform the mechanical layer: file writes, runtime ticks, process/service
state, persistence and safety checks stay local and validated.

Every call is metered in `ai_usage`: calls, prompt/completion/total tokens and
approximate dollars per feature and model. `usage` (or `ai usage`) shows the
counter. Prices are approximate defaults and can be overridden with
`settings ai_price_input_per_m`, `ai_price_cached_per_m` and
`ai_price_output_per_m`. `ai budget` stops calls when the spend cap is reached
and the local fallback takes over.

---

## Files in and out

All simulated machine files are real files inside the workspace. You can move
them around, and optionally out to the real home directory:

```bash
download /net/willow-row/pocket-aster/_mind/assessment.md
pull pocket-aster home/yara-flint/Journal
download /notes --export                 # directory → exports/notes.zip
upload /notes pocket-aster /inbox/notes  # directory upload
download pocket-aster /inbox/notes
download /drop/report.md --export
upload /notes/field.md pocket-aster      # copy into the machine's /inbox
push /drop/bundle.zip pocket-aster /inbox/bundle.zip
```

`download` / `pull` copy files **or whole directories** from the generated
world into `/drop/downloads`. `upload` / `push` copy files or directories from
the workspace into a generated machine. `--export` writes a real copy under
`$ROOTOS_HOME/exports`; directories are exported as a ZIP.

There is also one explicit general web download:

```bash
fetch https://example.com/robots.txt
fetch https://example.com/file.pdf --max 8M
```

`fetch` is HTTPS/HTTP only, bounded (25 MiB default), refuses private/loopback
addresses, checks content type, and stores metadata next to the file. It is
**not** used implicitly.

---

## Optional web images

When the internet is available, `scour` searches **public, no-key** image APIs
(Wikimedia Commons and Openverse), downloads a bounded image, and stores
attribution next to it.

```bash
scour "night city" --count 3
scour --kind nature --count 2
scour "electronic circuit macro" --source commons --type png
scour "storm over the sea" --host pocket-aster
```

Each download creates:

- the image itself, inside `/drop/web/<query>/` or the host's `Pictures/`
- `<file>.meta.json` — source, creator, licence, original URL, dimensions
- `<file>.source.txt` — human-readable attribution

PNG and SVG render in the terminal. JPEG/WebP/GIF are kept as supplied, or
converted to PNG locally if Pillow is installed (`pip install "rootos[images]"`).
Check the source licence before reuse. Web images are **opt-in**; nothing is
fetched silently.

`scour`, `fetch` and DeepSeek are the only features that open a network
connection, and only when you ask for them.

---

## Workspace layout

The workspace is a real directory under `$ROOTOS_HOME/workspace`:

```text
workspace/
├── README.md
├── root/                 the root user's home
├── notes/                things to remember, sandbox notes
├── drop/                 loose files, generated artefacts, web images
├── scripts/              ROOT shell scripts
├── vault/                decorative keys and address cards
└── net/
    └── willow-row/       a generated network
        ├── _scans/       synthetic scan reports
        ├── _signals/     generated signal logs
        ├── pocket-aster/ a person's phone
        │   └── home/aster-vale/{Chats,Documents,Journal,Notes,Pictures,...}
        └── home-pale/    a person's home router
```

Everything you see through the console is a real file you can inspect with
ordinary tools. Path traversal and symlink escapes are refused.

---

## Command map

Run `help --all` for the index, `help <command>` for usage, `tour` for a guided
path, and `cheat` for cybersecurity/programming cues.

| category | what it covers |
| --- | --- |
| `system` | help, identity, settings, themes, history, aliases, scripts, selftest |
| `workspace` | home, mounts, disk usage, clean, reset, exports |
| `files` | ls/cd/cat, write/edit/add, rm/cp/mv, find/grep, zip/unzip, download/upload |
| `views` | tree, graph, map, topology, dash, timeline, image, hex, gallery |
| `network` | world, network, live scan, hosts, civilians, devices, DNS/ping/route, fetch, netos/netctl |
| `host` | host detail, enter/leave, access, services/users/ports/shares, os/ps/proc/svc/kernel/power/heartbeat/pulse/sched/ctl/monitor/fs/events/say/inbox |
| `forge` | gen, pack, synth, types, ai, usage, scour |
| `crypto` | hashes, mshesh terminal, BIP39 words, encodings, entropy, addresses, tokens, passphrases |
| `notes` | remember/recall/forget, things, mantras, cheat, stats, journal |
| `mind` | ask, brief, recommend, anomalies, risk, dossier, plan, agent, do, dream, compose, analyze, council, effects |

Examples:

```bash
world --map
network willow-row
scan all --fast
hosts --civilian
host pocket-aster
os pocket-aster
monitor pocket-aster
ctl pocket-aster off
events pocket-aster
fs pocket-aster
say pocket-aster "hello"
inbox pocket-aster
netos willow-row
netctl willow-row rule add deny 10.99.0.0/16
graph pocket-aster
map willow-row
civilians
persona "Aster Vale"
devices
findhost camera
address pocket-aster
synth network "a coastal cooperative" --scan
mshesh value hello
mshesh words 2
ask "what should I do next?"
brief
anomalies
risk pocket-aster
dossier "Aster Vale" --write
plan "civilian audit"
agent "civilian audit" --run
do "scan willow-row"
dream "a residential street by the sea"
compose pocket-aster --count 5
analyze willow-row
council "what is interesting here?"
gen html --format dashboard
gen chat --host pocket-aster --size large
download /net/willow-row/pocket-aster/_mind/assessment.md --export
upload /notes/remember.md pocket-aster /inbox/remember.md
fetch https://example.com/robots.txt
view /net/willow-row/pocket-aster/home/aster-vale/Chats/chat-*.chat
image /net/willow-row/pocket-aster/home/aster-vale/Pictures/*.png
edit /notes/remember.md --append "- check the roof node"
zip /drop/bundle.zip /net/willow-row/pocket-aster
unzip /drop/bundle.zip --extract
remember "Root is a responsibility, not a permission."
cheat
dash
```

---

## Safety and intent

ROOT is a **closed sandbox**:

- generated addresses are documentation/private space;
- generated names use fictional TLDs;
- "scan", "access", "ping" and "traceroute" are simulations;
- no sockets are opened by default;
- `scour`, `fetch` and DeepSeek are explicit, opt-in network features;
- `fetch` refuses private/loopback addresses and oversized files;
- no exploit code is produced;
- web images and `fetch` carry source/metadata sidecars.

Use the same discipline in the real world: written authorisation, a defined
scope, a stop condition, data-handling rules, and respect for other people's
data. Root is a responsibility, not a permission.

---

## Development

```bash
# run from source
PYTHONPATH=src python3 -m rootos --home /tmp/rootos-demo help

# tests (standard library unittest)
python3 -m unittest discover -s tests -v

# build and install a wheel offline
python3 -m pip wheel . --no-deps --no-build-isolation -w dist
python3 -m pip install --no-index dist/rootos-1.0.1-py3-none-any.whl
```

Docs: [`docs/ROOTOS-Guide.pdf`](docs/ROOTOS-Guide.pdf) (complete guide),
[`docs/ROOTOS-Cheatsheet.pdf`](docs/ROOTOS-Cheatsheet.pdf) (quick reference),
[`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md),
[`docs/COMMANDS.md`](docs/COMMANDS.md).

Regenerate the PDFs after changing commands or features:

```bash
PYTHONPATH=src python3 tools/build_guide.py
chromium --headless --no-sandbox --disable-gpu --no-pdf-header-footer \
  --print-to-pdf=docs/ROOTOS-Guide.pdf file://$PWD/docs/ROOTOS-Guide.html
chromium --headless --no-sandbox --disable-gpu --no-pdf-header-footer \
  --print-to-pdf=docs/ROOTOS-Cheatsheet.pdf file://$PWD/docs/ROOTOS-Cheatsheet.html
```

License: MIT.
