How whoz-oss/coday works
Purpose and topology
Coday is a project-scoped, conversation-based AI-agent framework. Its primary product path is a Node.js web application that manages projects, threads, agents, tools, persistent context, and provider credentials. The repository also contains AgentOS: a Kotlin/Spring service platform with a generated TypeScript client and Angular administration/chat UI.
Primary entry points
• Web distribution/server: apps/web/index.js launches the Node service at apps/server/src/server.ts; CLI packaging begins at apps/server/bin.js.
• Browser client: Angular bootstraps from apps/client/src/main.ts and routes from apps/client/src/app/app.routes.ts.
• Desktop variants: Electron-style main/preload processes are in apps/desktop/src/main.ts and apps/desktop/src/preload.ts; shared lifecycle/IPC code is in libs/desktop-core/src/lib/server-lifecycle.ts.
• AgentOS independently starts as a Spring Boot application at agentos/agentos-service/src/main/kotlin/io/whozoss/agentos/AgentOSApplication.kt.
Coday request and conversation flow
The Node server exposes project, configuration, agent, prompt, scheduler, thread, message, preview, and transcription routes. Core route composition and startup live in apps/server/src/server.ts; long-lived thread execution is coordinated by apps/server/src/lib/thread-coday-manager.ts, while project event publication is handled by apps/server/src/lib/project-event-manager.ts.
A browser action flows from Angular state/API services to server routes, then into service and repository layers. Thread and project state/services are centered in libs/service/src/lib/thread.service.ts, libs/service/src/lib/prompt-execution.service.ts, and libs/service/src/lib/project.service.ts; filesystem-backed persistence boundaries are libs/repository/src/lib/thread-file.repository.ts and libs/repository/src/lib/project-file.repository.ts.
Agent execution, models, and tools
The execution domain models agents, threads, prompts, tool definitions, provider configuration, and events in libs/model/src/lib/agent.ts, libs/model/src/lib/ai-thread.ts, and libs/model/src/lib/coday-tool.ts. Agent orchestration and tool assembly are concentrated in libs/agent/src/lib/agent.service.ts and libs/agent/src/lib/toolbox.ts.
Provider adapters include OpenAI, Anthropic, and Google clients under libs/handler/src/lib/openai.client.ts, libs/handler/src/lib/anthropic.client.ts, and libs/handler/src/lib/google.client.ts. Tool capabilities span local filesystem/shell/Git operations and external systems such as Jira, GitLab, Slack, Confluence, and Basecamp; examples include libs/integrations/file/src/lib/file.tools.ts, libs/integrations/git/src/lib/git.tools.ts, and libs/integrations/jira/src/lib/jira.tools.ts.
Configuration, scope, and MCP boundary
Coday reads layered user/project configuration, including the root coday.yaml; configuration services and migrations are in libs/service/src/lib/config-service-registry.ts, libs/service/src/lib/mcp-config.service.ts, and libs/utils/src/lib/project-config-migrations.ts. MCP servers are modeled and pooled behind libs/mcp/src/lib/mcp-instance-pool.ts and libs/mcp/src/lib/mcp-tools-factory.ts, isolating external stdio/remote tool protocols from agent execution.
AgentOS platform
AgentOS provides REST/SSE APIs and multi-user, namespace-scoped agent execution. Its API contract is agentos/openapi/agentos-openapi.yaml, consumed by libs/agentos-api-client/src/index.ts. Cases are the conversation/runtime unit: agentos/agentos-service/src/main/kotlin/io/whozoss/agentos/caseFlow/CaseRuntime.kt drives execution, .../agent/AgentServiceImpl.kt resolves and runs agents, and .../caseEvent/CaseEventSseController.kt streams lifecycle and content events.
AgentOS discovers plugins and resolves tools through .../plugin/PluginService.kt and .../tool/ToolResolverService.kt. Built-in plugin modules implement filesystem, shell, tmux, datetime, and MCP integrations, notably agentos/agentos-file-plugin/src/main/kotlin/io/whozoss/agentos/plugins/file/FilePlugin.kt and agentos/agentos-mcp-plugin/src/main/kotlin/io/whozoss/agentos/plugins/mcp/McpConnectionPool.kt.
Persistence, security, and deployment
AgentOS persists cases, events, configuration, identities, namespaces, permissions, prompts, and feedback in Neo4j through repository interfaces/implementations such as .../caseFlow/Neo4jCaseRepository.kt, .../caseEvent/Neo4jCaseEventRepository.kt, and .../permissions/Neo4jPermissionRepository.kt. It supports embedded or external Neo4j profiles via agentos/agentos-service/src/main/resources/application.yml and .../config/Neo4jPersistenceConfiguration.kt.
Authentication and declarative authorization form a hard boundary before scoped services: .../security/declarative/AgentOsAuthenticationFilter.kt and .../permissions/PermissionServiceImpl.kt. Container deployment is supplied by agentos/agentos-service/Dockerfile and agentos/docker-compose.yml; the overall monorepo uses Node.js 22+, TypeScript/Nx, Kotlin/Gradle, Spring Boot, Angular, and Neo4j.
Main entry points: agent.service.ts Agent orchestration · server.ts Coday server · thread.service.ts Thread & project services · AgentOsAuthenticationFilter.kt Authentication & permissions
Components 22
Coday
Node.js project-scoped agent application.
- Web distribution
apps/web/index.js - Coday server · Composes API routes and server startup.
apps/server/src/server.ts - Angular client · Routes and state/API services initiate user actions.
apps/client/src/main.ts - Desktop runtime
apps/desktop/src/main.ts - Desktop lifecycle
libs/desktop-core/src/lib/server-lifecycle.ts - Thread coordinator · Coordinates long-lived Coday thread execution.
apps/server/src/lib/thread-coday-manager.ts - Project events
apps/server/src/lib/project-event-manager.ts - Thread & project services · Owns thread, prompt execution, and project operations.
libs/service/src/lib/thread.service.ts - File persistence · Filesystem-backed project and thread state.
libs/repository/src/lib/thread-file.repository.ts - Agent orchestration · Builds agents and executes prompts with tools.
libs/agent/src/lib/agent.service.ts - Agent domain models · Agents, threads, prompts, tools, providers, and events.
libs/model/src/lib/agent.ts - AI providers · OpenAI, Anthropic, and Google clients.
libs/handler/src/lib/openai.client.ts - Tool integrations · Filesystem, shell, Git, and external-system tools.
libs/integrations/file/src/lib/file.tools.ts - MCP boundary · Pools external stdio and remote MCP tool servers.
libs/mcp/src/lib/mcp-instance-pool.ts - Configuration scope · Layered user and project configuration, including MCP.
libs/service/src/lib/config-service-registry.ts
AgentOS
Independent Kotlin/Spring multi-user agent platform.
- AgentOS API · Spring Boot API for namespace-scoped execution.
agentos/agentos-service/src/main/kotlin/io/whozoss/agentos/AgentOSApplication.kt - Authentication & permissions · Authenticates requests and enforces declarative authorization.
agentos/agentos-service/src/main/kotlin/io/whozoss/agentos/security/declarative/AgentOsAuthenticationFilter.kt - Case runtime · Drives AgentOS case execution.
agentos/agentos-service/src/main/kotlin/io/whozoss/agentos/caseFlow/CaseRuntime.kt - AgentOS agent service · Resolves and runs agents for cases.
agentos/agentos-service/src/main/kotlin/io/whozoss/agentos/agent/AgentServiceImpl.kt - Plugins & tools · Discovers plugins and resolves built-in and MCP tools.
agentos/agentos-service/src/main/kotlin/io/whozoss/agentos/plugin/PluginService.kt - Neo4j persistence · Persists cases, events, identities, namespaces, and permissions.
agentos/agentos-service/src/main/kotlin/io/whozoss/agentos/caseFlow/Neo4jCaseRepository.kt - Generated AgentOS client · Consumes the AgentOS OpenAPI contract.
libs/agentos-api-client/src/index.ts
Connections 24
- Web distribution → Coday server: launches
- Angular client → Coday server: API requests
- Desktop runtime → Desktop lifecycle: uses
- Desktop lifecycle → Coday server: manages
- Coday server → Thread coordinator: coordinates threads
- Coday server → Thread & project services: routes invoke
- Coday server → Project events: publishes project events
- Thread & project services → File persistence: persists
- Thread & project services → Agent orchestration: executes prompts
- Thread & project services → Configuration scope: loads scoped config
- Thread coordinator → Agent orchestration: runs agent work
- Agent orchestration → Agent domain models: uses
- Agent orchestration → AI providers: calls models
- Agent orchestration → Tool integrations: assembles tools
- Agent orchestration → MCP boundary: uses MCP tools
- Configuration scope → MCP boundary: configures
- Generated AgentOS client → AgentOS API: REST/SSE client
- AgentOS API → Authentication & permissions: authenticates before services
- Authentication & permissions → Case runtime: authorizes scoped access
- Case runtime → AgentOS agent service: resolves agents
- Case runtime → Neo4j persistence: stores cases and events
- AgentOS agent service → Plugins & tools: resolves tools
- Plugins & tools → MCP boundary: MCP protocol integration
- Authentication & permissions → Neo4j persistence: permissions and identities