Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/gui-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: GUI Build

on:
pull_request:
paths:
- 'gui/**'
- '.github/workflows/gui-build.yml'
push:
branches: [main]
paths:
- 'gui/**'
- '.github/workflows/gui-build.yml'

permissions:
contents: read

jobs:
build:
name: Build desktop app (Linux)
runs-on: ubuntu-latest
defaults:
run:
working-directory: gui

steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '26'
cache: 'npm'
cache-dependency-path: gui/package-lock.json

- name: Install npm 11.12.1
run: npm install -g npm@11.12.1

# Tauri's Linux build links against the system WebKitGTK/GTK stack.
# See https://tauri.app/start/prerequisites/.
- name: Install Tauri system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libgtk-3-dev \
librsvg2-dev \
libayatana-appindicator3-dev \
libxdo-dev \
libssl-dev

- name: Cache Rust build
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
workspaces: gui/src-tauri

- name: Install dependencies
run: npm ci

# Builds the frontend into gui/dist, which the Rust shell embeds at
# compile time via tauri::generate_context!().
- name: Build frontend
run: npm run build

- name: Build Tauri app
run: cargo build --locked --manifest-path src-tauri/Cargo.toml
24 changes: 24 additions & 0 deletions gui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
3 changes: 3 additions & 0 deletions gui/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"]
}
65 changes: 65 additions & 0 deletions gui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Prism Agent GUI

Desktop GUI for Prism Agent, built with [Tauri](https://tauri.app/)
(Rust shell) + React + TypeScript + Vite.

It provides a chat window that talks to the agent-runtime over WebSocket,
exactly like the `cli/` TUI and `web/` SPA: no auth, the runtime substitutes
the agent/user/thread server-side, recent history loads from
`/single-agent/messages`, and replies stream in as `chat` events. It lives
alongside the existing clients and is a standalone app with its own toolchain;
it is **not** part of the root npm workspaces.

## Prerequisites

- [Rust toolchain](https://www.rust-lang.org/tools/install) (stable)
- Node.js 22+
- Platform dependencies for Tauri — see the
[Tauri prerequisites](https://tauri.app/start/prerequisites/) for your OS.
On macOS this is just the Xcode Command Line Tools.

## Develop

Run the agent-runtime first (from the repo root) so the GUI has something to
talk to:

```bash
npm run dev # agent-runtime on :3003 (needs Bedrock creds in .env for replies)
```

Then, in another terminal:

```bash
cd gui
npm install
npm run tauri dev # or: npm run dev:gui from the repo root
```

`tauri dev` starts Vite (frontend, port 1420) and launches the native window,
rebuilding on changes. Vite proxies `/single-agent`, `/agents`, and `/api/ws`
to the runtime on `:3003` (see `vite.config.ts`), so the webview stays
same-origin — no CORS. This mirrors the web app's dev setup.

To point a packaged build at a runtime directly, set `VITE_RUNTIME_URL`
(e.g. `http://localhost:3003`) at build time; without it the app uses
same-origin URLs (the dev proxy).

## Build

```bash
cd gui
npm run tauri build
```

Produces a platform-native bundle under `src-tauri/target/release/bundle/`.

## Layout

- `src/` — React frontend (Vite)
- `src-tauri/` — Rust application shell, `tauri.conf.json`, icons, capabilities

## Recommended IDE setup

- [VS Code](https://code.visualstudio.com/)
+ [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode)
+ [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)
13 changes: 13 additions & 0 deletions gui/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Prism Agent</title>
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading
Loading