Module: ActiveAgent::Dashboard

Defined in:
lib/active_agent/dashboard.rb,
lib/active_agent/dashboard/engine.rb,
lib/generators/active_agent/dashboard/install_generator.rb,
lib/generators/active_agent/dashboard/install/install_generator.rb,
lib/active_agent/dashboard/app/models/active_agent/dashboard/agent.rb,
lib/active_agent/dashboard/app/models/active_agent/dashboard/agent_run.rb,
lib/active_agent/dashboard/app/models/active_agent/dashboard/sandbox_run.rb,
lib/active_agent/dashboard/app/jobs/active_agent/dashboard/application_job.rb,
lib/active_agent/dashboard/app/models/active_agent/dashboard/agent_version.rb,
lib/active_agent/dashboard/app/models/active_agent/dashboard/agent_template.rb,
lib/active_agent/dashboard/app/models/active_agent/dashboard/sandbox_session.rb,
lib/active_agent/dashboard/app/models/active_agent/dashboard/recording_action.rb,
lib/active_agent/dashboard/app/jobs/active_agent/dashboard/agent_execution_job.rb,
lib/active_agent/dashboard/app/jobs/active_agent/dashboard/sandbox_cleanup_job.rb,
lib/active_agent/dashboard/app/models/active_agent/dashboard/session_recording.rb,
lib/active_agent/dashboard/app/models/active_agent/dashboard/application_record.rb,
lib/active_agent/dashboard/app/models/active_agent/dashboard/recording_snapshot.rb,
lib/active_agent/dashboard/app/jobs/active_agent/dashboard/sandbox_provision_job.rb,
lib/active_agent/dashboard/app/controllers/active_agent/dashboard/traces_controller.rb,
lib/active_agent/dashboard/app/controllers/active_agent/dashboard/dashboard_controller.rb,
lib/active_agent/dashboard/app/controllers/active_agent/dashboard/api/traces_controller.rb,
lib/active_agent/dashboard/app/controllers/active_agent/dashboard/application_controller.rb

Overview

Dashboard engine for visualizing telemetry data and managing agents.

Mount the engine in your routes to access the full dashboard:

# config/routes.rb
mount ActiveAgent::Dashboard::Engine => "/active_agent"

The dashboard provides:

  • Agent management: Create, edit, version, and execute agents

  • Traces view: See all agent invocations with spans, timing, and token usage

  • Metrics view: Aggregate statistics and charts

  • Sandbox execution: Run agents in isolated environments

  • Session recordings: Capture and replay browser sessions

Configuration Modes

Local Mode (default)

For self-hosted, single-tenant deployments:

ActiveAgent::Dashboard.configure do |config|
  config.authentication_method = ->(controller) { controller.authenticate_admin! }
  config.sandbox_service = :local  # Docker/Incus
end

Multi-tenant Mode

For SaaS platforms with multiple accounts:

ActiveAgent::Dashboard.configure do |config|
  config.multi_tenant = true
  config. = "Account"
  config.user_class = "User"
  config. = :current_account
  config.current_user_method = :current_user
  config.authentication_method = ->(controller) { controller.authenticate_user! }
  config.sandbox_service = :cloud_run  # Managed
  config.use_inertia = true
end

Defined Under Namespace

Modules: Api, Generators Classes: Agent, AgentExecutionJob, AgentRun, AgentTemplate, AgentVersion, ApplicationController, ApplicationJob, ApplicationRecord, DashboardController, Engine, InstallGenerator, RecordingAction, RecordingSnapshot, SandboxCleanupJob, SandboxProvisionJob, SandboxRun, SandboxSession, SessionRecording, TracesController

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.account_classString?

Class name for the Account model (multi-tenant mode)

Returns:

  • (String, nil)


56
57
58
# File 'lib/active_agent/dashboard.rb', line 56

def 
  @account_class
end

.authentication_methodProc?

Authentication method to call on controllers

Returns:

  • (Proc, nil)

    A proc that receives the controller instance



48
49
50
# File 'lib/active_agent/dashboard.rb', line 48

def authentication_method
  @authentication_method
