# PROMPT: One-Shot Terminal — Deep Space Relay OS

## Machine fiction

You are the primary command terminal aboard *ISV Kepler*, a deep-space exploration vessel on a multi-decade mission to chart the Carina-Sagittarius Arm. The terminal — designated **ORBITAL RELAY STATION TERMINAL v4.7** — provides access to ship systems, navigation data, comms logs, and anomaly detection.

The year is 2157. The crew complement is 12. The ship is currently approaching an uncharted nebula cluster designated NC-447. Systems are nominal but the long-haul isolation has produced… irregularities in the logs.

## Command grammar

The shell uses a UNIX-like grammar with keywords drawn from mission-operations vernacular. All commands are lowercase. Arguments are space-delimited. Flags use single-dash prefix where applicable.

### Core commands (minimum 14)

| Command | Args | Effect |
|---|---|---|
| `help [cmd]` | optional command name | List all commands or show detailed help for one |
| `ls [dir]` | optional path | List files and directories |
| `cd <dir>` | path | Change working directory |
| `cat <file>` | file path | Print file contents |
| `scan [-d]` | `-d` for deep scan | Run sensor sweep, detect nearby objects or anomalies |
| `status [system]` | optional system name | Show ship system health; with arg, show specific system |
| `route` | none | Display current navigation route and waypoints |
| `repair <system>` | system name | Attempt repair on a degraded system; consumes power |
| `clear` | none | Clear the terminal output buffer |
| `whoami` | none | Show current user credentials |
| `stardate` | none | Display current mission stardate |
| `history [-c]` | `-c` to clear | Show command history |
| `man <cmd>` | command name | Display full manual page for a command |
| `echo <text>` | arbitrary text | Print text to the terminal |
| `pwd` | none | Print working directory |
| `split [-v\|-h]` | `-v` vertical, `-h` horizontal | Create a new terminal pane |
| `close` | none | Close the active pane |
| `anomaly` | none | Review the latest detected anomaly from the ship's passive sensor array |

### File system

```
/
├── home/
│   └── commander/
│       ├── logs/
│       │   ├── mission-log.txt         ← Current mission log
│       │   ├── anomaly-report.txt      ← Anomaly detection report
│       │   └── comms-transcript.txt    ← Last communication transcript
│       ├── nav/
│       │   ├── current-route.dat       ← Route vector data
│       │   └── star-chart.dat          ← Local star chart data
│       └── systems/
│           ├── life-support.cfg         ← Life support config
│           ├── propulsion.cfg           ← Propulsion system config
│           ├── shields.cfg              ← Shield emitter config
│           └── sensors.cfg              ← Sensor array config
├── etc/
│   ├── hostname                        ← Vessel identifier
│   └── protocols.conf                  ← Communication protocols
└── tmp/
    └── (empty)
```

### System state model

The ship has five subsystems, each with a health value (0–100):

| System | Initial | Degrades |
|---|---|---|
| Life Support | 94 | Slow passive drain |
| Propulsion | 88 | Slow passive drain |
| Shields | 72 | Random event damage |
| Sensors | 96 | Slow passive drain |
| Comms | 65 | Random event damage |

- `status` shows current health for all systems
- `repair <system>` attempts to restore 10–25 points to the named system
- Random anomaly events can damage systems
- If any system drops below 20, the terminal shows a warning banner
- Deep scan (`scan -d`) reveals the anomaly log

### Anomaly event layer

Every 45–120 seconds, a passive-sensor event fires. Events are drawn from a pool:

- "Unidentified signal on subspace band 7 — repeating pattern, 3-second intervals"
- "Gravitational ripple detected — possible micro-singularity at bearing 247.3"
- "Thermal bloom detected in NC-447 — spectral analysis inconsistent with known phenomena"
- "Quantum entanglement fluctuation in comms array — receiver coherence lost for 4.2 seconds"
- "Hull temperature spike on deck 3 — thermal sensors returning inconsistent readings"
- "Electromagnetic pulse from NC-447 — shields absorbed 14% of impact"
- "Bio-signature detected in cargo bay 2 — sensor recalibration recommended"
- "Data corruption in mission-log.txt — parity check failed on sector 7"

Events log to `anomaly-report.txt` and are viewable with `anomaly` command.

## Interaction model

- **Keyboard-first**: Full keyboard navigation. Tab cycles through command suggestions. Up/down arrow for history. Enter executes.
- **Touch fallback**: Large tap targets on mobile. On-screen command buttons for common actions. Auto-focus input on tap.
- **Pane management**: `split -v` creates a vertical split. `split -h` creates a horizontal split. Click to focus a pane. `close` closes the active pane.
- **Command suggestions**: As the user types, a ghost suggestion appears inline. Tab accepts the suggestion.
- **History**: Up/down arrow navigates history. Persisted in sessionStorage.
- **Mobile mode**: Detected below 768px. Bottom-anchored input bar. Swipeable command quick-bar.

## UI direction

### Visual treatment

- **Background**: Deep space — dark navy/indigo gradient with subtle procedural starfield (CSS-only, canvas stars)
- **Terminal chrome**: Glassmorphism panels with thin 1px cyan borders at 30% opacity
- **Text**: Primary text in `#00e5ff` (cyan), secondary in `#ffb74d` (amber), errors in `#ff5252` (red), success in `#69f0ae` (green)
- **Font**: `'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace` stack
- **Scan line effect**: Subtle CSS overlay (optional, low opacity)
- **Status bar**: Top bar showing vessel ID, stardate, subsystem aggregate status, and pane count

### Layout

- **Desktop**: Full viewport terminal with optional split panes. Status bar at top. Input line at bottom of each pane.
- **Mobile**: Single pane with enlarged input. Quick-command strip above the keyboard area. Status bar condensed.

### Typography scale

- Prompt line: 15px
- Output text: 14px
- Help text: 13px
- Status bar: 12px
- Line height: 1.5

## Quality targets

- Commands must alter internal state, not just return flavour text
- File contents must be internally consistent and reward exploration
- Anomaly events must feel diegetic, not random noise
- The `scan` command should return different results over time
- `repair` must have visible effects on `status` output
- History navigation should feel snappy
- Splitting into multiple panes must not break state

## Technical constraints

- Single `index.html` file
- No external images
- No backend calls
- All CSS and JS inline
- sessionStorage for history and system state persistence
- Works in modern browsers (Chrome, Firefox, Safari, Edge)
