Skip to content

feat: all-in-one secure Reva.exe (single self-contained .NET binary, no Node)#53

Merged
xt0n1-t3ch merged 3 commits into
mainfrom
feat/desktop-allinone-exe
Jun 16, 2026
Merged

feat: all-in-one secure Reva.exe (single self-contained .NET binary, no Node)#53
xt0n1-t3ch merged 3 commits into
mainfrom
feat/desktop-allinone-exe

Conversation

@xt0n1-t3ch

Copy link
Copy Markdown
Owner

Summary

Reva now ships as one secure, self-contained Windows Reva.exe that runs the entire product — UI, API, OCR, and the assistant chat — with no Node runtime and localhost-only. Previously the packaged exe was backend-only and the Next.js UI/Ollama were separate. Single self-contained .NET binary architecture (owner-approved).

What shipped

  • Native .NET chat agent (POST /api/agent): ports the Vercel-AI-SDK tool-loop to .NET via Microsoft.Extensions.AI function invocation over Ollama (OpenAI-compat /v1), with 4 tools (list/get/reconcile/explain) over the existing document workflow + review assembler. Reproduces the AI-SDK UI-message-stream SSE protocol so the existing chat UI is unchanged. Bounded inputs; an unreachable model degrades to a graceful in-stream message.
  • Static frontend (output: 'export'): deleted the Next.js agent route, dropped the ollama-ai-provider-v2 + zod server-only deps, and repointed the chat transport so it is same-origin in the package and CORS-bridged in dev.
  • Single-origin host: .NET serves the static export from wwwroot (default-files + static-files + a SPA fallback that resolves /review etc. to their static HTML, with a web-root containment guard). API + /health keep precedence.
  • Local-model management + security: best-effort auto-start of a local Ollama when installed; GET /api/agent/status; localhost-only bind; no secrets.
  • Packaging: package-windows.ps1 builds the static UI and stages it into wwwroot before the self-contained single-file publish; package-smoke.ps1 asserts the bundled UI is served and the chat streams a UI-message-stream response (graceful without a model); CI installs Node + pnpm to build and smoke-test the full package.

Proof

  • Backend: dotnet build -warnaserror 0/0; dotnet test Unit 39 + Integration 17; dotnet format --verify-no-changes clean. Web: tsc / eslint / next build (export) all 0.
  • Live (dev, same-origin :5187): the all-in-one host serves the UI, the API, and the chat from one origin. curl -X POST /api/agent returns the exact UI-message-stream SSE (start → tool-input/output-available → text deltas → finish → [DONE]); the real frontend chat runs the multi-tool loop and renders a grounded, source-cited answer (Premium USD 4,400,000 vs 5,550,000, etc.). Hard-load of /review resolves via the SPA fallback.
  • Real package: package-windows.ps1 produced Reva.exe (self-contained, native OCR libs self-extracting) + bundled wwwroot. Running the published exe standalone: serves the UI at /, /review via SPA fallback, /api/agent/status reports the model reachable, seeds + OCRs the demo corpus, and shows the first-run tour — one binary handling everything.

Acceptance

One Reva.exe: serves UI + API same-origin on one localhost port; chat works with Ollama and degrades gracefully without it; all features work; package-smoke green in CI; no Node runtime; no secrets.

Closes #52

Port the chat agent from the Next.js route to a native .NET streaming
endpoint (POST /api/agent) so the app needs no Node runtime. The endpoint
runs an Ollama tool-loop (list/get/reconcile/explain over the document
workflow and review assembler) via Microsoft.Extensions.AI function
invocation and reproduces the AI-SDK UI-message-stream SSE protocol, so the
existing chat UI works unchanged. An unreachable model degrades to a
graceful in-stream message instead of a failed request.

Build the frontend as a static export (output: export): delete the Next.js
agent route, drop the ollama-ai-provider-v2 and zod server-only deps, and
point the chat transport at the API host so it is same-origin in the
packaged build and CORS-bridged in dev.

Refs #52
Host the static export from the .NET app: default-files + static-files serve
the build, and a SPA fallback resolves client routes (e.g. /review) to their
static HTML, otherwise to index.html, with a web-root containment guard. API
routes and /health keep precedence. CORS stays dev-only in effect since the
packaged build is single-origin.

Add best-effort local-model management: start a local Ollama if one is
installed but not running, and expose GET /api/agent/status reporting whether
the model is reachable. The chat degrades gracefully when it is not; every
other feature stays fully deterministic.

Refs #52
…kage

The Windows package now builds the static UI (same-origin) and stages it into
wwwroot before the self-contained single-file publish, so one Reva.exe serves
the UI, the API, OCR, and the chat with no Node runtime. The smoke test asserts
the bundled UI is served and the chat endpoint streams a UI-message-stream
response (degrading gracefully without a local model), and CI installs Node and
pnpm so it can build and smoke-test the full package.

Refs #52
@xt0n1-t3ch xt0n1-t3ch merged commit 6674b4e into main Jun 16, 2026
2 checks passed
@xt0n1-t3ch xt0n1-t3ch deleted the feat/desktop-allinone-exe branch June 16, 2026 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Epic — All-in-one secure Reva.exe (single self-contained .NET binary, no Node)

1 participant