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_class = "Account"
config.user_class = "User"
config.current_account_method = :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
-
.account_class ⇒ String?
Class name for the Account model (multi-tenant mode).
-
.authentication_method ⇒ Proc?
Authentication method to call on controllers.
-
.base_controller_class ⇒ String
Base controller class for dashboard controllers.
-
.current_account_method ⇒ Symbol?
Method to call on controller to get current account (multi-tenant mode).
-
.current_user_method ⇒ Symbol?
Method to call on controller to get current user.
-
.layout ⇒ String?
Custom layout for the dashboard.
-
.multi_tenant ⇒ Boolean
Enable multi-tenant mode (requires account association).
-
.sandbox_limits ⇒ Hash?
Custom sandbox limits (overrides defaults).
-
.sandbox_service ⇒ Symbol
Sandbox service type (:local, :cloud_run, :kubernetes).
-
.storage_service ⇒ Object?
Storage service for screenshots/snapshots.
-
.trace_model_class ⇒ String?
Custom trace model class (for host app overrides).
-
.use_inertia ⇒ Boolean
Enable React/Inertia frontend instead of ERB.
-
.user_class ⇒ String?
Class name for the User model.
Class Method Summary collapse
-
.agent_model ⇒ Class
Returns the agent model class to use.
-
.configure {|config| ... } ⇒ Object
Configures the dashboard.
-
.multi_tenant? ⇒ Boolean
Returns whether multi-tenant mode is enabled.
-
.reset! ⇒ Object
Reset configuration to defaults.
-
.trace_model ⇒ Class
Returns the trace model class to use.
Class Attribute Details
.account_class ⇒ String?
Class name for the Account model (multi-tenant mode)
56 57 58 |
# File 'lib/active_agent/dashboard.rb', line 56 def account_class @account_class end |
.authentication_method ⇒ Proc?
Authentication method to call on controllers
48 49 50 |
# File 'lib/active_agent/dashboard.rb', line 48 def authentication_method @authentication_method end |
.base_controller_class ⇒ String
Base controller class for dashboard controllers
96 97 98 |
# File 'lib/active_agent/dashboard.rb', line 96 def base_controller_class @base_controller_class end |
.current_account_method ⇒ Symbol?
Method to call on controller to get current account (multi-tenant mode)
64 65 66 |
# File 'lib/active_agent/dashboard.rb', line 64 def current_account_method @current_account_method end |
.current_user_method ⇒ Symbol?
Method to call on controller to get current user
68 69 70 |
# File 'lib/active_agent/dashboard.rb', line 68 def current_user_method @current_user_method end |
.layout ⇒ String?
Custom layout for the dashboard
80 81 82 |
# File 'lib/active_agent/dashboard.rb', line 80 def layout @layout end |
.multi_tenant ⇒ Boolean
Enable multi-tenant mode (requires account association)
52 53 54 |
# File 'lib/active_agent/dashboard.rb', line 52 def multi_tenant @multi_tenant end |
.sandbox_limits ⇒ Hash?
Custom sandbox limits (overrides defaults)
88 89 90 |
# File 'lib/active_agent/dashboard.rb', line 88 def sandbox_limits @sandbox_limits end |
.sandbox_service ⇒ Symbol
Sandbox service type (:local, :cloud_run, :kubernetes)
84 85 86 |
# File 'lib/active_agent/dashboard.rb', line 84 def sandbox_service @sandbox_service end |
.storage_service ⇒ Object?
Storage service for screenshots/snapshots
92 93 94 |
# File 'lib/active_agent/dashboard.rb', line 92 def storage_service @storage_service end |
.trace_model_class ⇒ String?
Custom trace model class (for host app overrides)
72 73 74 |
# File 'lib/active_agent/dashboard.rb', line 72 def trace_model_class @trace_model_class end |
.use_inertia ⇒ Boolean
Enable React/Inertia frontend instead of ERB
76 77 78 |
# File 'lib/active_agent/dashboard.rb', line 76 def use_inertia @use_inertia end |
.user_class ⇒ String?
Class name for the User model
60 61 62 |
# File 'lib/active_agent/dashboard.rb', line 60 def user_class @user_class end |
Class Method Details
.agent_model ⇒ Class
Returns the agent model class to use.
119 120 121 |
# File 'lib/active_agent/dashboard.rb', line 119 def agent_model ActiveAgent::Dashboard::Agent end |
.configure {|config| ... } ⇒ Object
Configures the dashboard.
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.
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_model ⇒ Class
Returns the trace model class to use.
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 |