# Where to Find Runtime Host Core Files in Apache Maka: Complete Developer Guide

> Find Apache Maka Runtime Host core files easily. Discover their locations in the repository for streamlined development and quick access to essential code.

- Repository: [The Apache Software Foundation/maka](https://github.com/apache/maka)
- Tags: developer-guide
- Published: 2026-08-30

---

**The Runtime Host core files are located primarily in `packages/runtime-host/src/server`, with transport utilities in `packages/runtime-host/src/transport` and foundational policy types in `packages/core/src/`.**

The **Runtime Host** serves as the execution engine for Apache Maka, coordinating policy enforcement, resource management, and secure client communication. Understanding the exact location of Runtime Host core files is essential for developers contributing to the platform or extending its capabilities. This guide maps every critical component to its precise file path within the repository.

## Main Server Entry Point and Kernel

The **server package** (`packages/runtime-host/src/server`) contains the primary entry point and execution loop.

- **Server bootstrap**: The [`index.ts`](https://github.com/apache/maka/blob/main/index.ts) file exposes the Runtime Host as a service and wires together all coordinators, initializing the system with proper dependency injection.

- **Host kernel**: The [`host-kernel.ts`](https://github.com/apache/maka/blob/main/host-kernel.ts) file implements the core execution loop, managing task scheduling, turn control, and lifecycle events. This module contains the central dispatcher that handles incoming work and maintains the host's operational state.

```typescript
// Conceptual import structure for the host kernel
import { HostKernel } from '@maka/runtime-host/server/host-kernel';

```

## Policy Management System

Policy handling in Maka is distributed across three specialized coordinators within the server directory.

- **Policy proxy** ([`runtime-policy-proxy.ts`](https://github.com/apache/maka/blob/main/runtime-policy-proxy.ts)): Bridges incoming policy requests to the internal policy engine, acting as the external interface.

- **Policy coordinator** ([`runtime-policy-coordinator.ts`](https://github.com/apache/maka/blob/main/runtime-policy-coordinator.ts)): Orchestrates policy resolution, activation, and updates across the runtime environment.

- **Policy activation gate** ([`runtime-policy-activation-gate.ts`](https://github.com/apache/maka/blob/main/runtime-policy-activation-gate.ts)): Enforces safety checks and validation before any policy is activated, preventing invalid or unsafe configurations from entering the execution path.

### Core Policy Definitions

The **data models** that these coordinators manipulate reside in the `packages/core/src/` directory:

- **[`runtime-policy.ts`](https://github.com/apache/maka/blob/main/runtime-policy.ts)**: Defines the `RuntimePolicy` interface including inputs, outputs, and execution constraints.
- **[`runtime-event.ts`](https://github.com/apache/maka/blob/main/runtime-event.ts)**: Contains the event schema used by the host to communicate state changes to clients.
- **[`runtime-boundary.ts`](https://github.com/apache/maka/blob/main/runtime-boundary.ts)**: Establishes the host's external contract and API surface types.

```typescript
// Example: Importing core policy types
import { RuntimePolicy } from '@maka/core/runtime-policy';
import { RuntimeEvent } from '@maka/core/runtime-event';

```

## Resource and Session Coordination

Resource lifecycle management is split between projection tracking and active coordination.

**Resource management files**:
- **[`runtime-resource-projection.ts`](https://github.com/apache/maka/blob/main/runtime-resource-projection.ts)**: Tracks the live state of resources such as workspaces and sessions, maintaining an eventually consistent view of the system.
- **[`runtime-resource-coordinator.ts`](https://github.com/apache/maka/blob/main/runtime-resource-coordinator.ts)**: Handles creation, mutation, and deletion operations for runtime resources, executing the actual state transitions.

**Session management**:
Session coordinators (such as [`session-revision-coordinator.ts`](https://github.com/apache/maka/blob/main/session-revision-coordinator.ts)) manage individual session lifecycles including turn control, presence tracking, and revision history. These files follow the naming convention `session-{aspect}-coordinator.ts` within the server directory.

## Transport and Security Layer

Network communication and credential handling operate alongside the core server logic.

**Networking components**:
- **[`websocket-listener.ts`](https://github.com/apache/maka/blob/main/websocket-listener.ts)**: Accepts incoming WebSocket connections on the default `/runtime-host` endpoint, serving as the primary network entry point.

**Transport implementations**:
- **[`websocket-transport.ts`](https://github.com/apache/maka/blob/main/websocket-transport.ts)** and **[`peer-native.ts`](https://github.com/apache/maka/blob/main/peer-native.ts)** (located in `packages/runtime-host/src/transport/`): Provide low-level transport abstractions supporting WebSocket and local IPC communication modes.

**Security**:
- **[`access-credential-store.ts`](https://github.com/apache/maka/blob/main/access-credential-store.ts)**: Persists host-side credentials used for secure client authentication and encrypted communication channels.

## Skill Catalog Management

The **[`skill-catalog-coordinator.ts`](https://github.com/apache/maka/blob/main/skill-catalog-coordinator.ts)** file manages the registry of skills (plugins) available to the host. This coordinator handles skill discovery, loading, and invocation routing, maintaining the catalog that the Host Kernel queries when executing policy-defined tasks.

## Summary

- The **primary Runtime Host core files** live in `packages/runtime-host/src/server/`, implementing the coordination, policy, and resource layers.
- **Transport and networking** utilities reside in the sibling `packages/runtime-host/src/transport/` directory.
- **Type definitions and data structures** for policies and events are defined in `packages/core/src/`.
- Key architectural boundaries include the **Host Kernel** for execution, **Policy Coordinators** for governance, and **Resource Projections** for state management.

## Frequently Asked Questions

### Where is the main entry point for the Apache Maka Runtime Host?

The main entry point is located at [`packages/runtime-host/src/server/index.ts`](https://github.com/apache/maka/blob/main/packages/runtime-host/src/server/index.ts). This file initializes the Host Kernel and wires together all coordinator modules including policy, resource, and session managers.

### What is the difference between the policy proxy and the policy coordinator?

The **policy proxy** ([`runtime-policy-proxy.ts`](https://github.com/apache/maka/blob/main/runtime-policy-proxy.ts)) serves as the external interface for incoming policy requests, while the **policy coordinator** ([`runtime-policy-coordinator.ts`](https://github.com/apache/maka/blob/main/runtime-policy-coordinator.ts)) handles the internal orchestration of policy resolution and lifecycle management. The proxy routes requests inward, and the coordinator executes the logic.

### Which file handles the WebSocket connections for the Runtime Host?

Incoming WebSocket connections are handled by [`packages/runtime-host/src/server/websocket-listener.ts`](https://github.com/apache/maka/blob/main/packages/runtime-host/src/server/websocket-listener.ts), which listens on the `/runtime-host` endpoint. The underlying transport implementation resides in [`packages/runtime-host/src/transport/websocket-transport.ts`](https://github.com/apache/maka/blob/main/packages/runtime-host/src/transport/websocket-transport.ts).

### Where are the core policy type definitions located?

Core policy types are defined in [`packages/core/src/runtime-policy.ts`](https://github.com/apache/maka/blob/main/packages/core/src/runtime-policy.ts), [`runtime-event.ts`](https://github.com/apache/maka/blob/main/runtime-event.ts), and [`runtime-boundary.ts`](https://github.com/apache/maka/blob/main/runtime-boundary.ts). These files establish the data contracts that the Runtime Host implementation in `packages/runtime-host` consumes and produces during execution.