UserInput

works.iterative.claude.core.model.UserInput
See theUserInput companion class
object UserInput

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
UserInput.type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def decode(content: List[ContentBlock] | String): Option[UserInput]

Inverts encode from the transcript's user-entry content, which the log parser represents as List[ContentBlock] (a plain-string legacy entry arrives already wrapped as a single TextBlock, and a raw wire string is the String arm).

Inverts encode from the transcript's user-entry content, which the log parser represents as List[ContentBlock] (a plain-string legacy entry arrives already wrapped as a single TextBlock, and a raw wire string is the String arm).

Returns Some only for content this codec produced: the first block is a channel-metadata block, every middle block is a context-metadata block, and the final block is a text block holding the verbatim user text. Anything else — a bare legacy entry, a foreign block list, a plain string — returns None, because encode never produces it.

Attributes

def encode(input: UserInput): List[TextBlock]

Encodes user input as the wire content: a list of text blocks. Every metadata item — the channel and each context item — is its own block carrying library-generated JSON; the verbatim user text is the final block, alone. The CLI accepts this array and the transcript preserves the list, so the structure survives the round trip untouched (no escaping, no grammar over the user's text).

Encodes user input as the wire content: a list of text blocks. Every metadata item — the channel and each context item — is its own block carrying library-generated JSON; the verbatim user text is the final block, alone. The CLI accepts this array and the transcript preserves the list, so the structure survives the round trip untouched (no escaping, no grammar over the user's text).

Attributes