# wago-org/wago architecture

> Architecture diagram of the GitHub repository wago-org/wago, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wago-org/wago
- Repository: https://github.com/wago-org/wago

## Overview

Wago is a pure-Go WebAssembly runtime that compiles Wasm to native code, exposed as both an embeddable Go API and a CLI. The CLI’s principal path is a user invoking `wago` to run a module; the manager dispatches runtime commands, and the runtime executes the module through the engine. Separate capabilities include project/plugin management, standalone compilation, profiling, and installation. The graph combines README-documented product flows with the sampled runtime, manager, installer, and profiling modules; unsampled internals are represented only at supported directory level.

Main entry points: [`wago.go`](https://github.com/wago-org/wago/blob/main/wago.go) (Go Embedding API), [`cli/manager/commands/plugin`](https://github.com/wago-org/wago/tree/main/cli/manager/commands/plugin) (Project and Plugin Commands), [`cli/runtime/main.go`](https://github.com/wago-org/wago/blob/main/cli/runtime/main.go) (Runtime CLI), [`cli/manager/main.go`](https://github.com/wago-org/wago/blob/main/cli/manager/main.go) (Manager CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI and Install"]
  node_manager["Manager CLI<br/>[main.go]"]
  node_runtime_cli["Runtime CLI<br/>[main.go]"]
  node_installer["Installer<br/>[main.go]"]
end

subgraph group_runtime["Wasm Runtime"]
  node_engine["Native Wasm Engine<br/>[engine.go]"]
  node_bounded_engine["Bounded Host Calls"]
  node_guest_storage["Guest Storage API<br/>[guest_storage.go]"]
  node_storage_alloc["Guest GC Allocation"]
  node_api["Go Embedding API<br/>[wago.go]"]
  node_standalone["Standalone Builds"]
end

subgraph group_plugins["Plugins and Projects"]
  node_project_plugins["Project and Plugin Commands"]
  node_plugin_review["Plugin Review<br/>[review.go]"]
  node_registry["Plugin Registry Client<br/>[client.go]"]
end

subgraph group_profile["Profiling"]
  node_profile_capture["Workload Capture<br/>[capture.go]"]
  node_profile_data["Profile Data<br/>[samples.go]"]
  node_profile_cli["Profile Commands<br/>[main.go]"]
end

subgraph group_release["Release Management"]
  node_managed_release["Managed Releases<br/>[release.go]"]
end

node_user(("User"))
node_goapp(("Go Application"))
node_release_service(("Release Service"))

node_user -->|"runs commands"| node_manager
node_manager -->|"dispatches runtime"| node_runtime_cli
node_user -->|"runs modules"| node_runtime_cli
node_runtime_cli -.->|"executes Wasm"| node_engine
node_goapp -->|"embeds runtime"| node_api
node_api -->|"compiles and runs"| node_engine
node_api -->|"dispatches host calls"| node_bounded_engine
node_api -->|"borrows guest state"| node_guest_storage
node_api -->|"allocates GC arrays"| node_storage_alloc
node_user -->|"manages plugins"| node_project_plugins
node_project_plugins -.->|"reviews changes"| node_plugin_review
node_project_plugins -.->|"uses registry"| node_registry
node_user -->|"builds executable"| node_standalone
node_user -->|"profiles workloads"| node_profile_cli
node_profile_cli -->|"starts capture"| node_profile_capture
node_profile_capture -->|"exports profile data"| node_profile_data
node_user -->|"installs Wago"| node_installer
node_installer -->|"dispatches release"| node_managed_release
node_managed_release -.->|"downloads releases"| node_release_service

click node_manager "https://github.com/wago-org/wago/blob/main/cli/manager/main.go"
click node_runtime_cli "https://github.com/wago-org/wago/blob/main/cli/runtime/main.go"
click node_installer "https://github.com/wago-org/wago/blob/main/cli/installer/main.go"
click node_engine "https://github.com/wago-org/wago/blob/main/src/core/runtime/engine.go"
click node_bounded_engine "https://github.com/wago-org/wago/blob/main/src/core/runtime/engine_hostbounded.go"
click node_guest_storage "https://github.com/wago-org/wago/blob/main/src/wago/guest_storage.go"
click node_storage_alloc "https://github.com/wago-org/wago/blob/main/src/wago/guest_storage_alloc.go"
click node_api "https://github.com/wago-org/wago/blob/main/wago.go"
click node_standalone "https://github.com/wago-org/wago/tree/main/cli/standalone"
click node_project_plugins "https://github.com/wago-org/wago/tree/main/cli/manager/commands/plugin"
click node_plugin_review "https://github.com/wago-org/wago/blob/main/cli/manager/internal/plugin/review.go"
click node_registry "https://github.com/wago-org/wago/blob/main/cli/manager/internal/registry/client.go"
click node_profile_capture "https://github.com/wago-org/wago/blob/main/internal/profcapture/capture.go"
click node_profile_data "https://github.com/wago-org/wago/blob/main/profile/samples.go"
click node_profile_cli "https://github.com/wago-org/wago/blob/main/internal/profilecmd/main.go"
click node_managed_release "https://github.com/wago-org/wago/blob/main/internal/managedrelease/release.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_manager,node_runtime_cli,node_installer,node_user toneBlue
class node_engine,node_bounded_engine,node_guest_storage,node_storage_alloc,node_api,node_standalone toneAmber
class node_project_plugins,node_plugin_review,node_registry toneMint
class node_profile_capture,node_profile_data,node_profile_cli toneRose
class node_managed_release,node_goapp,node_release_service toneIndigo
```

## Components

### CLI and Install

- [Manager CLI](https://github.com/wago-org/wago/blob/main/cli/manager/main.go): `cli/manager/main.go`
- [Runtime CLI](https://github.com/wago-org/wago/blob/main/cli/runtime/main.go): `cli/runtime/main.go`
- [Installer](https://github.com/wago-org/wago/blob/main/cli/installer/main.go): `cli/installer/main.go`

### Wasm Runtime

- [Native Wasm Engine](https://github.com/wago-org/wago/blob/main/src/core/runtime/engine.go): `src/core/runtime/engine.go`
- [Bounded Host Calls](https://github.com/wago-org/wago/blob/main/src/core/runtime/engine_hostbounded.go): `src/core/runtime/engine_hostbounded.go`
- [Guest Storage API](https://github.com/wago-org/wago/blob/main/src/wago/guest_storage.go): `src/wago/guest_storage.go`
- [Guest GC Allocation](https://github.com/wago-org/wago/blob/main/src/wago/guest_storage_alloc.go): `src/wago/guest_storage_alloc.go`
- [Go Embedding API](https://github.com/wago-org/wago/blob/main/wago.go): `wago.go`
- [Standalone Builds](https://github.com/wago-org/wago/tree/main/cli/standalone): `cli/standalone`

### Plugins and Projects

- [Project and Plugin Commands](https://github.com/wago-org/wago/tree/main/cli/manager/commands/plugin): `cli/manager/commands/plugin`
- [Plugin Review](https://github.com/wago-org/wago/blob/main/cli/manager/internal/plugin/review.go): `cli/manager/internal/plugin/review.go`
- [Plugin Registry Client](https://github.com/wago-org/wago/blob/main/cli/manager/internal/registry/client.go): `cli/manager/internal/registry/client.go`

### Profiling

- [Workload Capture](https://github.com/wago-org/wago/blob/main/internal/profcapture/capture.go): `internal/profcapture/capture.go`
- [Profile Data](https://github.com/wago-org/wago/blob/main/profile/samples.go): `profile/samples.go`
- [Profile Commands](https://github.com/wago-org/wago/blob/main/internal/profilecmd/main.go): `internal/profilecmd/main.go`

### Release Management

- [Managed Releases](https://github.com/wago-org/wago/blob/main/internal/managedrelease/release.go): `internal/managedrelease/release.go`

### Other components

- **User**
- **Go Application**
- **Release Service**

## Connections

- User → Manager CLI: runs commands (evidence: `cli/manager/main.go`)
- Manager CLI → Runtime CLI: dispatches runtime (evidence: `cli/manager/main.go`)
- User → Runtime CLI: runs modules
- Runtime CLI → Native Wasm Engine: executes Wasm
- Go Application → Go Embedding API: embeds runtime
- Go Embedding API → Native Wasm Engine: compiles and runs
- Go Embedding API → Bounded Host Calls: dispatches host calls
- Go Embedding API → Guest Storage API: borrows guest state (evidence: `src/wago/guest_storage.go`)
- Go Embedding API → Guest GC Allocation: allocates GC arrays (evidence: `src/wago/guest_storage_alloc.go`)
- User → Project and Plugin Commands: manages plugins
- Project and Plugin Commands → Plugin Review: reviews changes
- Project and Plugin Commands → Plugin Registry Client: uses registry
- User → Standalone Builds: builds executable
- User → Profile Commands: profiles workloads (evidence: `internal/profilecmd/main.go`)
- Profile Commands → Workload Capture: starts capture (evidence: `internal/profilecmd/main.go`)
- Workload Capture → Profile Data: exports profile data (evidence: `internal/profcapture/capture.go`)
- User → Installer: installs Wago
- Installer → Managed Releases: dispatches release (evidence: `cli/installer/main.go`)
- Managed Releases → Release Service: downloads releases
