> ## Documentation Index
> Fetch the complete documentation index at: https://docs.khanhng.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 2.1 Building Block View

> Building Block View for Kcode Robot Suite.

## 2.1.1 Level 1 - System whitebox

```mermaid theme={"system"}
flowchart TB
    subgraph host[apps/web - Next.js host]
        launcher[Launcher and demo routes]
        runtime[PlatformProvider and PluginRuntime]
        catalog[plugin-catalog]
    end
    config[config/plugins.ts]
    subgraph plugins[plugins/*]
        od[operational-dashboard]
        re[robot-engagement]
        tp[telepresence]
        wb[wheremybot]
    end
    subgraph pkgs[packages/*]
        sdk[plugin-sdk]
        kernel[kernel]
        ds[design-system]
        svc[services]
        shared[shared]
    end
    host --> config --> plugins
    host --> kernel
    host --> svc
    host --> ds
    plugins --> sdk
    plugins --> ds
    kernel --> sdk
    kernel --> shared
    svc --> sdk
```

#### Container responsibilities

| Building block | Responsibility | Technology | Depends on |
| - | - | - | - |
| `apps/web` | Sign-in, launcher, demo routes, and plugin runtime context. | Next.js 15, React 19 | Packages and plugins |
| `packages/plugin-sdk` | Stable plugin contracts and context service interfaces. | TypeScript types | React types only |
| `packages/kernel` | Plugin registry, lifecycle manager, permission service, event bus, and configuration store. | TypeScript | SDK, shared |
| `packages/design-system` | Surface, typography, button, field, table, and status primitives, plus patterns and charts. | React, CSS tokens | None of the plugins |
| `packages/services` | Demo authentication, console logger, and in-memory notifications. | TypeScript | SDK |
| `packages/shared` | Small shared utilities. | TypeScript | None |
| `plugins/*` | One demo each: UI, domain types, services, and mock data. | React, Recharts | SDK, design system |

## 2.1.2 Level 2 - Kernel components

```mermaid theme={"system"}
classDiagram
    direction LR
    class KcodeKernel {
        +registry PluginRegistry
        +events EventBus
        +configuration ConfigurationStore
        +permissions PermissionService
        +lifecycle PluginLifecycleManager
        +createContext(pluginId) PluginContext
    }
    class PluginRegistry {
        +register(plugin)
        +unregister(pluginId)
        +get(pluginId)
        +getAll()
        +getRoutes()
        +getNavigation()
        +getPermissions()
    }
    class PluginLifecycleManager {
        +discover(plugin)
        +register(plugin)
        +initialize(pluginId)
        +activate(pluginId)
        +deactivate(pluginId)
        +dispose(pluginId)
        +getState(pluginId)
    }
    class PermissionService {
        +grant(subjectId, permissionId)
        +revoke(subjectId, permissionId)
        +has(subjectId, permissionId)
        +assert(subjectId, permissionId)
    }
    class InMemoryEventBus {
        +publish(name, payload)
        +subscribe(name, handler)
    }
    class ConfigurationStore {
        +createPluginConfiguration(pluginId, settings)
        +deletePluginConfiguration(pluginId)
    }
    KcodeKernel *-- PluginRegistry
    KcodeKernel *-- PluginLifecycleManager
    KcodeKernel *-- PermissionService
    KcodeKernel *-- InMemoryEventBus
    KcodeKernel *-- ConfigurationStore
    PluginLifecycleManager ..> PluginRegistry : registers plugins
```

## 2.1.3 Level 3 - Bundled plugins

Each plugin follows the same shape: an `index.ts` that exports a `KcodePlugin`, an entry component, domain types, a service interface, and a mock implementation.

| Plugin | Service interfaces | Mock implementations |
| - | - | - |
| `operational-dashboard` | `OperationsService` | `MockOperationsService` |
| `robot-engagement` | `GameService`, `RobotService`, `DeploymentService`, `AnalyticsService` | `MockGameService`, `MockRobotService`, `MockDeploymentService`, `MockAnalyticsService` |
| `telepresence` | `MeetingService`, `AiAssistantService` | `MockMeetingService`, `MockAiAssistantService` |
| `wheremybot` | `RobotService`, `RouteService` | `MockRobotService`, `MockRouteService` |

See [Bundled plugins](https://docs.khanhng.com/kcode-robot-suite/sdk-reference/bundled-plugins/operational-dashboard.md) for each plugin's permissions and settings.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.