# Vigthoria Workbench v0.2.0

Multi-terminal desktop workspace for the **Vigthoria CLI**.

![Vigthoria Workbench](docs/screenshot-placeholder.png)

## Features

- **Workspace presets** — Agent Solo, Agent + Dev, Full Stack, Deep Analysis
- **Main Agent pane** — starred terminal with `vigthoria agent`, session menu skipped
- **Split panes** — resizable terminals via allotment
- **Highlighted report panel** — agent markdown reports rendered in UI
- **Agent status bar** — live tool count, current tool, run status
- **File tree** — read-only project file listing
- **Folder picker** — browse for workspace root (Windows/macOS/Linux)
- **Settings** — debug/auto-save/auto-approve, CLI path, `vigthoria update`
- **Session restore** — reopens last workspace on launch
- **Deck mode** — structured CLI events (`VIGTHORIA_DECK_MODE=1`) for Workbench UI sync

## Stack

| Layer | Technology |
|-------|------------|
| Shell | Tauri 2 (Rust) |
| Terminals | portable-pty + xterm.js (WebGL) |
| UI | React 19, TypeScript, Zustand |
| Layout | allotment split panes |
| Reports | marked (HTML rendering) |

## Prerequisites

- Node.js 20.19+
- Rust stable ([rustup.rs](https://rustup.rs))
- **Windows**: WebView2, Visual Studio Build Tools
- **macOS**: Xcode Command Line Tools
- **Linux**: webkit2gtk dev packages

## Quick start

```bash
cd /var/www/vigthoria-workbench
npm install
npm run tauri:dev
```

## Production build

```bash
npm run tauri:build
# Output: src-tauri/target/release/bundle/
```

### Windows (your machine)

```powershell
winget install Rustlang.Rustup
winget install OpenJS.NodeJS.LTS
cd C:\path\to\vigthoria-workbench
npm install
npm run tauri:dev
```

Create a workspace:
1. Preset: **Agent + Dev**
2. Browse → `C:\Users\ETM\Desktop\Vigthoria Games\Vigthoria-dominion`
3. **Create workspace**

Left pane runs `vigthoria agent`; right pane runs `npm run dev`. Reports appear in the highlighted panel below.

## Vigthoria CLI integration

Main Agent panes set:

```
VIGTHORIA_NO_SESSION_MENU=1
VIGTHORIA_WORKSPACE=<rootPath>
VIGTHORIA_DECK_MODE=1
VIGTHORIA_DEBUG / VIGTHORIA_AUTO_APPROVE / VIGTHORIA_AUTO_SAVE
```

Deck events (stdout, stripped from terminal display):

```
@vigthoria-deck:{"type":"tool_start","tool":"read_file","index":1,...}
@vigthoria-deck:{"type":"report_ready","markdown":"# Report..."}
@vigthoria-deck:{"type":"run_complete","success":true,"tools":11,...}
```

Requires **vigthoria-cli 1.13.13+**. Workbench release bundles include the
verified 1.13.13 CLI tarball, and the Windows bootstrapper installs or upgrades
to that release when Node.js/npm is available.

## Project layout

```
vigthoria-workbench/
├── src/
│   ├── features/
│   │   ├── agent/       # Status bar, report panel
│   │   ├── files/       # File tree
│   │   ├── settings/    # Settings modal
│   │   ├── terminal/    # XTermPane + deck parsing
│   │   └── workspace/   # Shell, sidebar, presets
│   └── lib/
│       ├── deck-events.ts
│       ├── presets.ts
│       └── tauri-bridge.ts
└── src-tauri/
    └── src/
        ├── pty.rs
        ├── workspace.rs
        ├── settings.rs
        └── fs_util.rs
```

## Roadmap (v0.3)

- Detachable panes / second monitor
- Bridge pane (`vigthoria-bridge`)
- Workspace export/import
- Branded installer on coder.vigthoria.io/releases

## License

MIT — Vigthoria Technologies
