How slopus/happy-agent works
Happy Agent is a local, headless coding-agent runtime that unifies model-specific agent behavior behind durable sessions and a stable client API. A client request enters the daemon, which starts the runtime and binds its API transport; agents then use configured model providers and controlled compute to perform work, with state persisted for later events and sessions. The README also documents MCP, subagents, alternate agent harnesses, mobile synchronization, and remote terminals. Some subsystem paths are supported by the tree or source index but their internals were not sampled, so those connections are omitted or identified as documented at the README level.
Main entry points: Agent.ts Agent behavior · sources Runtime startup · AgentStorage.ts Agent storage · HappyAgentClient.ts Desktop or API client
Components 19
Agent runtime
- Daemon entry
packages/happy-agent/sources/main.ts - Runtime startup
packages/happy-agent-modules/sources - Agent behavior
packages/happy-agent-base/sources/Agent.ts - Agent capabilities
packages/happy-agent-modules/sources
Execution and providers
- Model providers
packages/happy-providers/sources - Compute and policy
packages/happy-agent-modules/sources/compute/ComputeModule.ts - Managed processes
packages/happy-agent-compute/sources/processes/NativeProcessManager.ts
Sessions and state
- Agent storage
packages/happy-agent-base/sources/AgentStorage.ts - Scheduling state
packages/happy-agent-modules/sources/scheduling/SqliteSchedulingStorage.ts - Durable functions
packages/happy-agent-modules/sources/durableFunctions/SqliteDurableFunctionsStorage.ts - User input state
packages/happy-agent-modules/sources/userInput/SqliteUserInputStorage.ts
Client API
- Desktop or API client
packages/happy-agent-client/sources/HappyAgentClient.ts - Daemon API
packages/happy-agent-modules/sources/api/ApiModule.ts - API protocol
packages/happy-agent-client/sources/protocol/agents.ts
Integrations
- Happy mobile sync
packages/happy-agent-modules/sources/happy/HappySessionClient.ts - Alternate harnesses
packages/happy-agent-modules/sources - Remote terminals
packages/ghostty-web/sources/RemoteTerminalProtocolClient.ts - Ghostty terminal
packages/ghostty-wasm/sources/GhosttyTerminal.ts
Other components
- Developer
Connections 19
- Developer → Desktop or API client: uses
- Desktop or API client → Daemon API: requests
- Daemon API → Daemon entry: reaches daemon
- Daemon entry → Runtime startup: starts runtime
packages/happy-agent/sources/main.ts - Runtime startup → Agent behavior: provides runtime
- Agent behavior → Model providers: requests inference
- Agent behavior → Compute and policy: executes tools
- Compute and policy → Managed processes: manages processes
- Agent behavior → Agent storage: persists sessions
- Agent storage → Scheduling state: module migrations
packages/happy-agent-base/sources/AgentStorage.ts - Agent storage → Durable functions: module migrations
packages/happy-agent-base/sources/AgentStorage.ts - Agent storage → User input state: module migrations
packages/happy-agent-base/sources/AgentStorage.ts - Runtime startup → Agent capabilities: loads capabilities
- Agent capabilities → Agent behavior: adds tools
- Daemon API → API protocol: implements contract
- Runtime startup → Happy mobile sync: enables synchronization
- Agent behavior → Alternate harnesses: can delegate loop
- Desktop or API client → Remote terminals: uses terminal API
- Remote terminals → Ghostty terminal: uses Ghostty