works.iterative.claude.core.model

Members list

Type members

Classlikes

case class AssistantMessage(content: List[ContentBlock], id: Option[MessageId] = ..., parentToolUseId: Option[String] = ..., model: Option[String] = ...) extends Message

An assistant reply on the live stream. id is the vendor uuid when the wire message carries one (synthetic messages may not); parentToolUseId joins subagent output to its sidechain transcript; model is the model that produced the reply.

An assistant reply on the live stream. id is the vendor uuid when the wire message carries one (synthetic messages may not); parentToolUseId joins subagent output to its sidechain transcript; model is the model that produced the reply.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Message
class Object
trait Matchable
class Any
Show all
enum Channel

How a UserInput reached the session. Open vocabulary: Custom carries any channel name we have not given a dedicated case, so the enum is never closed against a new delivery path.

How a UserInput reached the session. Open vocabulary: Custom carries any channel name we have not given a dedicated case, so the enum is never closed against a new delivery path.

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
sealed trait ContentBlock

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes

A single piece of context attached to a UserInput.

A single piece of context attached to a UserInput.

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class ControlRequest(requestId: RequestId, request: ControlRequestBody)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class ControlResponse(requestId: RequestId, subtype: String, payload: Json) extends Message

Reply to a ControlRequest, arriving interleaved on stdout and correlated to its request by the vendor-supplied requestId. payload is the inner response object, e.g. {"still_queued": []} for an interrupt.

Reply to a ControlRequest, arriving interleaved on stdout and correlated to its request by the vendor-supplied requestId. payload is the inner response object, e.g. {"still_queued": []} for an interrupt.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Message
class Object
trait Matchable
class Any
Show all
case class InterruptOutcome(stillQueued: List[String])

The outcome of an Session.interrupt, read from the vendor's control_response.

The outcome of an Session.interrupt, read from the vendor's control_response.

stillQueued is the vendor's still_queued list: inputs that were queued and survived the interrupt rather than being discarded with the stopped turn.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case object KeepAliveMessage extends Message

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Message
class Object
trait Matchable
class Any
Show all
Self type
sealed trait Message

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object MessageId

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
MessageId.type
case class PermissionDenial(json: Json)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class QueryOptions(prompt: String, cwd: Option[String] = ..., executable: Option[String] = ..., executableArgs: Option[List[String]] = ..., pathToClaudeCodeExecutable: Option[String] = ..., maxTurns: Option[Int] = ..., allowedTools: Option[List[String]] = ..., disallowedTools: Option[List[String]] = ..., systemPrompt: Option[String] = ..., appendSystemPrompt: Option[String] = ..., mcpTools: Option[List[String]] = ..., permissionMode: Option[PermissionMode] = ..., continueConversation: Option[Boolean] = ..., resume: Option[String] = ..., model: Option[String] = ..., maxThinkingTokens: Option[Int] = ..., timeout: Option[FiniteDuration] = ..., inheritEnvironment: Option[Boolean] = ..., environmentVariables: Option[Map[String, String]] = ..., strictMcpConfig: Option[Boolean] = ..., mcpConfigPath: Option[String] = ..., settingSources: List[String] = ...)

Configuration options for Claude Code queries.

Configuration options for Claude Code queries.

Maps to Claude Code CLI arguments for subprocess execution.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object QueryOptions

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class RedactedThinkingBlock(data: String) extends ContentBlock

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ContentBlock
class Object
trait Matchable
class Any
Show all
object RequestId

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
RequestId.type
case class ResultMessage(subtype: String, durationMs: Int, durationApiMs: Int, isError: Boolean, numTurns: Int, sessionId: SessionId, totalCostUsd: Option[Double] = ..., usage: Option[TokenUsage] = ..., result: Option[String] = ..., id: Option[MessageId] = ..., origin: Option[ResultOrigin] = ..., stopReason: Option[String] = ..., terminalReason: Option[String] = ..., permissionDenials: List[PermissionDenial] = ..., apiErrorStatus: Option[String] = ..., timings: ResultTimings = ...) extends Message

The end-of-turn envelope on the live stream. origin is None when the result ends an interactive turn — the wire key is absent there — and present when a background task finished; id is the vendor uuid; usage carries real token counts.

The end-of-turn envelope on the live stream. origin is None when the result ends an interactive turn — the wire key is absent there — and present when a background task finished; id is the vendor uuid; usage carries real token counts.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Message
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class ResultTimings(ttftMs: Option[Int] = ..., ttftStreamMs: Option[Int] = ..., timeToRequestMs: Option[Int] = ...)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class SDKUserMessage(content: String, sessionId: String, parentToolUseId: Option[String] = ...)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class SessionEnd(exitCode: Option[Int], error: Option[CLIError])

How a session ended.

How a session ended.

exitCode is the process exit code when one was observed. error is the CLIError a pending waiter should fail with — present when the process died abnormally, None on a clean shutdown.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object SessionId

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
SessionId.type
case class SessionInfo(sessionId: SessionId)

