activeagent 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +71 -0
- data/README.md +26 -0
- data/lib/active_agent/base.rb +4 -0
- data/lib/active_agent/concerns/view.rb +1 -1
- data/lib/active_agent/dashboard/app/controllers/active_agent/dashboard/api/traces_controller.rb +27 -6
- data/lib/active_agent/dashboard/app/controllers/active_agent/dashboard/application_controller.rb +11 -1
- data/lib/active_agent/dashboard/app/controllers/active_agent/dashboard/dashboard_controller.rb +15 -12
- data/lib/active_agent/dashboard/app/controllers/active_agent/dashboard/traces_controller.rb +27 -7
- data/lib/active_agent/dashboard/app/jobs/active_agent/process_telemetry_traces_job.rb +9 -0
- data/lib/active_agent/dashboard/app/models/active_agent/dashboard/agent.rb +1 -1
- data/lib/active_agent/dashboard/app/models/active_agent/telemetry_trace.rb +18 -2
- data/lib/active_agent/dashboard/app/views/active_agent/dashboard/traces/_trace_detail.html.erb +15 -3
- data/lib/active_agent/dashboard/app/views/active_agent/dashboard/traces/metrics.html.erb +3 -1
- data/lib/active_agent/dashboard/app/views/layouts/active_agent/dashboard/application.html.erb +4 -4
- data/lib/active_agent/dashboard/config/routes.rb +5 -64
- data/lib/active_agent/dashboard/engine.rb +19 -15
- data/lib/active_agent/dashboard.rb +13 -3
- data/lib/active_agent/model_capabilities.rb +89 -0
- data/lib/active_agent/providers/_base_provider.rb +23 -2
- data/lib/active_agent/providers/anthropic/request.rb +3 -1
- data/lib/active_agent/providers/anthropic/transforms.rb +88 -0
- data/lib/active_agent/providers/bedrock_provider.rb +2 -2
- data/lib/active_agent/providers/concerns/exception_handler.rb +12 -1
- data/lib/active_agent/providers/errors.rb +140 -0
- data/lib/active_agent/providers/mock/request.rb +1 -4
- data/lib/active_agent/providers/ollama/chat/transforms.rb +9 -3
- data/lib/active_agent/providers/open_ai/chat_provider.rb +3 -3
- data/lib/active_agent/providers/requesty/_types.rb +16 -0
- data/lib/active_agent/providers/requesty/options.rb +39 -0
- data/lib/active_agent/providers/requesty_provider.rb +63 -0
- data/lib/active_agent/railtie.rb +5 -0
- data/lib/active_agent/telemetry/configuration.rb +112 -172
- data/lib/active_agent/telemetry/instrumentation.rb +137 -14
- data/lib/active_agent/telemetry/reporter.rb +12 -165
- data/lib/active_agent/telemetry/span.rb +18 -245
- data/lib/active_agent/telemetry/tracer.rb +67 -70
- data/lib/active_agent/telemetry.rb +1 -2
- data/lib/active_agent/version.rb +1 -1
- data/lib/active_agent.rb +5 -0
- data/lib/generators/active_agent/dashboard/install_generator.rb +30 -2
- data/lib/generators/active_agent/dashboard/templates/active_agent_dashboard.rb.erb +41 -4
- data/lib/generators/active_agent/dashboard/templates/create_active_agent_telemetry_traces.rb.erb +20 -4
- metadata +39 -16
- data/lib/generators/active_agent/dashboard/install/install_generator.rb +0 -96
- data/lib/generators/active_agent/dashboard/install/templates/initializer.rb +0 -89
- data/lib/generators/active_agent/dashboard/install/templates/migrations/create_active_agent_agent_runs.rb +0 -42
- data/lib/generators/active_agent/dashboard/install/templates/migrations/create_active_agent_agent_templates.rb +0 -38
- data/lib/generators/active_agent/dashboard/install/templates/migrations/create_active_agent_agent_versions.rb +0 -22
- data/lib/generators/active_agent/dashboard/install/templates/migrations/create_active_agent_agents.rb +0 -53
- data/lib/generators/active_agent/dashboard/install/templates/migrations/create_active_agent_sandbox_runs.rb +0 -28
- data/lib/generators/active_agent/dashboard/install/templates/migrations/create_active_agent_sandbox_sessions.rb +0 -43
- data/lib/generators/active_agent/dashboard/install/templates/migrations/create_active_agent_session_recordings.rb +0 -44
- data/lib/generators/active_agent/dashboard/install/templates/migrations/create_active_agent_telemetry_traces.rb +0 -56
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
class CreateActiveAgentSandboxRuns < ActiveRecord::Migration<%= migration_version %>
|
|
4
|
-
def change
|
|
5
|
-
create_table :active_agent_sandbox_runs do |t|
|
|
6
|
-
t.references :sandbox_session, foreign_key: { to_table: :active_agent_sandbox_sessions }, null: true
|
|
7
|
-
|
|
8
|
-
t.text :task, null: false
|
|
9
|
-
t.integer :status, default: 0, null: false
|
|
10
|
-
|
|
11
|
-
# Execution details
|
|
12
|
-
t.text :result
|
|
13
|
-
t.text :error
|
|
14
|
-
t.integer :duration_ms
|
|
15
|
-
t.integer :tokens_used
|
|
16
|
-
t.datetime :started_at
|
|
17
|
-
t.datetime :completed_at
|
|
18
|
-
|
|
19
|
-
# Screenshots
|
|
20
|
-
t.jsonb :screenshots, default: []
|
|
21
|
-
|
|
22
|
-
t.timestamps
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
add_index :active_agent_sandbox_runs, :status
|
|
26
|
-
add_index :active_agent_sandbox_runs, :created_at
|
|
27
|
-
end
|
|
28
|
-
end
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
class CreateActiveAgentSandboxSessions < ActiveRecord::Migration<%= migration_version %>
|
|
4
|
-
def change
|
|
5
|
-
create_table :active_agent_sandbox_sessions do |t|
|
|
6
|
-
t.string :session_id, null: false
|
|
7
|
-
t.references :user, foreign_key: true, null: true
|
|
8
|
-
<% if multi_tenant? -%>
|
|
9
|
-
t.references :account, foreign_key: true, null: true
|
|
10
|
-
<% end -%>
|
|
11
|
-
t.references :agent_template, foreign_key: { to_table: :active_agent_agent_templates }, null: true
|
|
12
|
-
|
|
13
|
-
# Session metadata
|
|
14
|
-
t.string :sandbox_type, default: "playwright_mcp"
|
|
15
|
-
t.integer :status, default: 0
|
|
16
|
-
t.string :cloud_run_job_id
|
|
17
|
-
t.string :cloud_run_url
|
|
18
|
-
|
|
19
|
-
# Execution tracking
|
|
20
|
-
t.integer :runs_count, default: 0
|
|
21
|
-
t.integer :max_runs, default: 10
|
|
22
|
-
t.integer :timeout_seconds, default: 300
|
|
23
|
-
t.datetime :expires_at
|
|
24
|
-
t.datetime :last_activity_at
|
|
25
|
-
|
|
26
|
-
# Resource usage
|
|
27
|
-
t.integer :total_tokens, default: 0
|
|
28
|
-
t.integer :total_duration_ms, default: 0
|
|
29
|
-
|
|
30
|
-
# Results
|
|
31
|
-
t.jsonb :runs, default: []
|
|
32
|
-
t.text :error_message
|
|
33
|
-
|
|
34
|
-
t.timestamps
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
add_index :active_agent_sandbox_sessions, :session_id, unique: true
|
|
38
|
-
add_index :active_agent_sandbox_sessions, :status
|
|
39
|
-
add_index :active_agent_sandbox_sessions, :sandbox_type
|
|
40
|
-
add_index :active_agent_sandbox_sessions, :expires_at
|
|
41
|
-
add_index :active_agent_sandbox_sessions, :cloud_run_job_id
|
|
42
|
-
end
|
|
43
|
-
end
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
class CreateActiveAgentSessionRecordings < ActiveRecord::Migration<%= migration_version %>
|
|
4
|
-
def change
|
|
5
|
-
create_table :active_agent_session_recordings do |t|
|
|
6
|
-
t.references :agent_run, null: true, foreign_key: { to_table: :active_agent_agent_runs }
|
|
7
|
-
t.references :sandbox_session, null: true, foreign_key: { to_table: :active_agent_sandbox_sessions }
|
|
8
|
-
t.string :name
|
|
9
|
-
t.integer :status, default: 0, null: false
|
|
10
|
-
t.integer :duration_ms
|
|
11
|
-
t.integer :action_count, default: 0
|
|
12
|
-
t.jsonb :metadata, default: {}
|
|
13
|
-
t.timestamps
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
create_table :active_agent_recording_actions do |t|
|
|
17
|
-
t.references :session_recording, null: false, foreign_key: { to_table: :active_agent_session_recordings }
|
|
18
|
-
t.string :action_type, null: false
|
|
19
|
-
t.integer :sequence, null: false
|
|
20
|
-
t.integer :timestamp_ms, null: false
|
|
21
|
-
t.string :selector
|
|
22
|
-
t.text :value
|
|
23
|
-
t.string :screenshot_key
|
|
24
|
-
t.string :dom_snapshot_key
|
|
25
|
-
t.jsonb :metadata, default: {}
|
|
26
|
-
t.timestamps
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
add_index :active_agent_recording_actions, [:session_recording_id, :sequence], unique: true, name: "idx_recording_actions_on_recording_and_sequence"
|
|
30
|
-
|
|
31
|
-
create_table :active_agent_recording_snapshots do |t|
|
|
32
|
-
t.references :session_recording, null: false, foreign_key: { to_table: :active_agent_session_recordings }
|
|
33
|
-
t.references :recording_action, null: true, foreign_key: { to_table: :active_agent_recording_actions }
|
|
34
|
-
t.string :storage_key, null: false
|
|
35
|
-
t.string :snapshot_type, null: false
|
|
36
|
-
t.integer :width
|
|
37
|
-
t.integer :height
|
|
38
|
-
t.integer :file_size_bytes
|
|
39
|
-
t.timestamps
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
add_index :active_agent_recording_snapshots, :storage_key, unique: true
|
|
43
|
-
end
|
|
44
|
-
end
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
class CreateActiveAgentTelemetryTraces < ActiveRecord::Migration<%= migration_version %>
|
|
4
|
-
def change
|
|
5
|
-
create_table :active_agent_telemetry_traces do |t|
|
|
6
|
-
<% if multi_tenant? -%>
|
|
7
|
-
t.references :account, foreign_key: true, null: true
|
|
8
|
-
<% end -%>
|
|
9
|
-
|
|
10
|
-
# Trace identification
|
|
11
|
-
t.string :trace_id, null: false
|
|
12
|
-
t.string :service_name
|
|
13
|
-
t.string :environment
|
|
14
|
-
|
|
15
|
-
# Timing
|
|
16
|
-
t.datetime :timestamp, null: false
|
|
17
|
-
|
|
18
|
-
# Span data (JSON array of spans)
|
|
19
|
-
t.jsonb :spans, default: []
|
|
20
|
-
|
|
21
|
-
# Resource attributes
|
|
22
|
-
t.jsonb :resource_attributes, default: {}
|
|
23
|
-
|
|
24
|
-
# SDK info
|
|
25
|
-
t.jsonb :sdk_info, default: {}
|
|
26
|
-
|
|
27
|
-
# Aggregated metrics (for quick queries)
|
|
28
|
-
t.integer :total_duration_ms
|
|
29
|
-
t.integer :total_input_tokens, default: 0
|
|
30
|
-
t.integer :total_output_tokens, default: 0
|
|
31
|
-
t.integer :total_thinking_tokens, default: 0
|
|
32
|
-
|
|
33
|
-
# Status
|
|
34
|
-
t.string :status, default: "UNSET"
|
|
35
|
-
|
|
36
|
-
# Agent info (denormalized for queries)
|
|
37
|
-
t.string :agent_class
|
|
38
|
-
t.string :agent_action
|
|
39
|
-
|
|
40
|
-
# Error info
|
|
41
|
-
t.text :error_message
|
|
42
|
-
|
|
43
|
-
t.timestamps
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
add_index :active_agent_telemetry_traces, :trace_id, unique: true
|
|
47
|
-
add_index :active_agent_telemetry_traces, :timestamp
|
|
48
|
-
add_index :active_agent_telemetry_traces, :service_name
|
|
49
|
-
add_index :active_agent_telemetry_traces, :environment
|
|
50
|
-
add_index :active_agent_telemetry_traces, :agent_class
|
|
51
|
-
add_index :active_agent_telemetry_traces, :status
|
|
52
|
-
<% if multi_tenant? -%>
|
|
53
|
-
add_index :active_agent_telemetry_traces, [:account_id, :timestamp]
|
|
54
|
-
<% end -%>
|
|
55
|
-
end
|
|
56
|
-
end
|