Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ __pycache__/
*.egg-info/
dist/
build/
!resources/dev/dream-server-desktop/build/
!resources/dev/dream-server-desktop/build/**

# Logs
*.log
Expand Down
1 change: 1 addition & 0 deletions .gitleaks.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
'''dream-server/installers/phases/06-directories\.sh''',
'''dream-server/installers/macos/lib/env-generator\.sh''',
'''dream-server/installers/windows/lib/env-generator\.ps1''',
'''resources/dev/dream-server-desktop/vendor/hermes-agent/tests/hermes_cli/test_plugins_cmd\.py''',
]
10 changes: 10 additions & 0 deletions resources/dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ A lightweight Docker image containing everything needed to run the DreamServer i

Static HTML download page for `dreamserver.dev/download` (or equivalent). Auto-detects visitor's OS and shows the right installation command. Single-file, no dependencies, deploys anywhere.

### [`dream-server-desktop/`](dream-server-desktop/) — Electron Desktop Shell

Source-first Electron desktop build for Dream Server DESKTOP. It includes the
renderer, shared local runtime, Hermes Agent vendor source, CLI/gRPC entrypoints,
and cross-platform packaging scripts for Windows, Linux, and macOS.

Generated artifacts stay out of Git: `node_modules`, Electron `dist/` output,
Python virtual environments, downloaded standalone Python runtimes, GGUF models,
and machine-specific llama.cpp binaries.

### [`extensions-library/`](extensions-library/) — 33 Service Extensions

**The next wave of DreamServer services.** 17 extensions are already in production — these 33 are being tested for the next release.
Expand Down
24 changes: 24 additions & 0 deletions resources/dev/dream-server-desktop/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
* text=auto eol=lf
*.bat text eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=crlf
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.icns binary
*.mp4 binary
*.wav binary
*.ttf binary
*.woff binary
*.woff2 binary
*.asar binary
*.exe binary
*.dll binary
*.pak binary
*.dat binary
*.bin binary
bin/llama/** filter=lfs diff=lfs merge=lfs -text
src/shaders/** whitespace=-blank-at-eol,-blank-at-eof
vendor/** whitespace=-blank-at-eol,-blank-at-eof
51 changes: 51 additions & 0 deletions resources/dev/dream-server-desktop/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
node_modules/

# Electron/build outputs
dist/
dist-*/
out/
release/
.asar-rebuild/
.asar-rebuild-out/
.asar-rebuild-out-*/
builder-debug.yml
*.blockmap

# Local runtime binaries/models
resources/python/
bin/llama/
/models/
*.gguf

# Local state and logs
.tmp-preview-control.json
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Legacy/extracted root copies that are not used by package.json
/core.js
/main.js
/renderer.js
/index.html
/styles.css
/rebuild-shader.cjs
/*-screen.png

# Python/cache artifacts
**/__pycache__/
*.py[cod]
*.pyo
.pytest_cache/
.ruff_cache/

# Local environment files
.env
.env.*
!.env.example

# Vendored source: keep full local vendor snapshots.
vendor/**/.git/
.vendor-git-backup/
125 changes: 125 additions & 0 deletions resources/dev/dream-server-desktop/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Dream Server DESKTOP

Dream Server DESKTOP is the Electron desktop source tree for the local-first
Dream Server shell. It packages the renderer, Node runtime, Hermes Agent vendor
source, CLI, gRPC server, and build scripts needed to create installable desktop
artifacts.

This directory is source-first by design. It does not commit `node_modules`,
compiled Electron output, Python virtual environments, GGUF models, or
platform-specific llama.cpp binaries.

## What is included

- Electron shell: `app-main.js`, `preload.js`, `src/`
- Shared runtime: `runtime/`
- CLI entrypoint: `bin/dream.js`
- gRPC entrypoint: `runtime/grpc-server.js`
- Hermes Agent vendor source: `vendor/hermes-agent/`
- Browser harness vendor source used by Hermes: `vendor/browser-harness-upstream/`
- Desktop build scripts: `scripts/`

