Metadata-Version: 2.4
Name: artos
Version: 1.0.0
Summary: ARTOS // a sandboxed personal operating system, root of all art
Author: kredt
License: MIT
Project-URL: Homepage, https://pypi.org/project/artos/
Project-URL: Documentation, https://pypi.org/project/artos/
Keywords: terminal,tui,art,poetry,literature,generative-art,creative-writing,operating-system,sandbox,offline,worldbuilding,science,media,generator
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Artistic Software
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

# ARTOS //

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

Codename `POIESIS` · version `1.0.0` · commands `artos` / `at`.

```text
╔══════════════════════════════════════════════════════════════════════╗
║  A R T / /  root of all art                                          ║
║  a personal operating system · root of all art                       ║
║  v1.0.0 · POIESIS · synthetic culture                                ║
╚══════════════════════════════════════════════════════════════════════╝
```

ARTOS is the sibling of ROOT. Where ROOT generates a synthetic network, ARTOS
generates a synthetic **culture**: regions, studios, artists, works, movements,
presses, laboratories, tensions and archives. It gives you one workspace, one
flat interface, and the most direct commands possible to read, edit, make,
transform and publish anything.

```text
$ artos
art@atelier:/// # world
art@atelier:/// # collect all --fast
art@atelier:/// # artists
art@atelier:/// # enter quiet-press
art@quiet-press:///atlas/quiet-press/quiet-press # ls
art@quiet-press:///atlas/quiet-press/quiet-press # gen poem --size large
art@atelier:/// # muse "a city of margins"
art@atelier:/// # critique /library/poem.md
art@atelier:/// # gen poster --size large
art@atelier:/// # dash
```

---

## Quick start

Install from this directory:

```bash
python3 -m pip install .
artos
# or
at
```

Offline install from a wheel (no index, no dependencies):

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

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

Requires **Python 3.10+**. There are **no runtime dependencies**: the standard
library is enough for text, PNG, PPM, SVG, WAV, MIDI, PDF, EPUB, DOCX, ZIP and
tar output. Pillow is optional and only used to preview JPEG/WebP images.

Run one command without entering the shell:

```bash
artos world
artos collect ink-garden --fast
artos studios --tension
artos artists --region river-salon
artos enter quiet-press
artos gen all --count 4
artos gen poster --size large
artos gen paper --size large
artos muse "an archive that forgets"
artos critique /notes/creed.md
artos plan "a small exhibition"
artos source "botanical illustration" --count 3   # opt-in network
artos library "poetry"                            # opt-in network
artos selftest
```

Flags:

| flag | meaning |
| --- | --- |
| `--home DIR` | data directory (default `$ARTOS_HOME` or `~/.local/share/artos`) |
| `--seed N` | atlas seed for this run |
| `--theme NAME` | `riso`, `ultramarine`, `vermilion`, `celadon`, `nocturne`, `paper`, `neon`, `solar`, `ash`, `orchid`, `mono` |
| `--ascii` | ASCII glyphs only |
| `--no-color` | disable ANSI colour |
| `--no-boot` | skip the boot banner |
| `--no-live` | disable streaming survey output |
| `--script PATH` | execute a `.art` workspace script |
| `--stop-on-error` | stop a script at the first error |

---

## The sandbox promise

ARTOS is a closed, synthetic atelier.

- Regions, studios, artists, works, presses and laboratories are generated on
  this machine from a seed. The people and institutions are invented.
- Everything you make is yours. Generated writing is original combinatorial
  work, not a quotation from a real author.
- Images, scores, books and datasets are produced by local algorithms. No
  socket is opened by `collect`, `enter`, `gen` or `compose`.
- `source`, `library`, `fetch` and DeepSeek are explicit opt-ins. They are the
  only commands that open a network connection.
- Public-domain material is always stored with a `.source.txt` attribution
  sidecar next to it.
- The science in ARTOS is plausible fiction. Do not cite it as fact.

If you use real sources: check the licence, credit the creator, keep the
original, and do not present a generated work as somebody else's.

---

## The design rule

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

A small set of verbs does everything:

| verb | direct meaning |
| --- | --- |
| `world` | see every region |
| `collect` | survey a region; write its studios and works |
| `studios` | list every studio, including institutions |
| `artists` | meet the people |
| `enter` | inhabit a studio; you are the author |
| `ls`, `cat`, `view` | read anything |
| `edit`, `add`, `write` | change or create anything |
| `gen` | generate a complete unique work of any kind |
| `muse` | expand a prompt into a working brief |
| `read`, `critique` | close read anything |
| `cutup`, `erase`, `constrain`, `remix` | transform an existing text |
| `source`, `library` | opt-in public-domain material with attribution |
| `leave` | return to `/` |

