nexus-ai-bridge - Action Report¶
Project: /home/user/Projects/nexus-ai-bridge Created: 2026-08-06
Created nexus-ai-bridge (2026-08-06 02:06)¶
Status: 🔵 DESIGNED — built, not yet tested end-to-end with live backends
What: Rewrote ~/claude/ai-nexus-bridge/server.js as a clean, configurable multi-backend AI bridge server.
Why: Original had hardcoded Perchance.org target, unstable JSDOM dependency, no runtime config, 4+ duplicate client plugins, and key-signing code that served no purpose in this context.
How: - All three backends (aichat, Ollama, custom) share one dispatchChat() function via OpenAI /v1/chat/completions format - Ollama's native /v1/chat/completions endpoint (v0.1.24+) eliminates the old /api/generate adapter - Custom backend: URL + API key + name + model — configurable live from dashboard, saved to gitignored JSON - Config persisted to nexus_ai_bridge_config.json (survives restarts, never committed) - Bind to 127.0.0.1 not 0.0.0.0 — localhost only by default - /health endpoint added (standard NeXuS pattern) - /api/probe — re-test all backends without restart - Typing simulation is non-blocking (response returns immediately; sim fires async) - Dashboard: single-file HTML, no external deps — tabs: Backends/Chat/Controls/History
Files: - nexus_ai_bridge.js — main server (port 7869) - public/dashboard.html — web dashboard - package.json — deps: express, axios, cors (removed jsdom, express-rate-limit) - .gitignore — excludes node_modules + nexus_ai_bridge_config.json - docs/nexus_ai_bridge.help.md — full CLI help + API reference - NOTES.md — running session log + design decisions - README.md
Testing: Not yet tested with live aichat/Ollama backends. Needs: npm install && node nexus_ai_bridge.js, then aichat --serve localhost:3030 or ollama serve.
Dependencies: node + npm; express, axios, cors (auto-installed via npm install)
Streaming + clifm plugin + OC docs (2026-08-06 02:18)¶
Status: 🔵 DESIGNED — all code written, not yet tested with live backends
What: Added SSE streaming passthrough, clifm nexus plugin integration, and OpenCharacters connection docs.
Why: Three pending items from initial build: streaming was the main feature gap; clifm integration makes the service launchable from the hub menu; OC docs closes the AI character loop.
How: Streaming — added backendCoords(model) helper that resolves URL/key/model for the active backend. dispatchChatStream() uses axios responseType:'stream' to pipe the backend SSE response directly to the Express response object. Both /chat and /v1/chat/completions now accept stream:true. Works with aichat, Ollama, custom — any backend that speaks standard SSE.
clifm plugin — three edits to ~/.config/clifm/plugins/nexus.sh: - Port 7869 in _start_service() → launches AIBRIDGE-SVC tmux window - SAB status dot + web entry 'AI Bridge' (key B) → /dashboard, auto-starts - Dir entry 'nexus-ai-bridge' (key b) Synced to ~/git/clifm/plugins/nexus.sh.
OC connection — docs updated in help file: Settings → AI Provider → Custom → http://localhost:7869/v1, key=nexus. Streaming works end-to-end through bridge.
Files: - nexus_ai_bridge.js — backendCoords(), dispatchChatStream(), updated routes - docs/nexus_ai_bridge.help.md — streaming docs, OC connection guide - NOTES.md — decisions logged - ~/.config/clifm/plugins/nexus.sh — port 7869 wired (backed up as .bak) - ~/git/clifm/plugins/nexus.sh — synced