# AetherDesk AI PC Preview Runbook

Generated: 2026-07-01

Use this when `file://` preview is not enough. The AI PC shell behaves more like a real app when served from localhost because browser security, relative assets, clipboard behavior, and future backend checks are closer to normal runtime conditions.

## Start static preview

From any PowerShell prompt:

```powershell
node C:\Users\issda\AetherDesk\scripts\aetherdesk-ai-pc-preview-server.js
```

Default URL:

```text
http://127.0.0.1:5717/?resetDesktop=1
```

Use another port:

```powershell
node C:\Users\issda\AetherDesk\scripts\aetherdesk-ai-pc-preview-server.js 5720
```

Or:

```powershell
$env:AETHERDESK_PREVIEW_PORT='5720'; node C:\Users\issda\AetherDesk\scripts\aetherdesk-ai-pc-preview-server.js
```

## Health check

```text
http://127.0.0.1:5717/api/pc/preview-health
```

This is a static preview health endpoint only. It does not replace the full AetherDesk backend.

## What this server does

- Serves `C:\Users\issda\AetherDesk\aetherdesk\public`.
- Defaults `/` to `index.html`.
- Falls back to `index.html` for unknown GET routes.
- Sends `Cache-Control: no-store` so UI edits refresh more predictably.
- Requires no npm install and no external packages.

## What this server does not do

- It does not implement the real `/api/pc/agent-task` backend.
- It does not run agent tasks.
- It does not write to project files.
- It does not validate UI behavior by itself.

## Suggested validation order

1. Run static marker check when validation is allowed:

```powershell
node C:\Users\issda\AetherDesk\scripts\aetherdesk-ai-pc-static-smoke.js
```

2. Start preview server:

```powershell
node C:\Users\issda\AetherDesk\scripts\aetherdesk-ai-pc-preview-server.js
```

3. Open:

```text
http://127.0.0.1:5717/?resetDesktop=1
```

4. Test the acceptance checklist:

```text
C:\Users\issda\AetherDesk\docs\AETHERDESK_AI_PC_ACCEPTANCE_CHECKLIST.md
```

5. Start with these controls:

- `F2`: Control Map
- `Ctrl+K`: Search
- `Ctrl+Alt+Space`: Mission Modes
- `Ctrl+Alt+Enter`: Ask the AI PC
- `Ctrl+Alt+Shift+Backspace`: Safe Mode

## Notes

The static preview is the safest way to visually test the shell without depending on the full backend. For backend sync behavior, use the full AetherDesk server so `/api/pc/agent-task` exists.

## One-command / double-click foreground launcher

PowerShell launcher:

```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File C:\Users\issda\AetherDesk\scripts\aetherdesk-ai-pc-launch.ps1
```

Double-click wrapper:

```text
C:\Users\issda\AetherDesk\scripts\aetherdesk-ai-pc-launch.cmd
```

Useful options:

```powershell
# Start without opening a browser
powershell -NoProfile -ExecutionPolicy Bypass -File C:\Users\issda\AetherDesk\scripts\aetherdesk-ai-pc-launch.ps1 -NoBrowser

# Start in Safe Mode
powershell -NoProfile -ExecutionPolicy Bypass -File C:\Users\issda\AetherDesk\scripts\aetherdesk-ai-pc-launch.ps1 -SafeMode

# Keep existing desktop session instead of adding ?resetDesktop=1
powershell -NoProfile -ExecutionPolicy Bypass -File C:\Users\issda\AetherDesk\scripts\aetherdesk-ai-pc-launch.ps1 -KeepDesktop

# Use another port
powershell -NoProfile -ExecutionPolicy Bypass -File C:\Users\issda\AetherDesk\scripts\aetherdesk-ai-pc-launch.ps1 -Port 5720
```

This foreground launcher keeps the preview server attached to the terminal. Stop it with `Ctrl+C` in that terminal. It intentionally does not kill background processes or delete PID files.

### CMD wrapper quoting note

The `.cmd` launcher uses normal Windows batch quoting:

```bat
set "SCRIPT_DIR=%~dp0"
powershell -NoProfile -ExecutionPolicy Bypass -File "%SCRIPT_DIR%aetherdesk-ai-pc-launch.ps1"
```

This wrapper is intended for double-click use or for launching from `cmd.exe`. Use the PowerShell launcher directly when you need options like `-SafeMode`, `-KeepDesktop`, or `-Port`.
