Class: Events::StartMelete

Inherits:
Object
  • Object
show all
Defined in:
lib/events/start_melete.rb

Overview

Emitted when a user_message PendingMessage lands on an idle session. Melete subscribes via Events::Subscribers::MeleteKickoff and runs its enrichment loop — activating skills, reading workflows, refining goals, renaming the session — then either:

  • emits StartMneme when a goal changed during the run, so Mneme can recall against the fresh goal set, or

  • emits StartProcessing when goals were untouched, skipping Mneme entirely (no new search seed to recall against).

First stage of the start_melete → (start_mneme) → start_processing chain that orchestrates context enrichment before the LLM is called.

Constant Summary collapse

TYPE =
"session.start_melete"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(session_id:, pending_message_id: nil) ⇒ StartMelete

Returns a new instance of StartMelete.

Parameters:

  • session_id (Integer)

    session whose enrichment chain should continue

  • pending_message_id (Integer, nil) (defaults to: nil)

    the PendingMessage that triggered the chain



23
24
25
26
# File 'lib/events/start_melete.rb', line 23

def initialize(session_id:, pending_message_id: nil)
  @session_id = session_id
  @pending_message_id = pending_message_id
end

Instance Attribute Details

#pending_message_idObject (readonly)

Returns the value of attribute pending_message_id.



19
20
21
# File 'lib/events/start_melete.rb', line 19

def pending_message_id
  @pending_message_id
end

#session_idObject (readonly)

Returns the value of attribute session_id.



19
20
21
# File 'lib/events/start_melete.rb', line 19

def session_id
  @session_id
end

Instance Method Details

#event_nameObject



28
29
30
# File 'lib/events/start_melete.rb', line 28

def event_name
  "#{Bus::NAMESPACE}.#{TYPE}"
end

#to_hObject



32
33
34
# File 'lib/events/start_melete.rb', line 32

def to_h
  {type: TYPE, session_id:, pending_message_id:}
end