Everything else is a natural extension: `tree`, `graph`, `map`, `hex`,
`image`, `gallery`, `dash`, `timeline`, `grep`, `find`, `stat`, `palette`,
`curate`, `commission`.

### Reseeding the atlas

```bash
seed show
seed new
seed new --fresh
seed new --collect
seed 12345 --fresh
```

By default the 12 base regions keep their familiar blueprint names
(`ink-garden`, `paper-cathedral`, …) while studios, artists, works and tensions
are regenerated from the new seed. `--fresh` generates new region names and
slugs too. `--stable` returns to the base names. Reseeding clears surveys,
dreamed regions and runtime state, but leaves workspace files in place.

`seed new` does **not** run the forge. Add `--collect` to survey immediately,
or use `collect all` / `dream` / `pack` afterward.

---

## The Atlas

Twelve base regions, each a different kind of art world:

| region | kind | what it generates |
| --- | --- | --- |
| `ink-garden` | poetry quarter | poets, translators, letterpress, reading rooms |
| `paper-cathedral` | fiction district | novelists, story writers, binders, editors |
| `glass-stage` | performance district | playwrights, directors, dramaturgs, designers |
| `ember-atelier` | visual arts quarter | painters, sculptors, printmakers, photographers |
| `hollow-conservatory` | sound district | composers, performers, sound artists, listening rooms |
| `salt-observatory` | research quarter | physicists, biologists, data scientists, field stations |
| `quiet-press` | publishing quarter | publishers, typesetters, zine makers, catalogues |
| `neon-lapidary` | new media lab | generative artists, creative coders, net and glitch artists |
| `moss-theatre` | oral tradition quarter | storytellers, singers, mask makers, oral historians |
| `cobalt-foundry` | design foundry | typographers, graphic designers, type founders, poster artists |
| `lunar-archive` | critical quarter | critics, curators, art historians, essayists |
| `river-salon` | correspondence quarter | letter writers, correspondents, diarists, salon hosts |

`collect` writes each studio as a real directory with `STUDIO.md`,
`WORKS.md`, `_meta.json`, generated works, notes and publications. `enter`
inhabits one studio and generates fresh work at its desk.

Every studio has a **practice runtime**: algorithm, pulse, mood, ink,
attention, open work and disciplines. Use `monitor`, `pulse`, `power`,
`kernel`, `proc`, `svc`, `events`, `ctl`.

---

## Generation: the complete catalogue

`gen` accepts a family name or a literal extension. `gen types` prints the
current catalogue (115 families).

### Poetry and fixed forms

`poem`, `sonnet`, `haiku`, `tanka`, `cinquain`, `acrostic`, `limerick`,
`villanelle`, `ghazal`, `ode`, `elegy`, `epigram`, `lyric`, `hymn`,
`prosepoem`, `concrete`, `blackout`, `poetry`.

### Fiction, essay and drama

`prose`, `story`, `fable`, `myth`, `tale`, `novella`, `book`, `essay`,
`manifesto`, `critique`, `review`, `letter`, `dialogue`, `play`, `screenplay`,
`memoir`, `biography`, `travel`, `fieldnote`, `journal`, `aphorism`, `proverb`,
`riddle`, `recipe`, `lecture`.

### Publishing

`zine`, `magazine`, `newspaper`, `anthology`, `catalogue`, `exhibition`,
`library`, `index`, `booklet`, `epub`, `pdf`, `docx`, `rtf`, `tex`.

### Science

`abstract`, `paper`, `labreport`, `hypothesis`, `protocol`, `dataset`,
`citation`, `peerreview`, `grant`, `scienposter`, `specimen`, `notebook`,
`plot`.

### Visual, music and media

`image`, `art`, `svg`, `poster`, `palette`, `gallery`, `cssart`, `generative`,
`mandala`, `field`, `glitch`, `fractal`, `type`, `comic`, `storyboard`,
`music`, `score`, `audio`, `playlist`, `podcast`.

### Code and data

`python`, `js`, `web`, `html`, `css`, `glsl`, `processing`, `sql`, `shell`,
`data`, `json`, `csv`, `yaml`, `toml`, `xml`, `feed`, `calendar`, `contact`,
`mail`, `chat`, `archive`, `dot`, `manifest`, `life`, `all`.

Sizes: `tiny` 4–12 lines · `small` 10–28 · `medium` 34–90 · `large` 120–320 ·
`huge` 500–1200 · `epic` 1600–4000. Images have their own dimensions per band.

### Examples

```bash
gen poem --prompt "a city of margins" --size large
gen sonnet --host ink-garden
gen story --size huge
gen manifest --size epic
gen play --size large
gen catalogue --format exhibition
gen paper --size large
gen dataset --size medium
gen image --size large --prompt "cold harbour"
gen poster --size large
gen music --size small
gen generative --prompt "flow field"
gen epub --size large
gen life --count 4
gen all --count 8
```

