# QianjiangClaw

Windows-first Electron desktop shell for a bundled OpenClaw runtime.

## Workspace

- `apps/desktop`: Electron main process and preload bridge
- `apps/ui`: React renderer
- `packages/runtime-manager`: local runtime lifecycle abstraction
- `packages/gateway-client`: Gateway protocol abstraction
- `packages/shared-types`: IPC contracts and shared DTOs
- `vendor/openclaw-runtime`: pinned runtime payload placeholder

## Local Development

- Install dependencies with `corepack pnpm install`
- Start the renderer + desktop shell with `corepack pnpm dev`
- Run workspace type checks with `corepack pnpm typecheck`

## Packaging

- Build a Windows installer with `corepack pnpm package`
- The package flow first runs `build/scripts/materialize-runtime-payload.ps1`
- That script materializes `vendor/openclaw-runtime/` from the local machine, including:
  - bundled `node.exe`
  - the local OpenClaw package entry
  - a copied Python runtime plus locked Python dependencies
  - Playwright Chromium under `vendor/openclaw-runtime/playwright-browsers/`
- `apps/desktop/electron-builder.yml` then copies `vendor/openclaw-runtime/` into the installer as `resources/vendor/openclaw-runtime`

## Runtime Payload And Git

- `vendor/openclaw-runtime/README.md` is tracked as the placeholder for the packaged runtime payload
- Generated runtime payload directories are not source files and should not be committed
- `.gitignore` excludes generated runtime content such as:
  - `vendor/openclaw-runtime/node/`
  - `vendor/openclaw-runtime/openclaw/`
  - `vendor/openclaw-runtime/python/`
  - `vendor/openclaw-runtime/playwright-browsers/`
  - `vendor/openclaw-runtime/runtime-manifest.json`
  - `vendor/openclaw-runtime/config/openclaw.json`
- The Playwright browser binaries are still required in the final installer; they are produced during `materialize:runtime`, not meant to live in Git history

## GitLab CI

- The repo now includes a root `.gitlab-ci.yml` for Windows runners
- `typecheck_windows` installs dependencies and runs `corepack pnpm typecheck`
- `package_windows_installer` is a manual job that runs `corepack pnpm package`
- The packaging job validates the same prerequisites that `materialize-runtime-payload.ps1` needs on a real machine:
  - `node`
  - `python`
  - `openclaw` or `openclaw.cmd`
  - `%USERPROFILE%\.openclaw\openclaw.json`
- The packaging job publishes the generated installer from `dist/installer/`

## Notes

- UI talks to Electron through preload only. Renderer does not touch secrets, runtime files, or child processes directly.
- Installer smoke scripts exist under `build/scripts/`, but they launch a packaged Electron app and are better suited to a desktop-capable Windows machine than a generic CI runner service.
