Class: Insika::Event

Inherits:
Data
  • Object
show all
Defined in:
lib/insika/event.rb

Overview

Everything the runtime emits is an Event: a closed canonical catalog — new types require updating the catalog.

meta: { task_id:, session_id:, seq:, at: } (seq monotonic per task). Terminal turn events are :task_completed / :task_failed / :task_cancelled. :error is NOT a terminal twin — it survives only as the subscription-overflow signal (EventStream) and the post-terminal failure report (fail_task).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, data:, meta: {}) ⇒ Event

Returns a new instance of Event.



12
13
14
# File 'lib/insika/event.rb', line 12

def initialize(type:, data:, meta: {})
  super
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data

Returns:

  • (Object)

    the current value of data



11
12
13
# File 'lib/insika/event.rb', line 11

def data
  @data
end

#metaObject (readonly)

Returns the value of attribute meta

Returns:

  • (Object)

    the current value of meta



11
12
13
# File 'lib/insika/event.rb', line 11

def meta
  @meta
end

#typeObject (readonly)

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



11
12
13
# File 'lib/insika/event.rb', line 11

def type
  @type
end

Instance Method Details

#to_hObject



16
# File 'lib/insika/event.rb', line 16

def to_h = { type:, **data, meta: meta.compact }