Metadata-Version: 2.4
Name: django-moo
Version: 1.4.1
Summary: A game server for hosting text-based online MOO-like games.
Project-URL: Repository, https://gitlab.com/bubblehouse/django-moo
Author-email: Phil Christensen <phil@bubblehouse.org>
License: AGPL
License-File: LICENSE
Requires-Python: <3.12,>=3.11
Requires-Dist: asyncssh[bcrypt]<3,>=2.14.0
Requires-Dist: boto3>=1.42.63
Requires-Dist: celery[redis]<6,>=5.4.0
Requires-Dist: django-ace<2,>=1.32.4
Requires-Dist: django-allauth>=0.63.0
Requires-Dist: django-celery-beat<3,>=2.6.0
Requires-Dist: django-compressor>=4.6.0
Requires-Dist: django-cte>=3.0.0
Requires-Dist: django-extensions>=4.1
Requires-Dist: django-simplesshkey<3,>=2.1.0
Requires-Dist: django-storages>=1.14.6
Requires-Dist: django<5.1,>=5
Requires-Dist: mistune>=3.0.0
Requires-Dist: more-itertools>=10.7.0
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=0.61b0
Requires-Dist: opentelemetry-instrumentation-celery>=0.61b0
Requires-Dist: opentelemetry-instrumentation-django>=0.61b0
Requires-Dist: opentelemetry-instrumentation-psycopg2>=0.61b0
Requires-Dist: opentelemetry-instrumentation-redis>=0.61b0
Requires-Dist: opentelemetry-sdk>=1.40.0
Requires-Dist: packaging>=25.0
Requires-Dist: prompt-toolkit<4,>=3.0.39
Requires-Dist: psycopg2-binary<3,>=2.9.7
Requires-Dist: ptpython<4,>=3.0.23
Requires-Dist: pypager<4,>=3.0.1
Requires-Dist: python-redis-cache>=4.0.2
Requires-Dist: pyyaml>=6.0
Requires-Dist: redis>=5.2.1
Requires-Dist: restrictedpython>=7.0
Requires-Dist: rich>=13.5.3
Requires-Dist: uwsgi<3,>=2.0.22
Requires-Dist: watchdog>=4.0.0
Requires-Dist: webssh<2,>=1.6.2
Description-Content-Type: text/markdown

# DjangoMOO

> "LambdaMOO on Django"