Identifying information about a live session.

Identifying information about a live session.

sessionId is the id the vendor assigned — always a real value, never a sentinel: Session.info blocks until the CLI names the session (via its init message or the first result) rather than returning a placeholder.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class SessionOptions(cwd: Option[String] = ..., executable: Option[String] = ..., executableArgs: Option[List[String]] = ..., pathToClaudeCodeExecutable: Option[String] = ..., maxTurns: Option[Int] = ..., allowedTools: Option[List[String]] = ..., disallowedTools: Option[List[String]] = ..., systemPrompt: Option[String] = ..., appendSystemPrompt: Option[String] = ..., mcpTools: Option[List[String]] = ..., permissionMode: Option[PermissionMode] = ..., continueConversation: Option[Boolean] = ..., resume: Option[String] = ..., model: Option[String] = ..., maxThinkingTokens: Option[Int] = ..., timeout: Option[FiniteDuration] = ..., inheritEnvironment: Option[Boolean] = ..., environmentVariables: Option[Map[String, String]] = ..., strictMcpConfig: Option[Boolean] = ..., mcpConfigPath: Option[String] = ..., settingSources: List[String] = ...)

Configuration options for a Claude Code streaming session.

Configuration options for a Claude Code streaming session.

Contains all fields from QueryOptions except prompt, which is sent per-turn during the session. Fields that are process-level configuration (timeout, inheritEnvironment, environmentVariables, executable, executableArgs, pathToClaudeCodeExecutable) are consumed by the session runner and not translated to CLI flags.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class SessionState(resultsSeen: Long = ..., notificationsSeen: Long = ..., lastResult: Option[ResultMessage] = ..., lastNotification: Option[ResultMessage] = ..., ended: Option[SessionEnd] = ...)

The session's activity state, folded from the message stream.

The session's activity state, folded from the message stream.

Read it to observe completion: resultsSeen is a monotone counter of real turn completions, so a predicate like resultsSeen > n is stable once true and readable at any time — there is no window to lose a race in. A background task finishing bumps notificationsSeen instead, so it can never wake a waiter for a real result.

Value parameters

ended

set once the session's process has ended

lastNotification

the most recent background-task result, if any

lastResult

the most recent real result, if any

notificationsSeen

monotone count of background-task results (wire origin key present)

resultsSeen

monotone count of real results (wire origin key absent)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object SessionState

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
object SessionStdin

The lines a Session writes to the CLI process's stdin.

The lines a Session writes to the CLI process's stdin.

User input is encoded with UserInput.encode into a content-block array, so the verbatim user text is its own block and never concatenates with context — injection is impossible by construction. Control requests use the vendor control protocol correlated by request_id.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
case class StreamEventMessage(data: Map[String, Any]) extends Message

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Message
class Object
trait Matchable
class Any
Show all
case class SystemMessage(subtype: String, data: Map[String, Any]) extends Message

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Message
class Object
trait Matchable
class Any
Show all
case class TextBlock(text: String) extends ContentBlock

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ContentBlock
class Object
trait Matchable
class Any
Show all
case class ThinkingBlock(thinking: String, signature: String) extends ContentBlock

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ContentBlock
class Object
trait Matchable
class Any
Show all
case class TokenUsage(inputTokens: Long, outputTokens: Long, cacheCreationInputTokens: Option[Long], cacheReadInputTokens: Option[Long], serviceTier: Option[String])

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object TokenUsage

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
TokenUsage.type
case class ToolResultBlock(toolUseId: String, content: Option[String] = ..., isError: Option[Boolean] = ...) extends ContentBlock

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ContentBlock
class Object
trait Matchable
class Any
Show all
case class ToolUseBlock(id: String, name: String, input: Map[String, Any]) extends ContentBlock

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ContentBlock
class Object
trait Matchable
class Any
Show all
case class UnknownMessage(messageType: String, json: Json) extends Message

A wire message the parser has no specific type for — the raw JSON survives verbatim. Covers unknown type values and known types whose required fields are missing or malformed. messageType is the wire type value, or empty when the message carries no string type key.

A wire message the parser has no specific type for — the raw JSON survives verbatim. Covers unknown type values and known types whose required fields are missing or malformed. messageType is the wire type value, or empty when the message carries no string type key.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Message
class Object
trait Matchable
class Any
Show all
case class UserInput(text: String, context: List[ContextItem] = ..., channel: Channel = ...)

A user message plus the context and delivery channel that accompany it.

A user message plus the context and delivery channel that accompany it.

text is the human's verbatim message. context is per-message ambient information (what the user is viewing, named instruction blocks, …). channel records how the input reached the session.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object UserInput

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
UserInput.type
case class UserMessage(content: String) extends Message

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Message
class Object
trait Matchable
class Any
Show all

Types

opaque type MessageId
opaque type RequestId
opaque type SessionId