Class: Pikuri::Workspace::Confirmer::Request

Inherits:
Data
  • Object
show all
Defined in:
lib/pikuri/workspace/confirmer.rb

Overview

The semantic payload of one confirmation. Two fields:

  • question — one-line headline composed by the calling tool, e.g. “OK to overwrite foo.rb: 120 → 245 bytes?”. The caller owns the phrasing and punctuation; the renderer owns the answer cue (+“(y/n)?”+, buttons, …).

  • detail — optional preformatted body, possibly multi-line: the raw bash command for Code::Bash, nil for Write. Renderers typically display it monospaced / dimmed.

Both fields are RAW, straight from tool arguments the LLM composed (detail is the command verbatim; question may embed an LLM-written description). Renderers MUST neutralize them before display — route through Sanitizer (see Terminal), and additionally HTML-escape in a web client.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(question:, detail: nil) ⇒ Request

Returns a new instance of Request.

Parameters:

  • question (String)

    one-line headline; caller owns phrasing

  • detail (String, nil) (defaults to: nil)

    optional preformatted body



61
62
63
# File 'lib/pikuri/workspace/confirmer.rb', line 61

def initialize(question:, detail: nil)
  super
end

Instance Attribute Details

#detailObject (readonly)

Returns the value of attribute detail

Returns:

  • (Object)

    the current value of detail



58
59
60
# File 'lib/pikuri/workspace/confirmer.rb', line 58

def detail
  @detail
end

#questionObject (readonly)

Returns the value of attribute question

Returns:

  • (Object)

    the current value of question



58
59
60
# File 'lib/pikuri/workspace/confirmer.rb', line 58

def question
  @question
end