How louchi1984-coder/ow-bridge works
OW Bridge is a cross-platform tray application that exposes isolated OpenCode models to WorkBuddy through a local OpenAI-compatible API. The primary workflow is: prepare the runtime, discover and test models, optionally import usable models into WorkBuddy, then translate WorkBuddy chat requests and tool proposals through the gateway. The graph includes the UI, lifecycle/orchestration, request-processing stages, and configuration integrations. README capabilities are included where their source was not sampled; those subsystem paths use the existing enclosing source directory.
Main entry points: main.js Service orchestrator · main.cjs Desktop lifecycle · server.js Local API server · backend.js Completion backend
Components 24
Desktop interface
- Desktop lifecycle
desktop/main.cjs - IPC bridge
desktop/preload.cjs - Control panel
desktop/renderer.js - Activity display
desktop/activity.cjs
Service orchestration
- Service orchestrator
src/main.js - Model probing
src/probe.js - Model capabilities
src/model-status.js - Runtime status
src/main.js
Model gateway
- Local API server
src/server.js - Request protocol
src/protocol.js - Completion backend
src/backend.js - Tool handoff
src/handoff.js - Format repair
src/repair.js - Reasoning mapping
src/reasoning.js
Runtime and integrations
- Runtime manager
src/runtime.js - Platform support
src/platform.js - WorkBuddy config sync
src/sync.js - Config discovery
src/workbuddy-config.js - System proxy
src/system-proxy.js - Local settings
src/main.js
Other components
- User
- WorkBuddy
- OpenCode runtime
- Official npm
Connections 40
- User → Desktop lifecycle: uses
- Desktop lifecycle → Control panel: loads panel
- Control panel → IPC bridge: requests actions
- IPC bridge → Desktop lifecycle: invokes IPC
- Desktop lifecycle → Service orchestrator: starts service
- Desktop lifecycle → Runtime status: reads status
- Desktop lifecycle → Local API server: sends admin requests
- Desktop lifecycle → Activity display: formats activity
- Service orchestrator → Runtime manager: finds and starts
- Runtime manager → Platform support: selects package
- Runtime manager → Official npm: downloads runtime
- Runtime manager → OpenCode runtime: starts isolated server
- Service orchestrator → Local API server: creates API
- Service orchestrator → Model probing: starts detection
- Service orchestrator → WorkBuddy config sync: syncs published models
- Service orchestrator → Config discovery: resolves config
- Service orchestrator → System proxy: configures proxy
- Service orchestrator → Runtime status: updates
- Service orchestrator → Local settings: reads and writes
- Local API server → Request protocol: validates requests
- Local API server → Completion backend: completes chat
- Local API server → Model probing: dispatches probe
- Local API server → Service orchestrator: dispatches admin actions
- Local API server → WorkBuddy: serves chat API
- WorkBuddy → Local API server: sends chat requests
- Request protocol → Reasoning mapping: maps effort
- Completion backend → OpenCode runtime: requests completions and events
- Completion backend → Tool handoff: validates tool actions
- Completion backend → Format repair: repairs failed output
- Completion backend → WorkBuddy: returns tool proposals
- Model probing → OpenCode runtime: checks models
- Model probing → Model capabilities: records capabilities
- Service orchestrator → Model capabilities: publishes model state
- WorkBuddy config sync → Config discovery: uses config path
- WorkBuddy config sync → WorkBuddy: writes model entries
- WorkBuddy → Tool handoff: executes proposed tools
- Service orchestrator → OpenCode runtime: reads model catalog
- Service orchestrator → Runtime status: records request activity
- Runtime status → Desktop lifecycle: supplies activity state
- Control panel → Config discovery: requests config selection