![release](https://gitlab.com/bubblehouse/django-moo/-/badges/release.svg)
![pipeline](https://gitlab.com/bubblehouse/django-moo/badges/main/pipeline.svg?ignore_skipped=true&job=test)
![coverage](https://gitlab.com/bubblehouse/django-moo/badges/main/coverage.svg?job=test%3Acoverage)
![quality](https://bubblehouse.gitlab.io/django-moo/badges/lint.svg)
![docs](https://readthedocs.org/projects/django-moo/badge/?version=latest)

DjangoMOO is a MOO server built on Python and Django. A MOO is a persistent online text world
where objects — rooms, things, players — have properties and verbs (methods) that define how
they behave. Those verbs are written in Python and run in a sandboxed execution environment,
so the world itself is programmable by its inhabitants.

The design follows the LambdaMOO model where it makes sense: a parsed command line, verb
dispatch through the caller's inventory and location, object inheritance, and a permission
system. The implementation is independent — no MOO bytecode, no C — just Python and Django.

**[Documentation](https://django-moo.readthedocs.io/)** |
**[GitLab](https://gitlab.com/bubblehouse/django-moo)** |
**[GitHub mirror](https://github.com/bubblehouse/django-moo)** |
**[PyPI](https://pypi.org/project/django-moo/)**

## What's included

- A LambdaMOO-inspired parser with full dobj/iobj preposition support
- Objects, Properties, Verbs, and a ManyToMany inheritance hierarchy backed by PostgreSQL
- A RestrictedPython verb sandbox with a security-audited allowlist (55+ known escape vectors tested)
- A default bootstrap world: rooms, exits, containers, players, a lighting system, in-world mail,
  and an object placement system
- Browser playable with no client required via WebSocket SSH
- Django admin for browsing and editing the world's objects, properties, and verb source
- Docker + Helm for self-hosting with `docker compose up`
- moo-agent: autonomous LLM agents that inhabit the world via SSH (see below)

## Quick Start

```bash
git clone https://gitlab.com/bubblehouse/django-moo
cd django-moo
docker compose up
```

Bootstrap the database and create your first wizard:

```bash
docker compose run webapp manage.py migrate
docker compose run webapp manage.py collectstatic
docker compose run webapp manage.py moo_init
docker compose run webapp manage.py createsuperuser --username wizard
docker compose run webapp manage.py moo_enableuser --wizard wizard Wizard
```

Connect at <https://localhost/> and log in with the account you just created.

## Interfaces

### Web (WebSocket SSH)

The server is accessible through a browser-based SSH client at `/`. No SSH client needed.

![WebSSH Client Example](https://gitlab.com/bubblehouse/django-moo/-/raw/main/docs/images/webssh-client-example.png)

![WebSSH Editor Example](https://gitlab.com/bubblehouse/django-moo/-/raw/main/docs/images/webssh-editor-example.png)

### SSH

Direct SSH access is also available.

```bash
ssh -p 8022 yourname@localhost
```

![SSH Client Example](https://gitlab.com/bubblehouse/django-moo/-/raw/main/docs/images/ssh-client-example.png)

Hit `Ctrl-D` to disconnect.

#### Changing your password and managing SSH keys

Credentials are managed from inside the world with in-game verbs rather than
the Django admin:

- `@password` — interactively changes your password. Prompts for the old
  password, then the new one twice for confirmation. Wizards may leave the old
  password blank to perform an administrative reset.
- `@keys` — lists your currently registered SSH public keys.
- `@add-key <public-key>` — registers a new SSH public key. The key name is
  taken from the comment field automatically.
- `@remove-key <index>` — removes a key by its index from `@keys`.

Once a key is registered, reconnecting with `ssh -p 8022 yourname@localhost`
skips the password prompt.

### Django Admin

A full Django admin interface is available at `/admin` for managing objects, properties,
verbs, and users.

![Django Admin Example](https://gitlab.com/bubblehouse/django-moo/-/raw/main/docs/images/django-admin-example.png)

## AI agents with moo-agent

[moo-agent](https://gitlab.com/bubblehouse/moo-agent) is a companion package that connects
autonomous LLM agents to DjangoMOO via SSH. Each agent has:

- A SOUL.md personality file (plain text, version-controlled)
- Persistent memory that accumulates across sessions
- Tools for interacting with the world: move, look, take, drop, read, send mail, and more
- Multi-agent orchestration via a Foreman coordination layer

Backends: Anthropic (Claude), AWS Bedrock, and LM Studio for local models.

```bash
pip install moo-agent
moo-agent init --name MyAgent --host localhost --port 8022 --user myagent ./my-agent
moo-agent run ./my-agent
```

Full moo-agent docs: <https://moo-agent.readthedocs.io/>

## LambdaCore attributions

This package is derived from the LambdaMOO and LambdaCore documentation, including the
LambdaCore Programmer's Manual and the LambdaMOO Programmer's Manual. The code was written
without reading the original LambdaCore source; it is an independent reimplementation based
on documented behavior and conventions.

Various verbs have been modified from their LambdaCore equivalents to better fit a Pythonic
codebase: output uses `print()` rather than return values, property access follows Django ORM
patterns, and permission idioms have been updated to account for differences in how this
server dispatches verbs compared to LambdaMOO.

DjangoMOO could not have happened without the work of the following authors:

- *LambdaCore Database User's Manual* (LambdaMOO 1.3, April 1991)
  Mike Prudence (blip), Simon Hunt (Ezeke), Floyd Moore (Phantom),
  Kelly Larson (Zaphod), Al Harrington (geezer)

- *LambdaCore Programmer's Manual* (LambdaMOO 1.8.0p6, Copyright 1991)
  Mike Prudence (blip), Simon Hunt (Ezeke), Floyd Moore (Phantom),
  Kelly Larson (Zaphod), Al Harrington (geezer)

- *LambdaMOO Programmer's Manual* (LambdaMOO 1.8.0p6, March 1997)
  Pavel Curtis (Haakon / Lambda)