Files are written to the right place: works to `/atlas/.../works`, books to
`publications`, science to `lab`, web to `web`, code to `code`, images to
`/gallery`, and so on. `--host` chooses a studio; without one, the active studio
is used, then the root layout.

---

## The wired mind

The mind is local and deterministic. It reads the atlas, your files and the
current runtime. DeepSeek is an optional second source, never silent.

```bash
ask "what should I make next?"
ask "why is quiet-press tense?"
ask "tell me about Orin Fable"
brief
recommend
tensions
critique /notes/creed.md
critique quiet-press
dossier quiet-press --write
plan "a small exhibition"
agent "a small exhibition" --run
do "make a sonnet about weather"
analyze /library/poem.md
council "what is this studio avoiding?"
mind
mind context
muse "a city of margins"
```

The mind can:

- interpret natural language against the atlas;
- write a situation brief and a list of next moves;
- find productive tensions and structural anomalies;
- close-read a file (syllables, rhyme, readability, mood, motifs, scores);
- critique a studio's practice;
- write a durable dossier;
- plan and optionally run safe, workspace-local steps;
- dream a new region and furnish it;
- compose a coherent pack for a studio, artist or region;
- expand a prompt into a working brief with form, constraint, material,
  three doors and an anti-prompt.

It never plans a network command automatically.

---

## Human input as programming

ARTOS treats user input as part of the generation. The transformation commands
read an existing text, apply a visible rule, and write a new file while leaving
the original untouched.

```bash
read /notes/creed.md
meter /library/poem.md
rhyme rain
syllables "the lamp left burning"
readability /library/essay.md
sentiment /library/letter.md
motif /library/story.md

cutup /library/poem.md --count 2
erase /library/poem.md --keep 2 --svg
constrain /library/essay.md --mode lipogram --letter e
constrain /notes/creed.md --mode n+7
constrain /library/poem.md --mode monosyllabic
remix /library/story.md --style "colder, more public"
annotate /library/poem.md
plain /library/essay.md
palette riso
curate /gallery --limit 6
provenance /library/poem.md --write
```

`provenance` writes a small certificate: sha256, bytes, entropy, edition and
studio. It proves the bytes, not the authorship in law.

Programming cues are first-class. `cheat` prints the full sheet, including:

- every file is text until it is an image; every image is numbers until it is
  meaning;
- a seed plus a rule is a style; a seed plus a mistake is a signature;
- write the loop first; the composition is what happens between iterations;
- keep the original; work on the copy;
- if the output is not reproducible, keep the notebook;
- a generative work is a score; the exhibition is a performance;
- comments are letters to the person who will debug the poem;
- print the intermediate state; meaning hides in the middle.

Scripts are plain lines. Save `/scripts/mine.art`:

```text
# a small studio session
collect ink-garden --fast
enter ink-garden --count 2 --size small
gen poem --size large
critique /notes/creed.md
remember "The work is not the intention; the work is the evidence."
dash
```

Run it:

```bash
script /scripts/mine.art
script /scripts/mine.art --stop-on-error
```

Pipes, variables, aliases and redirection all work:

```text
grep "door" /library | wc
gen poem --prompt "rain" > /library/rain.md
alias m "muse"
alias c "collect"
```

---

## Science as a studio

```bash
science
hypothesis "attention in small rooms"
method "attention in small rooms"
dataset "attention" --size medium
experiment "attention" --size small
paper "attention" --size large
cite
peer "attention"
lab
```

`experiment` writes a hypothesis, a protocol, a dataset and a lab report. The
science is plausible fiction: references are invented, results are simulated,
and the interface says so.

---

## Public-domain sources and the online switch

ARTOS is offline by default. Four commands can open a socket:

```bash
source "botanical illustration" --count 3
source --kind portrait --type png
library "poetry" --count 2
fetch https://example.com/file.pdf --max 8M
ai key sk-...          # DeepSeek, optional
ai mode auto
ai test
```

- `source` searches Wikimedia Commons and Openverse, downloads bounded images,
  and writes `.meta.json` + `.source.txt` attribution.
- `library` searches Project Gutenberg via Gutendex, downloads public-domain
  text, strips the Gutenberg boilerplate, and writes attribution.
- `fetch` is the only general web download. It refuses private/loopback
  addresses, re-checks redirects, and enforces a byte limit.
- DeepSeek is metered in tokens and approximate USD. `ai budget 1.00` caps
  spend; `0` means unlimited. The key is stored in `secret.json` (0600) or read
  from `DEEPSEEK_API_KEY`.

