nexus/ui/src/api
Nexus Dev 3d2117ee9f fix(nexus): auto-bootstrap invite and vite onnxruntime middleware
Zero-terminal first boot. Previously the bootstrap_ceo invite had to be
created via a CLI command (paperclipai auth bootstrap-ceo) and the UI
showed a code block instructing the user to run it. Nexus is meant to
be zero-terminal, so the server now auto-creates the invite on startup
when no instance admin exists and exposes its relative path through
/api/health. BootstrapPendingPage redirects straight to /invite/{token}.
The CLI command is left intact for headless/SSH-only setups.

Invite flow fixes that surfaced during testing:

  - InviteLanding's invite query had default React Query refetch
    behavior. After a successful bootstrap accept, the invite is marked
    accepted server-side, so the refetch returned "not available" and
    shadowed the success screen, making it look like the bootstrap had
    failed when it actually succeeded. Set staleTime: Infinity +
    refetchOnWindowFocus/Mount/Reconnect: false so the first fetch is a
    one-shot snapshot.

  - Reordered the render checks so result?.kind === "bootstrap" / "join"
    are evaluated before the invite-availability error check — defensive
    against any stray refetch that still leaks through.

  - On bootstrap success, window.location.replace("/") lands the new
    admin directly on the board; the "Bootstrap complete" confirmation
    screen is now an unreachable safety net.

Vite onnxruntime middleware replaces the earlier public/ dump. The
previous commit put ort-wasm-simd-threaded.{mjs,wasm} in ui/public/ so
VAD's onnxWASMBasePath: "/" would find them. That works at runtime but
trips vite's dep optimizer: it scans onnxruntime-web, resolves the
dynamic import string to the public asset, and errors with "files in
/public should not be imported from source code." Remove the files and
add a vite plugin (configureServer middleware) that serves the two URLs
straight from node_modules/.pnpm/onnxruntime-web@*/. Runtime keeps
working and the files never enter vite's module graph.

Production build caveat: the middleware only runs in dev. When building
a static dist for production, the wasm files will need a different
mechanism (e.g. generateBundle hook). Not addressed here.

Also bundled (load-bearing for LAN browser testing):

  - ui/src/lib/queryKeys.ts: add missing 'nexus' group. useNexusMode
    referenced queryKeys.nexus.settings since commit 7bb72a5a (Phase
    33-02) but the key was never added. Caused a blank screen crash on
    any page that mounts Sidebar.

  - ctl.sh: read PORT from .env instead of hardcoding 3100, and read it
    once at the top so every subcommand honors it. Fixes the Version /
    Mode showing '?' in status output after the port move to 6100.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 16:50:28 +00:00
..
access.ts Add company name to invite summaries 2026-03-30 14:14:14 -05:00
activity.ts Add routines automation workflows 2026-03-19 08:39:24 -05:00
agents.ts feat(29-01): adapter probe route, Hermes onboarding fallback, neutral templates 2026-04-04 03:55:49 +00:00
approvals.ts refactor: rename packages to @paperclipai and CLI binary to paperclipai 2026-03-03 08:45:26 -06:00
assets.ts Address Greptile company logo feedback 2026-03-16 10:05:14 -05:00
assistantMemory.ts feat(33-01,33-02): memory service + sanitizer, personal assistant page 2026-04-04 03:55:49 +00:00
auth.ts feat(ui): add auth pages, company rail, inbox redesign, and page improvements 2026-02-23 14:41:21 -06:00
budgets.ts feat(costs): add billing, quota, and budget control plane 2026-03-16 15:11:01 -05:00
chat.ts feat(37-04): add voiceMode to chatApi.postMessageAndStream + useStreamingChat.startStream 2026-04-04 03:55:50 +00:00
client.ts Fix trigger delete: handle 204 No Content in API client 2026-03-19 17:31:27 -05:00
companies.ts Add feedback voting and thumbs capture flow 2026-04-02 09:11:49 -05:00
companySkills.ts feat: scan project workspaces for skills 2026-03-16 19:09:33 -05:00
contentJobs.ts feat: Phase 41 — Diagrams, Icons & Theme Engine (Mermaid, SVG icons, OKLCH palettes) 2026-04-05 09:56:37 +00:00
convert.ts feat: Phase 42 — Wallpapers, Social, Format Conversion & Voice (12 platforms, convert pipeline, offline badge) 2026-04-05 09:56:53 +00:00
costs.ts feat(costs): add billing, quota, and budget control plane 2026-03-16 15:11:01 -05:00
dashboard.ts refactor: rename packages to @paperclipai and CLI binary to paperclipai 2026-03-03 08:45:26 -06:00
execution-workspaces.ts Add workspace runtime controls 2026-03-29 10:55:26 -05:00
goals.ts refactor: rename packages to @paperclipai and CLI binary to paperclipai 2026-03-03 08:45:26 -06:00
hardware.ts feat(39-02): VoiceStep hardware-aware UI with conditional enable/skip 2026-04-04 03:55:50 +00:00
health.ts fix(nexus): auto-bootstrap invite and vite onnxruntime middleware 2026-04-10 16:50:28 +00:00
heartbeats.ts Add workspace operation tracking and fix project properties JSX 2026-03-17 09:36:35 -05:00
index.ts Add routines automation workflows 2026-03-19 08:39:24 -05:00
instanceSettings.ts Add username log censor setting 2026-03-20 08:50:00 -05:00
issues.ts Add feedback voting and thumbs capture flow 2026-04-02 09:11:49 -05:00
ollama.ts feat(28-02): create ollamaApi client and Hermes Ollama model dropdown 2026-04-04 03:55:48 +00:00
plugins.ts Simplify plugin runtime and cleanup lifecycle 2026-03-13 16:58:29 -05:00
projects.ts Add workspace runtime controls 2026-03-29 10:55:26 -05:00
push.ts feat(26-04): create push API client, usePushNotifications hook, and NotificationPermissionPrompt 2026-04-04 03:55:48 +00:00
puter-proxy.ts feat(31-03): add puter-proxy API client and auth/key entry components 2026-04-04 03:55:49 +00:00
routines.ts Improve routine configuration: delete triggers, fix pause, add feedback 2026-03-19 16:45:08 -05:00
secrets.ts refactor: rename packages to @paperclipai and CLI binary to paperclipai 2026-03-03 08:45:26 -06:00
sidebarBadges.ts refactor: rename packages to @paperclipai and CLI binary to paperclipai 2026-03-03 08:45:26 -06:00
skillGroups.ts [nexus] feat(19-03): update API client to use agentId instead of agentSkillsDir 2026-04-04 03:55:42 +00:00
skillRegistry.ts [nexus] feat(19-03): update API client to use agentId instead of agentSkillsDir 2026-04-04 03:55:42 +00:00