Class: Pikuri::Code::PlanModeChanged

Inherits:
Data
  • Object
show all
Defined in:
lib/pikuri/code/plan_mode_changed.rb

Overview

Domain event emitted onto the listener stream whenever plan mode transitions — model-driven (EnterPlanMode / ExitPlanMode) or host-driven. Wired by Extension#bind through the shared Workspace::ReadOnly flag's on_change. A pikuri-code domain event, not a core Agent::Event — the loop never reads plan mode; listeners that don't care no-op on it (the demo Agent::Listener::Terminal renders it generically via #to_s).

Carries only the new posture, so a UI listener can render an indicator without touching the flag. A host flip fires on the host's thread, a model flip on the agent's — treat the boolean as the latest authoritative state.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#activeObject (readonly)

Returns the value of attribute active

Returns:

  • (Object)

    the current value of active



16
17
18
# File 'lib/pikuri/code/plan_mode_changed.rb', line 16

def active
  @active
end

Instance Method Details

#to_sString

Returns human-facing label; the Terminal demo prints it verbatim, so the wording lives here, not in core.

Returns:

  • (String)

    human-facing label; the Terminal demo prints it verbatim, so the wording lives here, not in core.



19
20
21
# File 'lib/pikuri/code/plan_mode_changed.rb', line 19

def to_s
  "plan mode: #{active ? 'on (read-only)' : 'off'}"
end