How vibicer/xu-harness works
Xu is a personal AI agent harness: a Svelte web shell communicates with a Python brain daemon over one localhost WebSocket. The user’s main workflow is to compose a session turn, have the agent reason with a configured model and invoke tools, then inspect the response and agent activity in the workspace. The brain also exposes session, memory, skills, orchestration, plugin, and backup capabilities. UI and agent details are partly inferred from the README and tree; sampled excerpts confirm plugin extension points, subagent persistence, tool search, and backup behavior, but do not establish every runtime call path.
Main entry points: loop.py Agent loop · tools Tool runtime · store.svelte.ts UI state and RPC · runtime.py Brain daemon
Components 23
Web shell
- Workspace UI
web/src/App.svelte - Chat and sessions
web/src/lib/components/Chat.svelte - UI state and RPC
web/src/lib/store.svelte.ts
Brain runtime
- Brain daemon
brain/xu_brain/core/runtime.py - WebSocket API
brain/xu_brain/core/web.py - Events and context
brain/xu_brain/api/events.py
Agent execution
- Agent loop
brain/xu_brain/features/agent/loop.py - Turn orchestration
brain/xu_brain/features/agent/orchestrator.py - Model providers
brain/xu_brain/features/agent/provider.py - Tool runtime
brain/xu_brain/features/tools
Product features
- Sessions
brain/xu_brain/features/session - Memory
brain/xu_brain/features/memory - Skills
brain/xu_brain/features/skills - Presets
brain/xu_brain/features/presets - Backup and undo
brain/xu_brain/features/backup/manager.py - Undo journal
brain/xu_brain/features/backup/manager.py - Plugin host
brain/xu_brain/core/host.py - Plugin API
brain/xu_brain/api/context.py - MCP client
brain/xu_brain/plugins/builtin/mcp/client.py
Other components
- User
- Model service
- Tool targets
- MCP server process
Connections 22
- User → Chat and sessions: composes turns
- Chat and sessions → UI state and RPC: updates state
- UI state and RPC → WebSocket API: sends RPC
- WebSocket API → Brain daemon: dispatches requests
- Brain daemon → Agent loop: runs agent
- Agent loop → Model providers: requests completion
- Model providers → Model service: calls model
- Agent loop → Tool runtime: invokes tools
- Tool runtime → Tool targets: accesses resources
- Agent loop → Turn orchestration: delegates subagents
- Agent loop → Sessions: uses sessions
- Agent loop → Memory: uses memory
- Agent loop → Skills: uses skills
- Agent loop → Presets: uses presets
- Tool runtime → Backup and undo: backs up mutations
- Backup and undo → Undo journal: journals snapshots
- Brain daemon → Plugin host: loads plugins
- Plugin host → Plugin API: provides context
- Tool runtime → MCP client: bridges tools
- MCP client → MCP server process: speaks stdio
- WebSocket API → UI state and RPC: streams events
- UI state and RPC → Chat and sessions: updates transcript