@omnicross/ui
v0.1.2
Published
Omnicross Control Panel — the React frontend over the daemon admin HTTP API. Published as prebuilt static assets (dist/), served by @omnicross/daemon at /ui; also the frontend for the Tauri desktop shell.
Downloads
87
Readme
@omnicross/ui — Control Panel frontend
The Omnicross Control Panel: a Vite + React frontend wired to the daemon's
localhost admin HTTP API (/admin/api/*). The package publishes only its built
dist/ (static assets, zero runtime deps); the source lives right here. It has
no hard runtime dependency on any shell — the same build runs
- served by the daemon at
http://127.0.0.1:8766/ui(same origin as the admin API — no CORS). This is whatomnicross uilaunches;@omnicross/daemondepends on this package and resolves itsdist/at runtime. - inside the Tauri desktop shell (
../../apps/desktop) — the only Tauri-aware code paths are threeisTauri()-guarded seams (native fetch, thedaemon_statuscommand, tray/autostart settings); in a plain browser they fall back to platformfetch/ a liveness probe / hidden rows. - on the Vite dev server (port 1430). The daemon deliberately sends no
CORS headers, so the dev server proxies
/admin/*to it server-side — the browser only ever talks same-origin, exactly like the production/uiserving. Works against a real daemon or the mock, no.envneeded.
Prerequisites
- Node 18+ and npm. Nothing else for
npm run devat the repo root (it boots the daemon for you); frontend-only dev needs a daemon (or the mock) on127.0.0.1:8766for the proxy to forward to.
Configure (optional)
Zero config by default. .env (see .env.example) is only for unusual setups:
VITE_DAEMON_ADMIN_TOKEN— when the daemon setsadmin.token, put the same value here so requests carryAuthorization: Bearer <token>.VITE_DAEMON_PROXY_TARGET— where the dev proxy forwards/admin/*(defaulthttp://127.0.0.1:8766).VITE_DAEMON_BASE_URL— overrides the client's base URL entirely. Do NOT set it to an absolute URL for browser dev: that bypasses the proxy and cross-origin calls fail by design (the daemon sends no CORS headers).
Run
This is a workspace member — npm install at the repo root installs everything.
# One command, both halves (recommended): daemon on 8766 + Vite on 1430
npm run dev # at the REPO ROOT — seeds omnicross.dev.config.json on first run
# Frontend only (you provide the daemon or the mock on 8766):
npm run dev -w @omnicross/ui # http://localhost:1430 — /admin/* proxied to 127.0.0.1:8766
node scripts/mock-daemon.mjs # or: a no-key mock admin API on 8766For the native desktop window, use the Tauri shell project instead:
cd apps/desktop && npm run dev.
Build / verify
npm run typecheck -w @omnicross/ui # tsc --noEmit
npm run build -w @omnicross/ui # vite build → dist/ (relative-asset base; servable at any mount path)prepack runs the build automatically, so npm publish always ships a fresh
dist/. The daemon serves whatever packages/ui/dist/ holds — rebuild after
frontend changes (or point OMNICROSS_UI_DIST elsewhere).
Architecture
src/daemon/— the typed admin HTTP client (adminClient.ts) + the provider DTO adapter (llmConfigAdapter.ts) that maps the daemon's thin provider DTO to the Provider page's richLLMProvidershape.httpFetch.tsis the transport seam (Tauri plugin-http inside the shell, platformfetchotherwise);adminClient.tspicks the base URL by host context (loopback inside Tauri, same-origin everywhere else — the daemon-served/uidirectly, the Vite dev server via its/adminproxy).src/shared/— the local seam:agent(daemon-pointed, nowindow.native), a single-slicesettingsStore(useLlmProvidersData), auseTranslationshim, andcn.src/shared-types/— the hand-mirrored subset of the daemon/upstreamllm-configtypes the page consumes.src/components/ui/— the ported UI primitives.src/features/— the pages (provider settings, accounts, API service, Code CLI, settings).- The Tauri shell itself lives in
apps/desktop/src-tauri(separate project).
Disabled-when-unbacked controls
The full Provider form is rendered for visual fidelity. Controls whose underlying field has no daemon backing render disabled with a tooltip ("Not yet supported by the daemon") — never hidden, never fake-success. The only hard exclusion is the Electron-only encrypted-credential migration pack.
