Class: ClaudeMemory::Dashboard::PromptJourney
- Inherits:
-
Object
- Object
- ClaudeMemory::Dashboard::PromptJourney
- Defined in:
- lib/claude_memory/dashboard/prompt_journey.rb
Overview
Per-prompt waterfall view. Calls Store::PromptJourneyQuery to UNION otel_events and activity_events on prompt_id, then shapes results for the frontend (relative timestamps, parsed attributes).
Instance Method Summary collapse
- #for(prompt_id) ⇒ Object
-
#initialize(manager) ⇒ PromptJourney
constructor
A new instance of PromptJourney.
Constructor Details
#initialize(manager) ⇒ PromptJourney
Returns a new instance of PromptJourney.
9 10 11 |
# File 'lib/claude_memory/dashboard/prompt_journey.rb', line 9 def initialize(manager) @manager = manager end |
Instance Method Details
#for(prompt_id) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/claude_memory/dashboard/prompt_journey.rb', line 13 def for(prompt_id) @manager.ensure_global! if @manager.respond_to?(:ensure_global!) && !@manager.global_store @manager.ensure_project! if @manager.respond_to?(:ensure_project!) && !@manager.project_store return empty_payload(prompt_id) unless @manager.global_store || @manager.project_store rows = ClaudeMemory::Store::PromptJourneyQuery.new(@manager).fetch(prompt_id) { prompt_id: prompt_id, event_count: rows.size, events: rows.map { |row| present(row) } } end |