Images, WAV, MIDI, PDF, EPUB, DOCX and all mechanical state are always local.
`effects` can turn a small mechanical consequence into one or two sentences of
in-world narration; it is off without a key and never changes the atlas.

---

## Studio runtime

The atlas is alive in a small way. Each studio has a practice with a pulse.

```bash
monitor
monitor quiet-press
monitor ink-garden
pulse --steps 3
power on
power off
heartbeat off
kernel algorithm "slow revision"
kernel ink 80
proc list
proc start "a new poem"
proc advance "a new poem"
proc finish "a new poem"
svc list
svc restart letterpress
events --limit 20
ctl power off
```

Writing inside a studio changes its ink, attention and open work. Writing
outside a studio does not.

---

## Workspace layout

The workspace is a real directory under `$ARTOS_HOME` (default
`~/.local/share/artos`).

| path | meaning |
| --- | --- |
| `/atlas` | regions, studios, works, metadata |
| `/gallery` | images, posters, SVG, terminal art, palettes |
| `/library` | poems, books, essays, public-domain sources |
| `/press` | zines, magazines, catalogues, exhibitions, HTML editions |
| `/lab` | hypotheses, protocols, datasets, papers |
| `/drop` | loose files, packs, deliveries, experiments |
| `/notes` | creeds, memory, dossiers, critiques, conversations |
| `/scripts` | `.art` scripts |
| `/root` | the author's home |
| `/vault` | reserved for future sealed material |

Everything is inspectable with ordinary tools. `workspace` shows the layout;
`mount`, `df`, `du`, `tree`, `find`, `grep` work as expected.

---

## Themes and settings

```bash
theme riso
theme ultramarine
ascii on
settings form "free verse"
settings palette riso
settings constraint none
settings ai_mode auto
settings natural_language on
```

Themes: `riso` (default), `ultramarine`, `vermilion`, `celadon`, `nocturne`,
`paper`, `neon`, `solar`, `ash`, `orchid`, `mono`. Colour degrades to plain
text on pipes, under `NO_COLOR`, or with `--ascii`.

---

## Tab completion

Completion is context-aware. It covers every command and alias, flags,
regions, studios, artists, file and directory paths, generation kinds,
extensions, sizes, HTML formats, themes, settings, AI modes and subcommands,
source kinds, constraints, and runtime actions.

```text
gen po<TAB>              → poem / poetry / poster
enter qu<TAB>            → quiet-press ...
collect ink<TAB>         → ink-garden
gen poem --size <TAB>    → tiny / small / medium / large ...
source --kind b<TAB>     → botanical
constrain x --mode <TAB> → lipogram / n+7 / monosyllabic ...
```

---

## Tests

```bash
python3 -m unittest discover -s tests -v
```

The suite covers the parser, workspace sandbox, atlas determinism, graphics,
poetics, exports, runtime, completion, the full generation catalogue, and the
command surface. It does not use the network or a DeepSeek key.

Build a release:

```bash
python3 -m build            # if `build` is installed
# or, offline:
python3 -m pip wheel . --no-deps --no-build-isolation -w dist
```

---

## Architecture

```text
src/artos/
  cli.py            argparse entry point (`artos` / `at`)
  shell.py          pipelines, natural-language fallback, prompt, banner
  parser.py         quotes, variables, pipes, redirection
  registry.py       command registry and shared argument parsing
  session.py        identity, seed, atlas, workspace, notes, AI config
  storage.py        state.json, secret.json, exports
  workspace.py      sandboxed VFS and seeded starter files
  universe.py       the Atlas: regions, studios, artists, works, tensions
  runtime.py        living studios: pulse, ink, attention, processes
  generator.py      the forge: 115 families, 20+ real formats
  poetics.py        poetry/prose/science generation and close reading
  graphics.py       20 procedural styles, PNG/PPM/SVG/ANSI
  audio.py          WAV synthesis and Standard MIDI Files
  exports.py        PDF, EPUB 3, DOCX, RTF, gzip
  intelligence.py   the local mind + optional DeepSeek
  deepseek.py       metered API bridge
  webimages.py      opt-in Wikimedia/Openverse images
  webtext.py        opt-in Project Gutenberg texts
  webfetch.py       explicit bounded fetch
  completion.py     context-aware Tab completion
  tui.py            interactive loop and dashboard
  theme.py          ANSI palettes and renderers
  commands/         system, workspace, files, views, atlas, studio,
                    craft, science, forge, mind, source, notes, transfer,
                    social, synth
```

The design is deliberately dependency-free and deterministic. Everything that
can be a file is a file; everything that can be read is text; everything that
is generated is seeded.

---

## License

MIT. See `LICENSE`.

The root of all art is attention.