end

.base_controller_classString

Base controller class for dashboard controllers

Returns:

  • (String)


96
97
98
# File 'lib/active_agent/dashboard.rb', line 96

def base_controller_class
  @base_controller_class
end

.current_account_methodSymbol?

Method to call on controller to get current account (multi-tenant mode)

Returns:

  • (Symbol, nil)


64
65
66
# File 'lib/active_agent/dashboard.rb', line 64

def 
  @current_account_method
end

.current_user_methodSymbol?

Method to call on controller to get current user

Returns:

  • (Symbol, nil)


68
69
70
# File 'lib/active_agent/dashboard.rb', line 68

def current_user_method
  @current_user_method
end

.layoutString?

Custom layout for the dashboard

Returns:

  • (String, nil)


80
81
82
# File 'lib/active_agent/dashboard.rb', line 80

def layout
  @layout
end

.multi_tenantBoolean

Enable multi-tenant mode (requires account association)

Returns:

  • (Boolean)


52
53
54
# File 'lib/active_agent/dashboard.rb', line 52

def multi_tenant
  @multi_tenant
end

.sandbox_limitsHash?

Custom sandbox limits (overrides defaults)

Returns:

  • (Hash, nil)


88
89
90
# File 'lib/active_agent/dashboard.rb', line 88

def sandbox_limits
  @sandbox_limits
end

.sandbox_serviceSymbol

Sandbox service type (:local, :cloud_run, :kubernetes)

Returns:

  • (Symbol)


84
85
86
# File 'lib/active_agent/dashboard.rb', line 84

def sandbox_service
  @sandbox_service
end

.storage_serviceObject?

Storage service for screenshots/snapshots

Returns:

  • (Object, nil)

    Object responding to #signed_url_for and #fetch_snapshot



92
93
94
# File 'lib/active_agent/dashboard.rb', line 92

def storage_service
  @storage_service
end

.trace_model_classString?

Custom trace model class (for host app overrides)

Returns:

  • (String, nil)


72
73
74
# File 'lib/active_agent/dashboard.rb', line 72

def trace_model_class
  @trace_model_class
end

.use_inertiaBoolean

Enable React/Inertia frontend instead of ERB

Returns:

  • (Boolean)


76
77
78
# File 'lib/active_agent/dashboard.rb', line 76

def use_inertia
  @use_inertia
end

.user_classString?

Class name for the User model

Returns:

  • (String, nil)


60
61
62
# File 'lib/active_agent/dashboard.rb', line 60

def user_class
  @user_class
end

Class Method Details

.agent_modelClass

Returns the agent model class to use.

Returns:

  • (Class)

    The agent model class



119
120
121
# File 'lib/active_agent/dashboard.rb', line 119

def agent_model
  ActiveAgent::Dashboard::Agent
end

.configure {|config| ... } ⇒ Object

Configures the dashboard.

Yields:

  • (config)

    Configuration block



126
127
128
# File 'lib/active_agent/dashboard.rb', line 126

def configure
  yield self
end

.multi_tenant?Boolean

Returns whether multi-tenant mode is enabled.

Returns:

  • (Boolean)


101
102
103
# File 'lib/active_agent/dashboard.rb', line 101

def multi_tenant?
  @multi_tenant == true
end

.reset!Object

Reset configuration to defaults



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/active_agent/dashboard.rb', line 131

def reset!
  @authentication_method = nil
  @multi_tenant = false
  @account_class = nil
  @user_class = nil
  @current_account_method = nil
  @current_user_method = nil
  @trace_model_class = nil
  @use_inertia = false
  @layout = nil
  @sandbox_service = :local
  @sandbox_limits = nil
  @storage_service = nil
  @base_controller_class = "ActionController::Base"
end

.trace_modelClass

Returns the trace model class to use.

Returns:

  • (Class)

    The trace model class



108
109
110
111
112
113
114
# File 'lib/active_agent/dashboard.rb', line 108

def trace_model
  if trace_model_class
    trace_model_class.constantize
  else
    ActiveAgent::TelemetryTrace
  end
end