## Requirements

- Node.js 20 or newer
- npm
- `tar` available on PATH
- Internet access when downloading standalone Python runtimes

For a fully local LLM, run an OpenAI-compatible endpoint such as llama.cpp,
Ollama, LM Studio, or the existing Dream Server local model server, then point
the app at that base URL and model in Settings. Models and llama.cpp builds are
machine-specific, so they are intentionally not versioned here.

## Development

```bash
npm install
npm start
```

The first Electron launch prepares Hermes Agent if the `.venv-hermes` virtual
environment is missing. You can also run the setup explicitly:

```bash
npm run setup:hermes
```

Useful overrides:

- `DREAM_HERMES_PYTHON`: absolute path to a Python interpreter
- `DREAM_HERMES_VENV_DIR`: absolute path for the Hermes virtual environment
- `DREAM_APP_USER_DATA`: test-only user-data directory override
- `HERMES_GIT_BASH_PATH`: Git Bash path on Windows when local shell tools need it

## Tests

```bash
npm run test:runtime
```

## Standalone Python Runtime

The desktop builds use python-build-standalone archives and extract them into
`resources/python/<platform>-<arch>/`. These files are generated locally and are
ignored by Git.

Download the runtime for the current platform:

```bash
npm run download:python
```

Download explicit targets:

```bash
npm run download:python:win
npm run download:python:linux
npm run download:python:mac
npm run download:python:all
```

The downloader verifies that the standard library contains `encodings/cp437.py`,
`zipfile.py`, `venv`, and `ensurepip`. On the current host platform it also runs
a Python smoke test. This prevents packaged builds from shipping an incomplete
Python runtime that would later fail in `pip` with errors such as
`LookupError: unknown encoding: cp437`.

## Packaging

Build the unpacked app for the current platform:

```bash
npm run pack
```

Build installable artifacts:

```bash
npm run dist:win
npm run dist:linux
npm run dist:mac
npm run dist:mac-arm64
npm run dist:mac-x64
```

Expected artifacts:

- Windows: portable `.exe`
- Linux: AppImage and `.deb`
- macOS: `.dmg` and `.zip`

`npm run dist:win`, `npm run dist:linux`, and the macOS dist commands download
the matching standalone Python runtime before invoking `electron-builder`.

## Local Models and llama.cpp

This source tree does not include a bundled GGUF model or compiled llama.cpp
server. To use a local model, either:

- configure an OpenAI-compatible endpoint in the desktop Settings screen, or
- place a compatible `llama-server` build under `bin/llama/<platform>-<arch>/`.

The runtime resolver checks canonical platform directories such as
`win32-x64`, `linux-x64`, `darwin-arm64`, and `darwin-x64`, with compatibility
aliases for older local layouts.
29 changes: 29 additions & 0 deletions resources/dev/dream-server-desktop/THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Third Party Notices

This experimental Dream Server Hermes branch vendors Hermes Agent as an
architecture and implementation reference under `vendor/hermes-agent`.

Hermes Agent is distributed under the MIT License:

Copyright (c) 2025 Nous Research

The full license text is available at:

- `vendor/hermes-agent/LICENSE`

This branch uses Hermes through a stdio bridge under `runtime/hermes`, which
launches the vendored Python runtime and imports Hermes' own `AIAgent` rather
than reimplementing its agent loop inside the Electron renderer.

The code workbench shader controls are inspired by Ghostty shader projects:

- `vendor/ghostty-shader-playground` / https://github.com/KroneCorylus/ghostty-shader-playground
- https://github.com/sahaj-b/ghostty-cursor-shaders

Selected GLSL shader files from those MIT-licensed projects are bundled under
`src/shaders/ghostty` and are wrapped at runtime for the Electron code
workbench's WebGL renderer.

The code workbench also bundles JetBrains Mono Regular under `src/fonts` for
Ghostty-like terminal typography. JetBrains Mono is distributed under the SIL
Open Font License; the copied license is `src/fonts/OFL-JetBrainsMono.txt`.
Loading
Loading