# `core/install/alta-os.ts`

<p class="generated-note">Generated from the exports of <a href="https://github.com/altasystem-ai/alta/blob/main/core/install/alta-os.ts"><code>core/install/alta-os.ts</code></a> · <code>npm run docs:gen</code></p>

The contract of the single Alta OS install script (`alta.install/0.1`), shared by the Mac (native, no Docker) and the cloud image (its Dockerfile runs the same script): plan §3.7 and decision P2. Interface only in P0b: the script itself lives in the engine (lot A), the Mac side calls it through `setup.alta-plan|apply|check` (D1, D2), the cloud image through its build (H1). Both read and check its JSON with the functions below. Command line, the same everywhere: install.sh &lt;part&gt; plan [--target macos|docker] --json what would be done, writes nothing install.sh &lt;part&gt; apply [--target macos|docker] --json does it; idempotent (a second apply does nothing) install.sh &lt;part&gt; check [--target macos|docker] --json what is there, writes nothing Nothing chains by itself: the game's quests run the parts in order, with the player's agreement. Environment: ALTA_HOME (default ~/.alta), ALTA_NONINTERACTIVE=1 (never prompts; fails with exit 4 instead). Never a secret in argv, env or output: a sign-in is the `llm.signin` executor's business, not this script's. Exit codes: see EXIT.

**Standards that cite this file**: [alta.install/0.1: the single Alta System OS install script](https://docs.altasystem.ai/reference/advanced/specs/alta-install-0.1)

## Exports

### `INSTALL_SCHEMA` 
```ts
const INSTALL_SCHEMA = "alta.install/0.1"
```

### `Part` 
The parts, each a separate, idempotent command (P2: "machine only" is the only mode).

```ts
type Part = "machine" | "mind" | "memory" | "agents" | "map" | "modules";
```

### `PARTS` 
```ts
const PARTS: readonly Part[]
```

### `Target` 
```ts
type Target = "macos" | "docker";
```

### `TARGETS` 
```ts
const TARGETS: readonly Target[]
```

### `TARGET_OS` 
The OS a target runs on (docker = the Linux image).

```ts
const TARGET_OS: Readonly<Record<Target, OS>>
```

### `Verb` 
```ts
type Verb = "plan" | "apply" | "check";
```

### `EXIT` 
```ts
const EXIT = { ok: 0, failed: 1, badArgs: 2, unsupported: 3, wouldPrompt: 4 } as const
```

### `InstallStep` 
One thing a part does. `writes`: paths under ALTA_HOME or the user's home, shown on the plan card.

```ts
interface InstallStep { id: string; does: string; writes: string[]; needs?: Need[]; /** Already done: apply skips it. */ done?: boolean }
```

### `PartPlan` 
```ts
interface PartPlan { schema: typeof INSTALL_SCHEMA; part: Part; target: Target; steps: InstallStep[] }
```

### `PartCheck` 
```ts
interface PartCheck { schema: typeof INSTALL_SCHEMA; part: Part; target: Target; ok: boolean; present: string[]; missing: string[] }
```

### `PartApply` 
```ts
interface PartApply { schema: typeof INSTALL_SCHEMA; part: Part; target: Target; ok: boolean; did: string[]; skipped: string[]; error?: string }
```

### `InstallOutput` 
```ts
type InstallOutput = PartPlan | PartCheck | PartApply;
```

### `installArgs` 
The argv of a call (the program is resolved by the server's `bins`, never from this).

```ts
function installArgs(part: Part, verb: Verb, target: Target): string[]
```

### `checkInstallOutput` 
Problems of an output of the script for this call (empty = the game can trust its shape).

```ts
function checkInstallOutput(o: unknown, part: Part, verb: Verb, target: Target): string[]
```
