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

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

Overview

The semantic payload of one confirmation:

  • question — one-line headline the tool composes (e.g. +"OK to overwrite foo.rb: 120 → 245 bytes?"+); the caller owns phrasing, the renderer owns the answer cue.
  • detail — optional preformatted body: the raw bash command, the agent task, nil for Write. When editable, the exact text the human may rewrite, returned as Approved#new_request_detail.
  • editable — whether the human may edit detail (default false); true only when detail is the verbatim payload (the agent task), never a decorated string (bash's "$ <command>").

+question+/+detail+ are RAW LLM-composed text — renderers MUST neutralize them via Sanitizer (see Terminal), plus HTML-escape in a web client.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(question:, detail: nil, editable: false, change: 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 / editable payload

  • editable (Boolean) (defaults to: false)

    whether the human may rewrite detail

  • change (Change, nil) (defaults to: nil)

    optional structured file change; when present a diff-capable chrome renders a diff of it (see Change).



98
99
100
# File 'lib/pikuri/workspace/confirmer.rb', line 98

def initialize(question:, detail: nil, editable: false, change: nil)
  super
end

Instance Attribute Details

#changeObject (readonly)

Returns the value of attribute change

Returns:

  • (Object)

    the current value of change



92
93
94
# File 'lib/pikuri/workspace/confirmer.rb', line 92

def change
  @change
end

#detailObject (readonly)

Returns the value of attribute detail

Returns:

  • (Object)

    the current value of detail



92
93
94
# File 'lib/pikuri/workspace/confirmer.rb', line 92

def detail
  @detail
end

#editableObject (readonly)

Returns the value of attribute editable

Returns:

  • (Object)

    the current value of editable



92
93
94
# File 'lib/pikuri/workspace/confirmer.rb', line 92

def editable
  @editable
end

#questionObject (readonly)

Returns the value of attribute question

Returns:

  • (Object)

    the current value of question



92
93
94
# File 'lib/pikuri/workspace/confirmer.rb', line 92

def question
  @question
end