wsapi

package
v0.40.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package wsapi holds Peen's generated WebSocket contract types, decoded and validated from api/asyncapi.yaml.

Index

Constants

View Source
const (
	// Payload: MessageSend.
	MessageSocketMessageSend = "socket_messageSend"
	// Payload: ServerEvent.
	MessageSocketServerEvent = "socket_serverEvent"
)

Message names, as the spec gives them.

View Source
const (
	// Connects with the `peen.v1` subprotocol, or `peen.bearer.<base64url token>` to also carry a bearer token in the handshake. An optional `?sessionId=<uuid>` query parameter filters the connection's live frames to one session; without it the connection receives every accepted session's frames.
	ServerPeenURL = "ws://127.0.0.1:8080/ws/v1"
)

Server URLs, with any server variables at their defaults.

View Source
const SocketAddressTemplate = "/ws/v1"

SocketAddressTemplate is the address of the Socket channel.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentRunAnswer

type AgentRunAnswer struct {
	// Not enforced by the generated code: format uuid.
	ID        string             `json:"id"`
	Type      string             `json:"type"`
	Data      AgentRunAnswerData `json:"data"`
	Timestamp int64              `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (AgentRunAnswer) MarshalJSON

func (v AgentRunAnswer) MarshalJSON() ([]byte, error)

MarshalJSON encodes AgentRunAnswer with its const properties filled in.

func (*AgentRunAnswer) UnmarshalJSON

func (v *AgentRunAnswer) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunAnswer strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunAnswer) Validate

func (v AgentRunAnswer) Validate() error

Validate checks the constraints the schema declares for AgentRunAnswer.

type AgentRunAnswerData

type AgentRunAnswerData struct {
	// Not enforced by the generated code: format uuid.
	AgentRunID string `json:"agentRunId"`
	// Not enforced by the generated code: format uuid.
	ParentTurnID string `json:"parentTurnId"`
	// Not enforced by the generated code: format uuid.
	ParentAgentRunID *string          `json:"parentAgentRunId,omitempty"`
	Event            QuestionAnswered `json:"event"`
}

func (*AgentRunAnswerData) UnmarshalJSON

func (v *AgentRunAnswerData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunAnswerData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunAnswerData) Validate

func (v AgentRunAnswerData) Validate() error

Validate checks the constraints the schema declares for AgentRunAnswerData.

type AgentRunAssistantMessage

type AgentRunAssistantMessage struct {
	// Not enforced by the generated code: format uuid.
	ID        string                       `json:"id"`
	Type      string                       `json:"type"`
	Data      AgentRunAssistantMessageData `json:"data"`
	Timestamp int64                        `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (AgentRunAssistantMessage) MarshalJSON

func (v AgentRunAssistantMessage) MarshalJSON() ([]byte, error)

MarshalJSON encodes AgentRunAssistantMessage with its const properties filled in.

func (*AgentRunAssistantMessage) UnmarshalJSON

func (v *AgentRunAssistantMessage) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunAssistantMessage strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunAssistantMessage) Validate

func (v AgentRunAssistantMessage) Validate() error

Validate checks the constraints the schema declares for AgentRunAssistantMessage.

type AgentRunAssistantMessageData

type AgentRunAssistantMessageData struct {
	// Not enforced by the generated code: format uuid.
	AgentRunID string `json:"agentRunId"`
	// Not enforced by the generated code: format uuid.
	ParentTurnID string `json:"parentTurnId"`
	// Not enforced by the generated code: format uuid.
	ParentAgentRunID *string `json:"parentAgentRunId,omitempty"`
	// `providerReasoning` is set only when the provider returned reasoning Peen cannot parse into `reasoning`.
	Event AgentRunAssistantMessageEvent `json:"event"`
}

func (*AgentRunAssistantMessageData) UnmarshalJSON

func (v *AgentRunAssistantMessageData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunAssistantMessageData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunAssistantMessageData) Validate

func (v AgentRunAssistantMessageData) Validate() error

Validate checks the constraints the schema declares for AgentRunAssistantMessageData.

type AgentRunAssistantMessageEvent

type AgentRunAssistantMessageEvent struct {
	Role              string             `json:"role"`
	Content           []Part             `json:"content"`
	ToolCalls         []AgentRunToolCall `json:"toolCalls"`
	Reasoning         *string            `json:"reasoning,omitempty"`
	ProviderReasoning map[string]any     `json:"providerReasoning,omitempty"`
	Origin            *string            `json:"origin,omitempty"`
}

`providerReasoning` is set only when the provider returned reasoning Peen cannot parse into `reasoning`.

func (*AgentRunAssistantMessageEvent) UnmarshalJSON

func (v *AgentRunAssistantMessageEvent) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunAssistantMessageEvent strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunAssistantMessageEvent) Validate

func (v AgentRunAssistantMessageEvent) Validate() error

Validate checks the constraints the schema declares for AgentRunAssistantMessageEvent.

type AgentRunCancelled

type AgentRunCancelled struct {
	// Not enforced by the generated code: format uuid.
	ID        string                `json:"id"`
	Type      string                `json:"type"`
	Data      AgentRunCancelledData `json:"data"`
	Timestamp int64                 `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (AgentRunCancelled) MarshalJSON

func (v AgentRunCancelled) MarshalJSON() ([]byte, error)

MarshalJSON encodes AgentRunCancelled with its const properties filled in.

func (*AgentRunCancelled) UnmarshalJSON

func (v *AgentRunCancelled) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunCancelled strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunCancelled) Validate

func (v AgentRunCancelled) Validate() error

Validate checks the constraints the schema declares for AgentRunCancelled.

type AgentRunCancelledData

type AgentRunCancelledData struct {
	// Not enforced by the generated code: format uuid.
	AgentRunID string `json:"agentRunId"`
	// Not enforced by the generated code: format uuid.
	ParentTurnID string `json:"parentTurnId"`
	// Not enforced by the generated code: format uuid.
	ParentAgentRunID *string               `json:"parentAgentRunId,omitempty"`
	Event            AgentRunTerminalEvent `json:"event"`
}

func (*AgentRunCancelledData) UnmarshalJSON

func (v *AgentRunCancelledData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunCancelledData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunCancelledData) Validate

func (v AgentRunCancelledData) Validate() error

Validate checks the constraints the schema declares for AgentRunCancelledData.

type AgentRunCompleted

type AgentRunCompleted struct {
	// Not enforced by the generated code: format uuid.
	ID        string                `json:"id"`
	Type      string                `json:"type"`
	Data      AgentRunCompletedData `json:"data"`
	Timestamp int64                 `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (AgentRunCompleted) MarshalJSON

func (v AgentRunCompleted) MarshalJSON() ([]byte, error)

MarshalJSON encodes AgentRunCompleted with its const properties filled in.

func (*AgentRunCompleted) UnmarshalJSON

func (v *AgentRunCompleted) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunCompleted strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunCompleted) Validate

func (v AgentRunCompleted) Validate() error

Validate checks the constraints the schema declares for AgentRunCompleted.

type AgentRunCompletedData

type AgentRunCompletedData struct {
	// Not enforced by the generated code: format uuid.
	AgentRunID string `json:"agentRunId"`
	// Not enforced by the generated code: format uuid.
	ParentTurnID string `json:"parentTurnId"`
	// Not enforced by the generated code: format uuid.
	ParentAgentRunID *string               `json:"parentAgentRunId,omitempty"`
	Event            AgentRunTerminalEvent `json:"event"`
}

func (*AgentRunCompletedData) UnmarshalJSON

func (v *AgentRunCompletedData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunCompletedData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunCompletedData) Validate

func (v AgentRunCompletedData) Validate() error

Validate checks the constraints the schema declares for AgentRunCompletedData.

type AgentRunDefinition

type AgentRunDefinition string
const (
	AgentRunDefinitionStored AgentRunDefinition = "stored"
	AgentRunDefinitionAdHoc  AgentRunDefinition = "ad-hoc"
)

Values of AgentRunDefinition.

func (AgentRunDefinition) Validate

func (v AgentRunDefinition) Validate() error

Validate reports whether v is one of the values the schema lists.

type AgentRunFailed

type AgentRunFailed struct {
	// Not enforced by the generated code: format uuid.
	ID        string             `json:"id"`
	Type      string             `json:"type"`
	Data      AgentRunFailedData `json:"data"`
	Timestamp int64              `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (AgentRunFailed) MarshalJSON

func (v AgentRunFailed) MarshalJSON() ([]byte, error)

MarshalJSON encodes AgentRunFailed with its const properties filled in.

func (*AgentRunFailed) UnmarshalJSON

func (v *AgentRunFailed) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunFailed strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunFailed) Validate

func (v AgentRunFailed) Validate() error

Validate checks the constraints the schema declares for AgentRunFailed.

type AgentRunFailedData

type AgentRunFailedData struct {
	// Not enforced by the generated code: format uuid.
	AgentRunID string `json:"agentRunId"`
	// Not enforced by the generated code: format uuid.
	ParentTurnID string `json:"parentTurnId"`
	// Not enforced by the generated code: format uuid.
	ParentAgentRunID *string               `json:"parentAgentRunId,omitempty"`
	Event            AgentRunTerminalEvent `json:"event"`
}

func (*AgentRunFailedData) UnmarshalJSON

func (v *AgentRunFailedData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunFailedData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunFailedData) Validate

func (v AgentRunFailedData) Validate() error

Validate checks the constraints the schema declares for AgentRunFailedData.

type AgentRunFailureClassification

type AgentRunFailureClassification string
const (
	AgentRunFailureClassificationAgentRun  AgentRunFailureClassification = "agentRun"
	AgentRunFailureClassificationCancelled AgentRunFailureClassification = "cancelled"
)

Values of AgentRunFailureClassification.

func (AgentRunFailureClassification) Validate

func (v AgentRunFailureClassification) Validate() error

Validate reports whether v is one of the values the schema lists.

type AgentRunInboxMessage

type AgentRunInboxMessage struct {
	Message string `json:"message"`
	// Not enforced by the generated code: format uuid.
	AcceptanceID *string `json:"acceptanceId,omitempty"`
}

func (*AgentRunInboxMessage) UnmarshalJSON

func (v *AgentRunInboxMessage) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunInboxMessage strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunInboxMessage) Validate

func (v AgentRunInboxMessage) Validate() error

Validate checks the constraints the schema declares for AgentRunInboxMessage.

type AgentRunMessageDelivered

type AgentRunMessageDelivered struct {
	// Not enforced by the generated code: format uuid.
	ID        string                       `json:"id"`
	Type      string                       `json:"type"`
	Data      AgentRunMessageDeliveredData `json:"data"`
	Timestamp int64                        `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (AgentRunMessageDelivered) MarshalJSON

func (v AgentRunMessageDelivered) MarshalJSON() ([]byte, error)

MarshalJSON encodes AgentRunMessageDelivered with its const properties filled in.

func (*AgentRunMessageDelivered) UnmarshalJSON

func (v *AgentRunMessageDelivered) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunMessageDelivered strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunMessageDelivered) Validate

func (v AgentRunMessageDelivered) Validate() error

Validate checks the constraints the schema declares for AgentRunMessageDelivered.

type AgentRunMessageDeliveredData

type AgentRunMessageDeliveredData struct {
	// Not enforced by the generated code: format uuid.
	AgentRunID string `json:"agentRunId"`
	// Not enforced by the generated code: format uuid.
	ParentTurnID string `json:"parentTurnId"`
	// Not enforced by the generated code: format uuid.
	ParentAgentRunID *string              `json:"parentAgentRunId,omitempty"`
	Event            AgentRunInboxMessage `json:"event"`
}

func (*AgentRunMessageDeliveredData) UnmarshalJSON

func (v *AgentRunMessageDeliveredData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunMessageDeliveredData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunMessageDeliveredData) Validate

func (v AgentRunMessageDeliveredData) Validate() error

Validate checks the constraints the schema declares for AgentRunMessageDeliveredData.

type AgentRunMessageInjected

type AgentRunMessageInjected struct {
	// Not enforced by the generated code: format uuid.
	ID        string                      `json:"id"`
	Type      string                      `json:"type"`
	Data      AgentRunMessageInjectedData `json:"data"`
	Timestamp int64                       `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (AgentRunMessageInjected) MarshalJSON

func (v AgentRunMessageInjected) MarshalJSON() ([]byte, error)

MarshalJSON encodes AgentRunMessageInjected with its const properties filled in.

func (*AgentRunMessageInjected) UnmarshalJSON

func (v *AgentRunMessageInjected) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunMessageInjected strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunMessageInjected) Validate

func (v AgentRunMessageInjected) Validate() error

Validate checks the constraints the schema declares for AgentRunMessageInjected.

type AgentRunMessageInjectedData

type AgentRunMessageInjectedData struct {
	// Not enforced by the generated code: format uuid.
	AgentRunID string `json:"agentRunId"`
	// Not enforced by the generated code: format uuid.
	ParentTurnID string `json:"parentTurnId"`
	// Not enforced by the generated code: format uuid.
	ParentAgentRunID *string                      `json:"parentAgentRunId,omitempty"`
	Event            AgentRunMessageInjectedEvent `json:"event"`
}

func (*AgentRunMessageInjectedData) UnmarshalJSON

func (v *AgentRunMessageInjectedData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunMessageInjectedData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunMessageInjectedData) Validate

func (v AgentRunMessageInjectedData) Validate() error

Validate checks the constraints the schema declares for AgentRunMessageInjectedData.

type AgentRunMessageInjectedEvent

type AgentRunMessageInjectedEvent struct {
	Type    AgentRunMessageInjectedType `json:"type"`
	Content string                      `json:"content"`
	Phase   string                      `json:"phase"`
	Tool    string                      `json:"tool"`
	CallID  string                      `json:"callId"`
	Round   int64                       `json:"round"`
}

func (*AgentRunMessageInjectedEvent) UnmarshalJSON

func (v *AgentRunMessageInjectedEvent) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunMessageInjectedEvent strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunMessageInjectedEvent) Validate

func (v AgentRunMessageInjectedEvent) Validate() error

Validate checks the constraints the schema declares for AgentRunMessageInjectedEvent.

type AgentRunMessageInjectedType

type AgentRunMessageInjectedType string
const (
	AgentRunMessageInjectedTypeUser      AgentRunMessageInjectedType = "user"
	AgentRunMessageInjectedTypeAssistant AgentRunMessageInjectedType = "assistant"
)

Values of AgentRunMessageInjectedType.

func (AgentRunMessageInjectedType) Validate

func (v AgentRunMessageInjectedType) Validate() error

Validate reports whether v is one of the values the schema lists.

type AgentRunMessageQueued

type AgentRunMessageQueued struct {
	// Not enforced by the generated code: format uuid.
	ID        string                    `json:"id"`
	Type      string                    `json:"type"`
	Data      AgentRunMessageQueuedData `json:"data"`
	Timestamp int64                     `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (AgentRunMessageQueued) MarshalJSON

func (v AgentRunMessageQueued) MarshalJSON() ([]byte, error)

MarshalJSON encodes AgentRunMessageQueued with its const properties filled in.

func (*AgentRunMessageQueued) UnmarshalJSON

func (v *AgentRunMessageQueued) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunMessageQueued strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunMessageQueued) Validate

func (v AgentRunMessageQueued) Validate() error

Validate checks the constraints the schema declares for AgentRunMessageQueued.

type AgentRunMessageQueuedData

type AgentRunMessageQueuedData struct {
	// Not enforced by the generated code: format uuid.
	AgentRunID string `json:"agentRunId"`
	// Not enforced by the generated code: format uuid.
	ParentTurnID string `json:"parentTurnId"`
	// Not enforced by the generated code: format uuid.
	ParentAgentRunID *string              `json:"parentAgentRunId,omitempty"`
	Event            AgentRunInboxMessage `json:"event"`
}

func (*AgentRunMessageQueuedData) UnmarshalJSON

func (v *AgentRunMessageQueuedData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunMessageQueuedData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunMessageQueuedData) Validate

func (v AgentRunMessageQueuedData) Validate() error

Validate checks the constraints the schema declares for AgentRunMessageQueuedData.

type AgentRunMessageUndelivered

type AgentRunMessageUndelivered struct {
	// Not enforced by the generated code: format uuid.
	ID        string                         `json:"id"`
	Type      string                         `json:"type"`
	Data      AgentRunMessageUndeliveredData `json:"data"`
	Timestamp int64                          `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (AgentRunMessageUndelivered) MarshalJSON

func (v AgentRunMessageUndelivered) MarshalJSON() ([]byte, error)

MarshalJSON encodes AgentRunMessageUndelivered with its const properties filled in.

func (*AgentRunMessageUndelivered) UnmarshalJSON

func (v *AgentRunMessageUndelivered) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunMessageUndelivered strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunMessageUndelivered) Validate

func (v AgentRunMessageUndelivered) Validate() error

Validate checks the constraints the schema declares for AgentRunMessageUndelivered.

type AgentRunMessageUndeliveredData

type AgentRunMessageUndeliveredData struct {
	// Not enforced by the generated code: format uuid.
	AgentRunID string `json:"agentRunId"`
	// Not enforced by the generated code: format uuid.
	ParentTurnID string `json:"parentTurnId"`
	// Not enforced by the generated code: format uuid.
	ParentAgentRunID *string              `json:"parentAgentRunId,omitempty"`
	Event            AgentRunInboxMessage `json:"event"`
}

func (*AgentRunMessageUndeliveredData) UnmarshalJSON

func (v *AgentRunMessageUndeliveredData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunMessageUndeliveredData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunMessageUndeliveredData) Validate

Validate checks the constraints the schema declares for AgentRunMessageUndeliveredData.

type AgentRunProviderRetry

type AgentRunProviderRetry struct {
	// Not enforced by the generated code: format uuid.
	ID        string                    `json:"id"`
	Type      string                    `json:"type"`
	Data      AgentRunProviderRetryData `json:"data"`
	Timestamp int64                     `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (AgentRunProviderRetry) MarshalJSON

func (v AgentRunProviderRetry) MarshalJSON() ([]byte, error)

MarshalJSON encodes AgentRunProviderRetry with its const properties filled in.

func (*AgentRunProviderRetry) UnmarshalJSON

func (v *AgentRunProviderRetry) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunProviderRetry strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunProviderRetry) Validate

func (v AgentRunProviderRetry) Validate() error

Validate checks the constraints the schema declares for AgentRunProviderRetry.

type AgentRunProviderRetryData

type AgentRunProviderRetryData struct {
	// Not enforced by the generated code: format uuid.
	AgentRunID string `json:"agentRunId"`
	// Not enforced by the generated code: format uuid.
	ParentTurnID string `json:"parentTurnId"`
	// Not enforced by the generated code: format uuid.
	ParentAgentRunID *string       `json:"parentAgentRunId,omitempty"`
	Event            ProviderRetry `json:"event"`
}

func (*AgentRunProviderRetryData) UnmarshalJSON

func (v *AgentRunProviderRetryData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunProviderRetryData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunProviderRetryData) Validate

func (v AgentRunProviderRetryData) Validate() error

Validate checks the constraints the schema declares for AgentRunProviderRetryData.

type AgentRunQuestion

type AgentRunQuestion struct {
	// Not enforced by the generated code: format uuid.
	ID        string               `json:"id"`
	Type      string               `json:"type"`
	Data      AgentRunQuestionData `json:"data"`
	Timestamp int64                `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (AgentRunQuestion) MarshalJSON

func (v AgentRunQuestion) MarshalJSON() ([]byte, error)

MarshalJSON encodes AgentRunQuestion with its const properties filled in.

func (*AgentRunQuestion) UnmarshalJSON

func (v *AgentRunQuestion) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunQuestion strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunQuestion) Validate

func (v AgentRunQuestion) Validate() error

Validate checks the constraints the schema declares for AgentRunQuestion.

type AgentRunQuestionData

type AgentRunQuestionData struct {
	// Not enforced by the generated code: format uuid.
	AgentRunID string `json:"agentRunId"`
	// Not enforced by the generated code: format uuid.
	ParentTurnID string `json:"parentTurnId"`
	// Not enforced by the generated code: format uuid.
	ParentAgentRunID *string       `json:"parentAgentRunId,omitempty"`
	Event            QuestionAsked `json:"event"`
}

func (*AgentRunQuestionData) UnmarshalJSON

func (v *AgentRunQuestionData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunQuestionData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunQuestionData) Validate

func (v AgentRunQuestionData) Validate() error

Validate checks the constraints the schema declares for AgentRunQuestionData.

type AgentRunStarted

type AgentRunStarted struct {
	// Not enforced by the generated code: format uuid.
	ID        string              `json:"id"`
	Type      string              `json:"type"`
	Data      AgentRunStartedData `json:"data"`
	Timestamp int64               `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (AgentRunStarted) MarshalJSON

func (v AgentRunStarted) MarshalJSON() ([]byte, error)

MarshalJSON encodes AgentRunStarted with its const properties filled in.

func (*AgentRunStarted) UnmarshalJSON

func (v *AgentRunStarted) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunStarted strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunStarted) Validate

func (v AgentRunStarted) Validate() error

Validate checks the constraints the schema declares for AgentRunStarted.

type AgentRunStartedData

type AgentRunStartedData struct {
	// Not enforced by the generated code: format uuid.
	AgentRunID string `json:"agentRunId"`
	// Not enforced by the generated code: format uuid.
	ParentTurnID string `json:"parentTurnId"`
	// Not enforced by the generated code: format uuid.
	ParentAgentRunID *string              `json:"parentAgentRunId,omitempty"`
	Event            AgentRunStartedEvent `json:"event"`
}

func (*AgentRunStartedData) UnmarshalJSON

func (v *AgentRunStartedData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunStartedData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunStartedData) Validate

func (v AgentRunStartedData) Validate() error

Validate checks the constraints the schema declares for AgentRunStartedData.

type AgentRunStartedEvent

type AgentRunStartedEvent struct {
	// Not enforced by the generated code: format uuid.
	AgentRunID string `json:"agentRunId"`
	// Not enforced by the generated code: format uuid.
	ParentTurnID string `json:"parentTurnId"`
	// Not enforced by the generated code: format uuid.
	ParentAgentRunID *string            `json:"parentAgentRunId,omitempty"`
	Name             string             `json:"name"`
	Definition       AgentRunDefinition `json:"definition"`
	Depth            int64              `json:"depth"`
	Model            string             `json:"model"`
	Workspace        string             `json:"workspace"`
}

func (*AgentRunStartedEvent) UnmarshalJSON

func (v *AgentRunStartedEvent) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunStartedEvent strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunStartedEvent) Validate

func (v AgentRunStartedEvent) Validate() error

Validate checks the constraints the schema declares for AgentRunStartedEvent.

type AgentRunTerminalEvent

type AgentRunTerminalEvent struct {
	// Not enforced by the generated code: format uuid.
	AgentRunID            string                         `json:"agentRunId"`
	State                 AgentRunTerminalState          `json:"state"`
	FailureClassification *AgentRunFailureClassification `json:"failureClassification,omitempty"`
	// Free text.
	FailureDetail *string `json:"failureDetail,omitempty"`
}

func (*AgentRunTerminalEvent) UnmarshalJSON

func (v *AgentRunTerminalEvent) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunTerminalEvent strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunTerminalEvent) Validate

func (v AgentRunTerminalEvent) Validate() error

Validate checks the constraints the schema declares for AgentRunTerminalEvent.

type AgentRunTerminalState

type AgentRunTerminalState string
const (
	AgentRunTerminalStateCompleted AgentRunTerminalState = "completed"
	AgentRunTerminalStateFailed    AgentRunTerminalState = "failed"
	AgentRunTerminalStateCancelled AgentRunTerminalState = "cancelled"
)

Values of AgentRunTerminalState.

func (AgentRunTerminalState) Validate

func (v AgentRunTerminalState) Validate() error

Validate reports whether v is one of the values the schema lists.

type AgentRunTextDelta

type AgentRunTextDelta struct {
	// Not enforced by the generated code: format uuid.
	ID        string                `json:"id"`
	Type      string                `json:"type"`
	Data      AgentRunTextDeltaData `json:"data"`
	Timestamp int64                 `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (AgentRunTextDelta) MarshalJSON

func (v AgentRunTextDelta) MarshalJSON() ([]byte, error)

MarshalJSON encodes AgentRunTextDelta with its const properties filled in.

func (*AgentRunTextDelta) UnmarshalJSON

func (v *AgentRunTextDelta) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunTextDelta strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunTextDelta) Validate

func (v AgentRunTextDelta) Validate() error

Validate checks the constraints the schema declares for AgentRunTextDelta.

type AgentRunTextDeltaData

type AgentRunTextDeltaData struct {
	// Not enforced by the generated code: format uuid.
	AgentRunID string `json:"agentRunId"`
	// Not enforced by the generated code: format uuid.
	ParentTurnID string `json:"parentTurnId"`
	// Not enforced by the generated code: format uuid.
	ParentAgentRunID *string     `json:"parentAgentRunId,omitempty"`
	Event            TextPayload `json:"event"`
}

func (*AgentRunTextDeltaData) UnmarshalJSON

func (v *AgentRunTextDeltaData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunTextDeltaData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunTextDeltaData) Validate

func (v AgentRunTextDeltaData) Validate() error

Validate checks the constraints the schema declares for AgentRunTextDeltaData.

type AgentRunThinkingDelta

type AgentRunThinkingDelta struct {
	// Not enforced by the generated code: format uuid.
	ID        string                    `json:"id"`
	Type      string                    `json:"type"`
	Data      AgentRunThinkingDeltaData `json:"data"`
	Timestamp int64                     `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (AgentRunThinkingDelta) MarshalJSON

func (v AgentRunThinkingDelta) MarshalJSON() ([]byte, error)

MarshalJSON encodes AgentRunThinkingDelta with its const properties filled in.

func (*AgentRunThinkingDelta) UnmarshalJSON

func (v *AgentRunThinkingDelta) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunThinkingDelta strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunThinkingDelta) Validate

func (v AgentRunThinkingDelta) Validate() error

Validate checks the constraints the schema declares for AgentRunThinkingDelta.

type AgentRunThinkingDeltaData

type AgentRunThinkingDeltaData struct {
	// Not enforced by the generated code: format uuid.
	AgentRunID string `json:"agentRunId"`
	// Not enforced by the generated code: format uuid.
	ParentTurnID string `json:"parentTurnId"`
	// Not enforced by the generated code: format uuid.
	ParentAgentRunID *string     `json:"parentAgentRunId,omitempty"`
	Event            TextPayload `json:"event"`
}

func (*AgentRunThinkingDeltaData) UnmarshalJSON

func (v *AgentRunThinkingDeltaData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunThinkingDeltaData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunThinkingDeltaData) Validate

func (v AgentRunThinkingDeltaData) Validate() error

Validate checks the constraints the schema declares for AgentRunThinkingDeltaData.

type AgentRunToolCall

type AgentRunToolCall struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	// Open. The tool's own arguments, shaped by that tool, exactly as the provider returned them; null when the provider sent none.
	Arguments map[string]any `json:"arguments"`
}

func (*AgentRunToolCall) UnmarshalJSON

func (v *AgentRunToolCall) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunToolCall strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunToolCall) Validate

func (v AgentRunToolCall) Validate() error

Validate checks the constraints the schema declares for AgentRunToolCall.

type AgentRunToolResult

type AgentRunToolResult struct {
	// Not enforced by the generated code: format uuid.
	ID        string                 `json:"id"`
	Type      string                 `json:"type"`
	Data      AgentRunToolResultData `json:"data"`
	Timestamp int64                  `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (AgentRunToolResult) MarshalJSON

func (v AgentRunToolResult) MarshalJSON() ([]byte, error)

MarshalJSON encodes AgentRunToolResult with its const properties filled in.

func (*AgentRunToolResult) UnmarshalJSON

func (v *AgentRunToolResult) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunToolResult strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunToolResult) Validate

func (v AgentRunToolResult) Validate() error

Validate checks the constraints the schema declares for AgentRunToolResult.

type AgentRunToolResultData

type AgentRunToolResultData struct {
	// Not enforced by the generated code: format uuid.
	AgentRunID string `json:"agentRunId"`
	// Not enforced by the generated code: format uuid.
	ParentTurnID string `json:"parentTurnId"`
	// Not enforced by the generated code: format uuid.
	ParentAgentRunID *string    `json:"parentAgentRunId,omitempty"`
	Event            ToolResult `json:"event"`
}

func (*AgentRunToolResultData) UnmarshalJSON

func (v *AgentRunToolResultData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunToolResultData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunToolResultData) Validate

func (v AgentRunToolResultData) Validate() error

Validate checks the constraints the schema declares for AgentRunToolResultData.

type AgentRunToolUse

type AgentRunToolUse struct {
	// Not enforced by the generated code: format uuid.
	ID        string              `json:"id"`
	Type      string              `json:"type"`
	Data      AgentRunToolUseData `json:"data"`
	Timestamp int64               `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (AgentRunToolUse) MarshalJSON

func (v AgentRunToolUse) MarshalJSON() ([]byte, error)

MarshalJSON encodes AgentRunToolUse with its const properties filled in.

func (*AgentRunToolUse) UnmarshalJSON

func (v *AgentRunToolUse) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunToolUse strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunToolUse) Validate

func (v AgentRunToolUse) Validate() error

Validate checks the constraints the schema declares for AgentRunToolUse.

type AgentRunToolUseData

type AgentRunToolUseData struct {
	// Not enforced by the generated code: format uuid.
	AgentRunID string `json:"agentRunId"`
	// Not enforced by the generated code: format uuid.
	ParentTurnID string `json:"parentTurnId"`
	// Not enforced by the generated code: format uuid.
	ParentAgentRunID *string `json:"parentAgentRunId,omitempty"`
	Event            ToolUse `json:"event"`
}

func (*AgentRunToolUseData) UnmarshalJSON

func (v *AgentRunToolUseData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes AgentRunToolUseData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (AgentRunToolUseData) Validate

func (v AgentRunToolUseData) Validate() error

Validate checks the constraints the schema declares for AgentRunToolUseData.

type ContentBlock

type ContentBlock struct {
	// contains filtered or unexported fields
}

ContentBlock holds one of several shapes. Set it with the From methods and read it with Value or the As methods.

func (ContentBlock) AsContentBlockTextStart

func (v ContentBlock) AsContentBlockTextStart() (ContentBlockTextStart, error)

AsContentBlockTextStart decodes the held value as a ContentBlockTextStart.

func (ContentBlock) AsContentBlockThinkingStart

func (v ContentBlock) AsContentBlockThinkingStart() (ContentBlockThinkingStart, error)

AsContentBlockThinkingStart decodes the held value as a ContentBlockThinkingStart.

func (ContentBlock) AsContentBlockToolResultStart

func (v ContentBlock) AsContentBlockToolResultStart() (ContentBlockToolResultStart, error)

AsContentBlockToolResultStart decodes the held value as a ContentBlockToolResultStart.

func (ContentBlock) AsContentBlockToolUseStart

func (v ContentBlock) AsContentBlockToolUseStart() (ContentBlockToolUseStart, error)

AsContentBlockToolUseStart decodes the held value as a ContentBlockToolUseStart.

func (ContentBlock) Discriminator

func (v ContentBlock) Discriminator() (string, error)

Discriminator returns the "type" property that selects the variant.

func (*ContentBlock) FromContentBlockTextStart

func (v *ContentBlock) FromContentBlockTextStart(value ContentBlockTextStart) error

FromContentBlockTextStart sets the held value to a ContentBlockTextStart.

func (*ContentBlock) FromContentBlockThinkingStart

func (v *ContentBlock) FromContentBlockThinkingStart(value ContentBlockThinkingStart) error

FromContentBlockThinkingStart sets the held value to a ContentBlockThinkingStart.

func (*ContentBlock) FromContentBlockToolResultStart

func (v *ContentBlock) FromContentBlockToolResultStart(value ContentBlockToolResultStart) error

FromContentBlockToolResultStart sets the held value to a ContentBlockToolResultStart.

func (*ContentBlock) FromContentBlockToolUseStart

func (v *ContentBlock) FromContentBlockToolUseStart(value ContentBlockToolUseStart) error

FromContentBlockToolUseStart sets the held value to a ContentBlockToolUseStart.

func (ContentBlock) MarshalJSON

func (v ContentBlock) MarshalJSON() ([]byte, error)

MarshalJSON encodes the held value.

func (*ContentBlock) UnmarshalJSON

func (v *ContentBlock) UnmarshalJSON(data []byte) error

UnmarshalJSON stores data after checking that it is exactly one variant.

func (ContentBlock) Validate

func (v ContentBlock) Validate() error

Validate checks that the held value is a valid variant.

func (ContentBlock) Value

func (v ContentBlock) Value() (any, error)

Value decodes the held value as the variant its discriminator selects.

type ContentBlockDelta

type ContentBlockDelta struct {
	// Not enforced by the generated code: format uuid.
	ID        string                `json:"id"`
	Type      string                `json:"type"`
	Data      ContentBlockDeltaData `json:"data"`
	Timestamp int64                 `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (ContentBlockDelta) MarshalJSON

func (v ContentBlockDelta) MarshalJSON() ([]byte, error)

MarshalJSON encodes ContentBlockDelta with its const properties filled in.

func (*ContentBlockDelta) UnmarshalJSON

func (v *ContentBlockDelta) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes ContentBlockDelta strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (ContentBlockDelta) Validate

func (v ContentBlockDelta) Validate() error

Validate checks the constraints the schema declares for ContentBlockDelta.

type ContentBlockDeltaData

type ContentBlockDeltaData struct {
	Type  string `json:"type"`
	Index int64  `json:"index"`
	Delta Delta  `json:"delta"`
}

func (ContentBlockDeltaData) MarshalJSON

func (v ContentBlockDeltaData) MarshalJSON() ([]byte, error)

MarshalJSON encodes ContentBlockDeltaData with its const properties filled in.

func (*ContentBlockDeltaData) UnmarshalJSON

func (v *ContentBlockDeltaData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes ContentBlockDeltaData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (ContentBlockDeltaData) Validate

func (v ContentBlockDeltaData) Validate() error

Validate checks the constraints the schema declares for ContentBlockDeltaData.

type ContentBlockStart

type ContentBlockStart struct {
	// Not enforced by the generated code: format uuid.
	ID        string                `json:"id"`
	Type      string                `json:"type"`
	Data      ContentBlockStartData `json:"data"`
	Timestamp int64                 `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (ContentBlockStart) MarshalJSON

func (v ContentBlockStart) MarshalJSON() ([]byte, error)

MarshalJSON encodes ContentBlockStart with its const properties filled in.

func (*ContentBlockStart) UnmarshalJSON

func (v *ContentBlockStart) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes ContentBlockStart strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (ContentBlockStart) Validate

func (v ContentBlockStart) Validate() error

Validate checks the constraints the schema declares for ContentBlockStart.

type ContentBlockStartData

type ContentBlockStartData struct {
	Type         string       `json:"type"`
	Index        int64        `json:"index"`
	ContentBlock ContentBlock `json:"content_block"`
}

func (ContentBlockStartData) MarshalJSON

func (v ContentBlockStartData) MarshalJSON() ([]byte, error)

MarshalJSON encodes ContentBlockStartData with its const properties filled in.

func (*ContentBlockStartData) UnmarshalJSON

func (v *ContentBlockStartData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes ContentBlockStartData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (ContentBlockStartData) Validate

func (v ContentBlockStartData) Validate() error

Validate checks the constraints the schema declares for ContentBlockStartData.

type ContentBlockStop

type ContentBlockStop struct {
	// Not enforced by the generated code: format uuid.
	ID        string               `json:"id"`
	Type      string               `json:"type"`
	Data      ContentBlockStopData `json:"data"`
	Timestamp int64                `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (ContentBlockStop) MarshalJSON

func (v ContentBlockStop) MarshalJSON() ([]byte, error)

MarshalJSON encodes ContentBlockStop with its const properties filled in.

func (*ContentBlockStop) UnmarshalJSON

func (v *ContentBlockStop) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes ContentBlockStop strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (ContentBlockStop) Validate

func (v ContentBlockStop) Validate() error

Validate checks the constraints the schema declares for ContentBlockStop.

type ContentBlockStopData

type ContentBlockStopData struct {
	Type  string `json:"type"`
	Index int64  `json:"index"`
}

func (ContentBlockStopData) MarshalJSON

func (v ContentBlockStopData) MarshalJSON() ([]byte, error)

MarshalJSON encodes ContentBlockStopData with its const properties filled in.

func (*ContentBlockStopData) UnmarshalJSON

func (v *ContentBlockStopData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes ContentBlockStopData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (ContentBlockStopData) Validate

func (v ContentBlockStopData) Validate() error

Validate checks the constraints the schema declares for ContentBlockStopData.

type ContentBlockTextStart

type ContentBlockTextStart struct {
	Type string `json:"type"`
	// Peen never sets this at block start.
	Text *string `json:"text,omitempty"`
}

func (ContentBlockTextStart) MarshalJSON

func (v ContentBlockTextStart) MarshalJSON() ([]byte, error)

MarshalJSON encodes ContentBlockTextStart with its const properties filled in.

func (*ContentBlockTextStart) UnmarshalJSON

func (v *ContentBlockTextStart) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes ContentBlockTextStart strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (ContentBlockTextStart) Validate

func (v ContentBlockTextStart) Validate() error

Validate checks the constraints the schema declares for ContentBlockTextStart.

type ContentBlockThinkingStart

type ContentBlockThinkingStart struct {
	Type string `json:"type"`
	// Peen never sets this at block start.
	Text *string `json:"text,omitempty"`
}

func (ContentBlockThinkingStart) MarshalJSON

func (v ContentBlockThinkingStart) MarshalJSON() ([]byte, error)

MarshalJSON encodes ContentBlockThinkingStart with its const properties filled in.

func (*ContentBlockThinkingStart) UnmarshalJSON

func (v *ContentBlockThinkingStart) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes ContentBlockThinkingStart strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (ContentBlockThinkingStart) Validate

func (v ContentBlockThinkingStart) Validate() error

Validate checks the constraints the schema declares for ContentBlockThinkingStart.

type ContentBlockToolResultStart

type ContentBlockToolResultStart struct {
	Type      string  `json:"type"`
	ToolUseID string  `json:"tool_use_id"`
	Content   *string `json:"content,omitempty"`
	// Present only when `true`.
	IsError *bool `json:"is_error,omitempty"`
}

func (ContentBlockToolResultStart) MarshalJSON

func (v ContentBlockToolResultStart) MarshalJSON() ([]byte, error)

MarshalJSON encodes ContentBlockToolResultStart with its const properties filled in.

func (*ContentBlockToolResultStart) UnmarshalJSON

func (v *ContentBlockToolResultStart) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes ContentBlockToolResultStart strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (ContentBlockToolResultStart) Validate

func (v ContentBlockToolResultStart) Validate() error

Validate checks the constraints the schema declares for ContentBlockToolResultStart.

type ContentBlockToolUseStart

type ContentBlockToolUseStart struct {
	Type string `json:"type"`
	ID   string `json:"id"`
	Name string `json:"name"`
	// Open. Always `{}` at block start.
	Input map[string]any `json:"input"`
}

func (ContentBlockToolUseStart) MarshalJSON

func (v ContentBlockToolUseStart) MarshalJSON() ([]byte, error)

MarshalJSON encodes ContentBlockToolUseStart with its const properties filled in.

func (*ContentBlockToolUseStart) UnmarshalJSON

func (v *ContentBlockToolUseStart) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes ContentBlockToolUseStart strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (ContentBlockToolUseStart) Validate

func (v ContentBlockToolUseStart) Validate() error

Validate checks the constraints the schema declares for ContentBlockToolUseStart.

type Delta

type Delta struct {
	// contains filtered or unexported fields
}

Delta holds one of several shapes. Set it with the From methods and read it with Value or the As methods.

func (Delta) AsInputJSONDelta

func (v Delta) AsInputJSONDelta() (InputJSONDelta, error)

AsInputJSONDelta decodes the held value as a InputJSONDelta.

func (Delta) AsJSONPartialDelta

func (v Delta) AsJSONPartialDelta() (JSONPartialDelta, error)

AsJSONPartialDelta decodes the held value as a JSONPartialDelta.

func (Delta) AsTextDelta

func (v Delta) AsTextDelta() (TextDelta, error)

AsTextDelta decodes the held value as a TextDelta.

func (Delta) AsThinkingDelta

func (v Delta) AsThinkingDelta() (ThinkingDelta, error)

AsThinkingDelta decodes the held value as a ThinkingDelta.

func (Delta) Discriminator

func (v Delta) Discriminator() (string, error)

Discriminator returns the "type" property that selects the variant.

func (*Delta) FromInputJSONDelta

func (v *Delta) FromInputJSONDelta(value InputJSONDelta) error

FromInputJSONDelta sets the held value to a InputJSONDelta.

func (*Delta) FromJSONPartialDelta

func (v *Delta) FromJSONPartialDelta(value JSONPartialDelta) error

FromJSONPartialDelta sets the held value to a JSONPartialDelta.

func (*Delta) FromTextDelta

func (v *Delta) FromTextDelta(value TextDelta) error

FromTextDelta sets the held value to a TextDelta.

func (*Delta) FromThinkingDelta

func (v *Delta) FromThinkingDelta(value ThinkingDelta) error

FromThinkingDelta sets the held value to a ThinkingDelta.

func (Delta) MarshalJSON

func (v Delta) MarshalJSON() ([]byte, error)

MarshalJSON encodes the held value.

func (*Delta) UnmarshalJSON

func (v *Delta) UnmarshalJSON(data []byte) error

UnmarshalJSON stores data after checking that it is exactly one variant.

func (Delta) Validate

func (v Delta) Validate() error

Validate checks that the held value is a valid variant.

func (Delta) Value

func (v Delta) Value() (any, error)

Value decodes the held value as the variant its discriminator selects.

type HarnessWarning

type HarnessWarning struct {
	// Not enforced by the generated code: format uuid.
	ID        string             `json:"id"`
	Type      string             `json:"type"`
	Data      HarnessWarningData `json:"data"`
	Timestamp int64              `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (HarnessWarning) MarshalJSON

func (v HarnessWarning) MarshalJSON() ([]byte, error)

MarshalJSON encodes HarnessWarning with its const properties filled in.

func (*HarnessWarning) UnmarshalJSON

func (v *HarnessWarning) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes HarnessWarning strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (HarnessWarning) Validate

func (v HarnessWarning) Validate() error

Validate checks the constraints the schema declares for HarnessWarning.

type HarnessWarningData

type HarnessWarningData struct {
	Warnings []HarnessWarningItem `json:"warnings"`
}

func (*HarnessWarningData) UnmarshalJSON

func (v *HarnessWarningData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes HarnessWarningData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (HarnessWarningData) Validate

func (v HarnessWarningData) Validate() error

Validate checks the constraints the schema declares for HarnessWarningData.

type HarnessWarningItem

type HarnessWarningItem struct {
	Kind   HarnessWarningKind `json:"kind"`
	Source string             `json:"source"`
	// Free text naming what is wrong with this source.
	Reason string `json:"reason"`
}

func (*HarnessWarningItem) UnmarshalJSON

func (v *HarnessWarningItem) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes HarnessWarningItem strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (HarnessWarningItem) Validate

func (v HarnessWarningItem) Validate() error

Validate checks the constraints the schema declares for HarnessWarningItem.

type HarnessWarningKind

type HarnessWarningKind string
const (
	HarnessWarningKindInstruction  HarnessWarningKind = "instruction"
	HarnessWarningKindRule         HarnessWarningKind = "rule"
	HarnessWarningKindSkill        HarnessWarningKind = "skill"
	HarnessWarningKindAgent        HarnessWarningKind = "agent"
	HarnessWarningKindEventHandler HarnessWarningKind = "event-handler"
	HarnessWarningKindHook         HarnessWarningKind = "hook"
)

Values of HarnessWarningKind.

func (HarnessWarningKind) Validate

func (v HarnessWarningKind) Validate() error

Validate reports whether v is one of the values the schema lists.

type InputJSONDelta

type InputJSONDelta struct {
	Type string `json:"type"`
	// Free text. One fragment of a streamed JSON document.
	PartialJSON string `json:"partial_json"`
}

func (InputJSONDelta) MarshalJSON

func (v InputJSONDelta) MarshalJSON() ([]byte, error)

MarshalJSON encodes InputJSONDelta with its const properties filled in.

func (*InputJSONDelta) UnmarshalJSON

func (v *InputJSONDelta) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes InputJSONDelta strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (InputJSONDelta) Validate

func (v InputJSONDelta) Validate() error

Validate checks the constraints the schema declares for InputJSONDelta.

type JSONPartialDelta

type JSONPartialDelta struct {
	Type string `json:"type"`
	// Free text. One fragment of a streamed JSON document.
	Text string `json:"text"`
}

func (JSONPartialDelta) MarshalJSON

func (v JSONPartialDelta) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSONPartialDelta with its const properties filled in.

func (*JSONPartialDelta) UnmarshalJSON

func (v *JSONPartialDelta) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSONPartialDelta strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (JSONPartialDelta) Validate

func (v JSONPartialDelta) Validate() error

Validate checks the constraints the schema declares for JSONPartialDelta.

type McpServerSource added in v0.38.0

type McpServerSource string

The layer whose .agents/mcp.json defines the server.

const (
	McpServerSourceConfig    McpServerSource = "config"
	McpServerSourceWorkspace McpServerSource = "workspace"
)

Values of McpServerSource.

func (McpServerSource) Validate added in v0.38.0

func (v McpServerSource) Validate() error

Validate reports whether v is one of the values the schema lists.

type McpServerState added in v0.38.0

type McpServerState string
const (
	McpServerStateReady  McpServerState = "ready"
	McpServerStateFailed McpServerState = "failed"
)

Values of McpServerState.

func (McpServerState) Validate added in v0.38.0

func (v McpServerState) Validate() error

Validate reports whether v is one of the values the schema lists.

type McpServerStatus added in v0.38.0

type McpServerStatus struct {
	// The server name from mcp.json. Empty when a whole mcp.json file was refused.
	Name string `json:"name"`
	// The layer whose .agents/mcp.json defines the server.
	Source    McpServerSource     `json:"source"`
	Transport *McpServerTransport `json:"transport,omitempty"`
	State     McpServerState      `json:"state"`
	// The exposed tool names, mcp__<server>__<tool>.
	Tools []string `json:"tools"`
	// Why the server failed.
	Error *string `json:"error,omitempty"`
	// Problems that did not stop the server.
	Warnings []string `json:"warnings,omitempty"`
}

func (*McpServerStatus) UnmarshalJSON added in v0.38.0

func (v *McpServerStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes McpServerStatus strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (McpServerStatus) Validate added in v0.38.0

func (v McpServerStatus) Validate() error

Validate checks the constraints the schema declares for McpServerStatus.

type McpServerTransport added in v0.38.0

type McpServerTransport string
const (
	McpServerTransportStdio McpServerTransport = "stdio"
	McpServerTransportHTTP  McpServerTransport = "http"
)

Values of McpServerTransport.

func (McpServerTransport) Validate added in v0.38.0

func (v McpServerTransport) Validate() error

Validate reports whether v is one of the values the schema lists.

type McpStatus added in v0.38.0

type McpStatus struct {
	// Not enforced by the generated code: format uuid.
	ID        string        `json:"id"`
	Type      string        `json:"type"`
	Data      McpStatusData `json:"data"`
	Timestamp int64         `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (McpStatus) MarshalJSON added in v0.38.0

func (v McpStatus) MarshalJSON() ([]byte, error)

MarshalJSON encodes McpStatus with its const properties filled in.

func (*McpStatus) UnmarshalJSON added in v0.38.0

func (v *McpStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes McpStatus strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (McpStatus) Validate added in v0.38.0

func (v McpStatus) Validate() error

Validate checks the constraints the schema declares for McpStatus.

type McpStatusData added in v0.38.0

type McpStatusData struct {
	Servers []McpServerStatus `json:"servers"`
}

func (*McpStatusData) UnmarshalJSON added in v0.38.0

func (v *McpStatusData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes McpStatusData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (McpStatusData) Validate added in v0.38.0

func (v McpStatusData) Validate() error

Validate checks the constraints the schema declares for McpStatusData.

type MessageCompleted

type MessageCompleted struct {
	// Not enforced by the generated code: format uuid.
	ID        string               `json:"id"`
	Type      string               `json:"type"`
	Data      MessageCompletedData `json:"data"`
	Timestamp int64                `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (MessageCompleted) MarshalJSON

func (v MessageCompleted) MarshalJSON() ([]byte, error)

MarshalJSON encodes MessageCompleted with its const properties filled in.

func (*MessageCompleted) UnmarshalJSON

func (v *MessageCompleted) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes MessageCompleted strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (MessageCompleted) Validate

func (v MessageCompleted) Validate() error

Validate checks the constraints the schema declares for MessageCompleted.

type MessageCompletedData

type MessageCompletedData struct {
	Queued bool `json:"queued"`
}

func (*MessageCompletedData) UnmarshalJSON

func (v *MessageCompletedData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes MessageCompletedData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (MessageCompletedData) Validate

func (v MessageCompletedData) Validate() error

Validate checks the constraints the schema declares for MessageCompletedData.

type MessageFailed

type MessageFailed struct {
	// Not enforced by the generated code: format uuid.
	ID   string `json:"id"`
	Type string `json:"type"`
	// `reason` is set only alongside code `HARNESS_CONFIGURATION_INVALID`, one of seven fixed client-safe sentences naming what is wrong with the workspace agent configuration, including a system prompt over PEEN_MAX_SYSTEM_PROMPT_PERCENT of the context window.
	Data      MessageFailedData `json:"data"`
	Timestamp int64             `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

A `message.failed` answering a session-routing failure carries no `metadata.sessionId`: it reaches only the client that sent the rejected message, before Peen knows which session it meant.

func (MessageFailed) MarshalJSON

func (v MessageFailed) MarshalJSON() ([]byte, error)

MarshalJSON encodes MessageFailed with its const properties filled in.

func (*MessageFailed) UnmarshalJSON

func (v *MessageFailed) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes MessageFailed strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (MessageFailed) Validate

func (v MessageFailed) Validate() error

Validate checks the constraints the schema declares for MessageFailed.

type MessageFailedCode

type MessageFailedCode string

AGENT_PAUSED is deprecated and no longer sent, because a message to a paused child now resumes it.

const (
	MessageFailedCodeValidationFailed            MessageFailedCode = "VALIDATION_FAILED"
	MessageFailedCodeInternalServerError         MessageFailedCode = "INTERNAL_SERVER_ERROR"
	MessageFailedCodeSessionNotFound             MessageFailedCode = "SESSION_NOT_FOUND"
	MessageFailedCodeTurnCancelled               MessageFailedCode = "TURN_CANCELLED"
	MessageFailedCodeUserMessageQueueFull        MessageFailedCode = "USER_MESSAGE_QUEUE_FULL"
	MessageFailedCodeSessionBusy                 MessageFailedCode = "SESSION_BUSY"
	MessageFailedCodeAgentFinished               MessageFailedCode = "AGENT_FINISHED"
	MessageFailedCodeAgentNotFound               MessageFailedCode = "AGENT_NOT_FOUND"
	MessageFailedCodeAgentPaused                 MessageFailedCode = "AGENT_PAUSED"
	MessageFailedCodeHarnessConfigurationInvalid MessageFailedCode = "HARNESS_CONFIGURATION_INVALID"
)

Values of MessageFailedCode.

func (MessageFailedCode) Validate

func (v MessageFailedCode) Validate() error

Validate reports whether v is one of the values the schema lists.

type MessageFailedData

type MessageFailedData struct {
	// AGENT_PAUSED is deprecated and no longer sent, because a message to a paused child now resumes it.
	Code    MessageFailedCode `json:"code"`
	Message string            `json:"message"`
	Reason  *string           `json:"reason,omitempty"`
}

`reason` is set only alongside code `HARNESS_CONFIGURATION_INVALID`, one of seven fixed client-safe sentences naming what is wrong with the workspace agent configuration, including a system prompt over PEEN_MAX_SYSTEM_PROMPT_PERCENT of the context window.

func (*MessageFailedData) UnmarshalJSON

func (v *MessageFailedData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes MessageFailedData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (MessageFailedData) Validate

func (v MessageFailedData) Validate() error

Validate checks the constraints the schema declares for MessageFailedData.

type MessageImage added in v0.38.0

type MessageImage struct {
	MediaType MessageImageMediaType `json:"mediaType"`
	// The image bytes, base64-encoded. At most PEEN_MAX_IMAGE_BYTES bytes once decoded, 5242880 by default.
	Data string `json:"data"`
}

func (*MessageImage) UnmarshalJSON added in v0.38.0

func (v *MessageImage) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes MessageImage strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (MessageImage) Validate added in v0.38.0

func (v MessageImage) Validate() error

Validate checks the constraints the schema declares for MessageImage.

type MessageImageMediaType added in v0.38.0

type MessageImageMediaType string
const (
	MessageImageMediaTypeImagePng  MessageImageMediaType = "image/png"
	MessageImageMediaTypeImageJpeg MessageImageMediaType = "image/jpeg"
	MessageImageMediaTypeImageGif  MessageImageMediaType = "image/gif"
	MessageImageMediaTypeImageWebp MessageImageMediaType = "image/webp"
)

Values of MessageImageMediaType.

func (MessageImageMediaType) Validate added in v0.38.0

func (v MessageImageMediaType) Validate() error

Validate reports whether v is one of the values the schema lists.

type MessageSend

type MessageSend struct {
	// Not enforced by the generated code: format uuid.
	ID   string `json:"id"`
	Type string `json:"type"`
	// `to` cannot combine with `model`, `reasoningEffort`, or `systemPrompt`: those settings belong to the root conversation, not a running child's inbox.
	Data      MessageSendData `json:"data"`
	Timestamp *int64          `json:"timestamp,omitempty"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata *Metadata `json:"metadata,omitempty"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

The only client-to-server frame. `metadata.sessionId` names the durable session this message runs against; a client with no session to name, such as an embedded single-workspace runtime, may omit it and fall back to the runtime's own session.

func (MessageSend) MarshalJSON

func (v MessageSend) MarshalJSON() ([]byte, error)

MarshalJSON encodes MessageSend with its const properties filled in.

func (*MessageSend) UnmarshalJSON

func (v *MessageSend) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes MessageSend strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (MessageSend) Validate

func (v MessageSend) Validate() error

Validate checks the constraints the schema declares for MessageSend.

type MessageSendData

type MessageSendData struct {
	// At most PEEN_MAX_MESSAGE_BYTES bytes, 262144 by default. The limit is deployment configuration, so the server enforces it, not this schema.
	Message string `json:"message"`
	// provider/model, one Peen discovered at startup.
	Model           *string                     `json:"model,omitempty"`
	ReasoningEffort *MessageSendReasoningEffort `json:"reasoningEffort,omitempty"`
	SystemPrompt    *MessageSystemPrompt        `json:"systemPrompt,omitempty"`
	// Not enforced by the generated code: format uuid.
	To *string `json:"to,omitempty"`
	// Images the model sees after the message text, at most PEEN_MAX_IMAGES_PER_MESSAGE, 4 by default. Only a message that starts a turn may carry images, and only for a model that accepts image input.
	Images []MessageImage `json:"images,omitempty"`
}

`to` cannot combine with `model`, `reasoningEffort`, or `systemPrompt`: those settings belong to the root conversation, not a running child's inbox.

func (*MessageSendData) UnmarshalJSON

func (v *MessageSendData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes MessageSendData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (MessageSendData) Validate

func (v MessageSendData) Validate() error

Validate checks the constraints the schema declares for MessageSendData.

type MessageSendReasoningEffort

type MessageSendReasoningEffort string
const (
	MessageSendReasoningEffortMinimal MessageSendReasoningEffort = "minimal"
	MessageSendReasoningEffortLow     MessageSendReasoningEffort = "low"
	MessageSendReasoningEffortMedium  MessageSendReasoningEffort = "medium"
	MessageSendReasoningEffortHigh    MessageSendReasoningEffort = "high"
	MessageSendReasoningEffortXhigh   MessageSendReasoningEffort = "xhigh"
	MessageSendReasoningEffortMax     MessageSendReasoningEffort = "max"
)

Values of MessageSendReasoningEffort.

func (MessageSendReasoningEffort) Validate

func (v MessageSendReasoningEffort) Validate() error

Validate reports whether v is one of the values the schema lists.

type MessageSystemPrompt

type MessageSystemPrompt struct {
	// At most PEEN_MAX_SYSTEM_PROMPT_BYTES bytes, 65536 by default. The limit is deployment configuration, so the server enforces it, not this schema.
	Content string                  `json:"content"`
	Mode    MessageSystemPromptMode `json:"mode"`
}

func (*MessageSystemPrompt) UnmarshalJSON

func (v *MessageSystemPrompt) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes MessageSystemPrompt strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (MessageSystemPrompt) Validate

func (v MessageSystemPrompt) Validate() error

Validate checks the constraints the schema declares for MessageSystemPrompt.

type MessageSystemPromptMode

type MessageSystemPromptMode string
const (
	MessageSystemPromptModeAppend  MessageSystemPromptMode = "append"
	MessageSystemPromptModeReplace MessageSystemPromptMode = "replace"
)

Values of MessageSystemPromptMode.

func (MessageSystemPromptMode) Validate

func (v MessageSystemPromptMode) Validate() error

Validate reports whether v is one of the values the schema lists.

type Metadata

type Metadata struct {
	// Not enforced by the generated code: format uuid.
	SessionID *string `json:"sessionId,omitempty"`
	// Not enforced by the generated code: format uuid.
	RequestID *string `json:"requestId,omitempty"`
	Sequence  *int64  `json:"sequence,omitempty"`
}

Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.

func (*Metadata) UnmarshalJSON

func (v *Metadata) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes Metadata strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (Metadata) Validate

func (v Metadata) Validate() error

Validate checks the constraints the schema declares for Metadata.

type Notice

type Notice struct {
	// Not enforced by the generated code: format uuid.
	ID string `json:"id"`
	// Not enforced by the generated code: format uuid.
	SessionID string `json:"sessionId"`
	Type      string `json:"type"`
	Source    string `json:"source"`
	Summary   string `json:"summary"`
	// Open. Caller-supplied at publication time.
	Data      map[string]any `json:"data,omitempty"`
	Delivery  NoticeDelivery `json:"delivery"`
	CreatedAt time.Time      `json:"createdAt"`
}

One notice as it reaches the model, inside a `session.events` frame's `notices`.

func (*Notice) UnmarshalJSON

func (v *Notice) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes Notice strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (Notice) Validate

func (v Notice) Validate() error

Validate checks the constraints the schema declares for Notice.

type NoticeCreated

type NoticeCreated struct {
	// Not enforced by the generated code: format uuid.
	ID   string `json:"id"`
	Type string `json:"type"`
	// A `notice.created` frame's data. Carries no `sessionId`.
	Data      SessionNotice `json:"data"`
	Timestamp int64         `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (NoticeCreated) MarshalJSON

func (v NoticeCreated) MarshalJSON() ([]byte, error)

MarshalJSON encodes NoticeCreated with its const properties filled in.

func (*NoticeCreated) UnmarshalJSON

func (v *NoticeCreated) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes NoticeCreated strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (NoticeCreated) Validate

func (v NoticeCreated) Validate() error

Validate checks the constraints the schema declares for NoticeCreated.

type NoticeDelivery

type NoticeDelivery string
const (
	NoticeDeliveryQueue NoticeDelivery = "queue"
	NoticeDeliveryWake  NoticeDelivery = "wake"
)

Values of NoticeDelivery.

func (NoticeDelivery) Validate

func (v NoticeDelivery) Validate() error

Validate reports whether v is one of the values the schema lists.

type Part

type Part struct {
	Type  PartType       `json:"type"`
	Text  *string        `json:"text,omitempty"`
	Image map[string]any `json:"image,omitempty"`
	Audio map[string]any `json:"audio,omitempty"`
	File  map[string]any `json:"file,omitempty"`
}

One piece of a child's assistant message content. `image`, `audio`, and `file` are open: their shape is the provider-neutral media source Peen's model layer builds, not a Peen-owned contract.

func (*Part) UnmarshalJSON

func (v *Part) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes Part strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (Part) Validate

func (v Part) Validate() error

Validate checks the constraints the schema declares for Part.

type PartType

type PartType string
const (
	PartTypeText  PartType = "text"
	PartTypeImage PartType = "image"
	PartTypeAudio PartType = "audio"
	PartTypeFile  PartType = "file"
)

Values of PartType.

func (PartType) Validate

func (v PartType) Validate() error

Validate reports whether v is one of the values the schema lists.

type ProviderRetry

type ProviderRetry struct {
	Attempt int64               `json:"attempt"`
	Reason  ProviderRetryReason `json:"reason"`
	Status  int64               `json:"status"`
	DelayMs int64               `json:"delayMs"`
}

func (*ProviderRetry) UnmarshalJSON

func (v *ProviderRetry) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes ProviderRetry strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (ProviderRetry) Validate

func (v ProviderRetry) Validate() error

Validate checks the constraints the schema declares for ProviderRetry.

type ProviderRetryEvent

type ProviderRetryEvent struct {
	// Not enforced by the generated code: format uuid.
	ID        string        `json:"id"`
	Type      string        `json:"type"`
	Data      ProviderRetry `json:"data"`
	Timestamp int64         `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (ProviderRetryEvent) MarshalJSON

func (v ProviderRetryEvent) MarshalJSON() ([]byte, error)

MarshalJSON encodes ProviderRetryEvent with its const properties filled in.

func (*ProviderRetryEvent) UnmarshalJSON

func (v *ProviderRetryEvent) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes ProviderRetryEvent strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (ProviderRetryEvent) Validate

func (v ProviderRetryEvent) Validate() error

Validate checks the constraints the schema declares for ProviderRetryEvent.

type ProviderRetryReason

type ProviderRetryReason string
const (
	ProviderRetryReasonEmpty       ProviderRetryReason = ""
	ProviderRetryReasonRateLimited ProviderRetryReason = "rate_limited"
	ProviderRetryReasonServerError ProviderRetryReason = "server_error"
	ProviderRetryReasonTimeout     ProviderRetryReason = "timeout"
	ProviderRetryReasonTransport   ProviderRetryReason = "transport"
)

Values of ProviderRetryReason.

func (ProviderRetryReason) Validate

func (v ProviderRetryReason) Validate() error

Validate reports whether v is one of the values the schema lists.

type QuestionAnswered

type QuestionAnswered struct {
	Answered bool    `json:"answered"`
	CallID   *string `json:"callId,omitempty"`
}

func (*QuestionAnswered) UnmarshalJSON

func (v *QuestionAnswered) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes QuestionAnswered strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (QuestionAnswered) Validate

func (v QuestionAnswered) Validate() error

Validate checks the constraints the schema declares for QuestionAnswered.

type QuestionAnsweredEvent

type QuestionAnsweredEvent struct {
	// Not enforced by the generated code: format uuid.
	ID        string           `json:"id"`
	Type      string           `json:"type"`
	Data      QuestionAnswered `json:"data"`
	Timestamp int64            `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (QuestionAnsweredEvent) MarshalJSON

func (v QuestionAnsweredEvent) MarshalJSON() ([]byte, error)

MarshalJSON encodes QuestionAnsweredEvent with its const properties filled in.

func (*QuestionAnsweredEvent) UnmarshalJSON

func (v *QuestionAnsweredEvent) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes QuestionAnsweredEvent strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (QuestionAnsweredEvent) Validate

func (v QuestionAnsweredEvent) Validate() error

Validate checks the constraints the schema declares for QuestionAnsweredEvent.

type QuestionAsked

type QuestionAsked struct {
	Question string  `json:"question"`
	CallID   *string `json:"callId,omitempty"`
}

func (*QuestionAsked) UnmarshalJSON

func (v *QuestionAsked) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes QuestionAsked strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (QuestionAsked) Validate

func (v QuestionAsked) Validate() error

Validate checks the constraints the schema declares for QuestionAsked.

type QuestionAskedEvent

type QuestionAskedEvent struct {
	// Not enforced by the generated code: format uuid.
	ID        string        `json:"id"`
	Type      string        `json:"type"`
	Data      QuestionAsked `json:"data"`
	Timestamp int64         `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (QuestionAskedEvent) MarshalJSON

func (v QuestionAskedEvent) MarshalJSON() ([]byte, error)

MarshalJSON encodes QuestionAskedEvent with its const properties filled in.

func (*QuestionAskedEvent) UnmarshalJSON

func (v *QuestionAskedEvent) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes QuestionAskedEvent strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (QuestionAskedEvent) Validate

func (v QuestionAskedEvent) Validate() error

Validate checks the constraints the schema declares for QuestionAskedEvent.

type ServerEvent

type ServerEvent struct {
	// contains filtered or unexported fields
}

ServerEvent holds one of several shapes. Set it with the From methods and read it with Value or the As methods.

func (ServerEvent) AsAgentRunAnswer

func (v ServerEvent) AsAgentRunAnswer() (AgentRunAnswer, error)

AsAgentRunAnswer decodes the held value as a AgentRunAnswer.

func (ServerEvent) AsAgentRunAssistantMessage

func (v ServerEvent) AsAgentRunAssistantMessage() (AgentRunAssistantMessage, error)

AsAgentRunAssistantMessage decodes the held value as a AgentRunAssistantMessage.

func (ServerEvent) AsAgentRunCancelled

func (v ServerEvent) AsAgentRunCancelled() (AgentRunCancelled, error)

AsAgentRunCancelled decodes the held value as a AgentRunCancelled.

func (ServerEvent) AsAgentRunCompleted

func (v ServerEvent) AsAgentRunCompleted() (AgentRunCompleted, error)

AsAgentRunCompleted decodes the held value as a AgentRunCompleted.

func (ServerEvent) AsAgentRunFailed

func (v ServerEvent) AsAgentRunFailed() (AgentRunFailed, error)

AsAgentRunFailed decodes the held value as a AgentRunFailed.

func (ServerEvent) AsAgentRunMessageDelivered

func (v ServerEvent) AsAgentRunMessageDelivered() (AgentRunMessageDelivered, error)

AsAgentRunMessageDelivered decodes the held value as a AgentRunMessageDelivered.

func (ServerEvent) AsAgentRunMessageInjected

func (v ServerEvent) AsAgentRunMessageInjected() (AgentRunMessageInjected, error)

AsAgentRunMessageInjected decodes the held value as a AgentRunMessageInjected.

func (ServerEvent) AsAgentRunMessageQueued

func (v ServerEvent) AsAgentRunMessageQueued() (AgentRunMessageQueued, error)

AsAgentRunMessageQueued decodes the held value as a AgentRunMessageQueued.

func (ServerEvent) AsAgentRunMessageUndelivered

func (v ServerEvent) AsAgentRunMessageUndelivered() (AgentRunMessageUndelivered, error)

AsAgentRunMessageUndelivered decodes the held value as a AgentRunMessageUndelivered.

func (ServerEvent) AsAgentRunProviderRetry

func (v ServerEvent) AsAgentRunProviderRetry() (AgentRunProviderRetry, error)

AsAgentRunProviderRetry decodes the held value as a AgentRunProviderRetry.

func (ServerEvent) AsAgentRunQuestion

func (v ServerEvent) AsAgentRunQuestion() (AgentRunQuestion, error)

AsAgentRunQuestion decodes the held value as a AgentRunQuestion.

func (ServerEvent) AsAgentRunStarted

func (v ServerEvent) AsAgentRunStarted() (AgentRunStarted, error)

AsAgentRunStarted decodes the held value as a AgentRunStarted.

func (ServerEvent) AsAgentRunTextDelta

func (v ServerEvent) AsAgentRunTextDelta() (AgentRunTextDelta, error)

AsAgentRunTextDelta decodes the held value as a AgentRunTextDelta.

func (ServerEvent) AsAgentRunThinkingDelta

func (v ServerEvent) AsAgentRunThinkingDelta() (AgentRunThinkingDelta, error)

AsAgentRunThinkingDelta decodes the held value as a AgentRunThinkingDelta.

func (ServerEvent) AsAgentRunToolResult

func (v ServerEvent) AsAgentRunToolResult() (AgentRunToolResult, error)

AsAgentRunToolResult decodes the held value as a AgentRunToolResult.

func (ServerEvent) AsAgentRunToolUse

func (v ServerEvent) AsAgentRunToolUse() (AgentRunToolUse, error)

AsAgentRunToolUse decodes the held value as a AgentRunToolUse.

func (ServerEvent) AsContentBlockDelta

func (v ServerEvent) AsContentBlockDelta() (ContentBlockDelta, error)

AsContentBlockDelta decodes the held value as a ContentBlockDelta.

func (ServerEvent) AsContentBlockStart

func (v ServerEvent) AsContentBlockStart() (ContentBlockStart, error)

AsContentBlockStart decodes the held value as a ContentBlockStart.

func (ServerEvent) AsContentBlockStop

func (v ServerEvent) AsContentBlockStop() (ContentBlockStop, error)

AsContentBlockStop decodes the held value as a ContentBlockStop.

func (ServerEvent) AsHarnessWarning

func (v ServerEvent) AsHarnessWarning() (HarnessWarning, error)

AsHarnessWarning decodes the held value as a HarnessWarning.

func (ServerEvent) AsMcpStatus added in v0.38.0

func (v ServerEvent) AsMcpStatus() (McpStatus, error)

AsMcpStatus decodes the held value as a McpStatus.

func (ServerEvent) AsMessageCompleted

func (v ServerEvent) AsMessageCompleted() (MessageCompleted, error)

AsMessageCompleted decodes the held value as a MessageCompleted.

func (ServerEvent) AsMessageFailed

func (v ServerEvent) AsMessageFailed() (MessageFailed, error)

AsMessageFailed decodes the held value as a MessageFailed.

func (ServerEvent) AsNoticeCreated

func (v ServerEvent) AsNoticeCreated() (NoticeCreated, error)

AsNoticeCreated decodes the held value as a NoticeCreated.

func (ServerEvent) AsProviderRetryEvent

func (v ServerEvent) AsProviderRetryEvent() (ProviderRetryEvent, error)

AsProviderRetryEvent decodes the held value as a ProviderRetryEvent.

func (ServerEvent) AsQuestionAnsweredEvent

func (v ServerEvent) AsQuestionAnsweredEvent() (QuestionAnsweredEvent, error)

AsQuestionAnsweredEvent decodes the held value as a QuestionAnsweredEvent.

func (ServerEvent) AsQuestionAskedEvent

func (v ServerEvent) AsQuestionAskedEvent() (QuestionAskedEvent, error)

AsQuestionAskedEvent decodes the held value as a QuestionAskedEvent.

func (ServerEvent) AsSessionEvents

func (v ServerEvent) AsSessionEvents() (SessionEvents, error)

AsSessionEvents decodes the held value as a SessionEvents.

func (ServerEvent) AsSkillInjected

func (v ServerEvent) AsSkillInjected() (SkillInjected, error)

AsSkillInjected decodes the held value as a SkillInjected.

func (ServerEvent) AsToolResultEvent

func (v ServerEvent) AsToolResultEvent() (ToolResultEvent, error)

AsToolResultEvent decodes the held value as a ToolResultEvent.

func (ServerEvent) AsToolUseEvent

func (v ServerEvent) AsToolUseEvent() (ToolUseEvent, error)

AsToolUseEvent decodes the held value as a ToolUseEvent.

func (ServerEvent) AsTurnCancelled

func (v ServerEvent) AsTurnCancelled() (TurnCancelled, error)

AsTurnCancelled decodes the held value as a TurnCancelled.

func (ServerEvent) AsTurnCompleted

func (v ServerEvent) AsTurnCompleted() (TurnCompleted, error)

AsTurnCompleted decodes the held value as a TurnCompleted.

func (ServerEvent) AsTurnFailed

func (v ServerEvent) AsTurnFailed() (TurnFailed, error)

AsTurnFailed decodes the held value as a TurnFailed.

func (ServerEvent) AsTurnStarted

func (v ServerEvent) AsTurnStarted() (TurnStarted, error)

AsTurnStarted decodes the held value as a TurnStarted.

func (ServerEvent) AsUserMessageCreated

func (v ServerEvent) AsUserMessageCreated() (UserMessageCreated, error)

AsUserMessageCreated decodes the held value as a UserMessageCreated.

func (ServerEvent) AsUserMessageDelivered

func (v ServerEvent) AsUserMessageDelivered() (UserMessageDelivered, error)

AsUserMessageDelivered decodes the held value as a UserMessageDelivered.

func (ServerEvent) AsUserMessageQueued

func (v ServerEvent) AsUserMessageQueued() (UserMessageQueued, error)

AsUserMessageQueued decodes the held value as a UserMessageQueued.

func (ServerEvent) Discriminator

func (v ServerEvent) Discriminator() (string, error)

Discriminator returns the "type" property that selects the variant.

func (*ServerEvent) FromAgentRunAnswer

func (v *ServerEvent) FromAgentRunAnswer(value AgentRunAnswer) error

FromAgentRunAnswer sets the held value to a AgentRunAnswer.

func (*ServerEvent) FromAgentRunAssistantMessage

func (v *ServerEvent) FromAgentRunAssistantMessage(value AgentRunAssistantMessage) error

FromAgentRunAssistantMessage sets the held value to a AgentRunAssistantMessage.

func (*ServerEvent) FromAgentRunCancelled

func (v *ServerEvent) FromAgentRunCancelled(value AgentRunCancelled) error

FromAgentRunCancelled sets the held value to a AgentRunCancelled.

func (*ServerEvent) FromAgentRunCompleted

func (v *ServerEvent) FromAgentRunCompleted(value AgentRunCompleted) error

FromAgentRunCompleted sets the held value to a AgentRunCompleted.

func (*ServerEvent) FromAgentRunFailed

func (v *ServerEvent) FromAgentRunFailed(value AgentRunFailed) error

FromAgentRunFailed sets the held value to a AgentRunFailed.

func (*ServerEvent) FromAgentRunMessageDelivered

func (v *ServerEvent) FromAgentRunMessageDelivered(value AgentRunMessageDelivered) error

FromAgentRunMessageDelivered sets the held value to a AgentRunMessageDelivered.

func (*ServerEvent) FromAgentRunMessageInjected

func (v *ServerEvent) FromAgentRunMessageInjected(value AgentRunMessageInjected) error

FromAgentRunMessageInjected sets the held value to a AgentRunMessageInjected.

func (*ServerEvent) FromAgentRunMessageQueued

func (v *ServerEvent) FromAgentRunMessageQueued(value AgentRunMessageQueued) error

FromAgentRunMessageQueued sets the held value to a AgentRunMessageQueued.

func (*ServerEvent) FromAgentRunMessageUndelivered

func (v *ServerEvent) FromAgentRunMessageUndelivered(value AgentRunMessageUndelivered) error

FromAgentRunMessageUndelivered sets the held value to a AgentRunMessageUndelivered.

func (*ServerEvent) FromAgentRunProviderRetry

func (v *ServerEvent) FromAgentRunProviderRetry(value AgentRunProviderRetry) error

FromAgentRunProviderRetry sets the held value to a AgentRunProviderRetry.

func (*ServerEvent) FromAgentRunQuestion

func (v *ServerEvent) FromAgentRunQuestion(value AgentRunQuestion) error

FromAgentRunQuestion sets the held value to a AgentRunQuestion.

func (*ServerEvent) FromAgentRunStarted

func (v *ServerEvent) FromAgentRunStarted(value AgentRunStarted) error

FromAgentRunStarted sets the held value to a AgentRunStarted.

func (*ServerEvent) FromAgentRunTextDelta

func (v *ServerEvent) FromAgentRunTextDelta(value AgentRunTextDelta) error

FromAgentRunTextDelta sets the held value to a AgentRunTextDelta.

func (*ServerEvent) FromAgentRunThinkingDelta

func (v *ServerEvent) FromAgentRunThinkingDelta(value AgentRunThinkingDelta) error

FromAgentRunThinkingDelta sets the held value to a AgentRunThinkingDelta.

func (*ServerEvent) FromAgentRunToolResult

func (v *ServerEvent) FromAgentRunToolResult(value AgentRunToolResult) error

FromAgentRunToolResult sets the held value to a AgentRunToolResult.

func (*ServerEvent) FromAgentRunToolUse

func (v *ServerEvent) FromAgentRunToolUse(value AgentRunToolUse) error

FromAgentRunToolUse sets the held value to a AgentRunToolUse.

func (*ServerEvent) FromContentBlockDelta

func (v *ServerEvent) FromContentBlockDelta(value ContentBlockDelta) error

FromContentBlockDelta sets the held value to a ContentBlockDelta.

func (*ServerEvent) FromContentBlockStart

func (v *ServerEvent) FromContentBlockStart(value ContentBlockStart) error

FromContentBlockStart sets the held value to a ContentBlockStart.

func (*ServerEvent) FromContentBlockStop

func (v *ServerEvent) FromContentBlockStop(value ContentBlockStop) error

FromContentBlockStop sets the held value to a ContentBlockStop.

func (*ServerEvent) FromHarnessWarning

func (v *ServerEvent) FromHarnessWarning(value HarnessWarning) error

FromHarnessWarning sets the held value to a HarnessWarning.

func (*ServerEvent) FromMcpStatus added in v0.38.0

func (v *ServerEvent) FromMcpStatus(value McpStatus) error

FromMcpStatus sets the held value to a McpStatus.

func (*ServerEvent) FromMessageCompleted

func (v *ServerEvent) FromMessageCompleted(value MessageCompleted) error

FromMessageCompleted sets the held value to a MessageCompleted.

func (*ServerEvent) FromMessageFailed

func (v *ServerEvent) FromMessageFailed(value MessageFailed) error

FromMessageFailed sets the held value to a MessageFailed.

func (*ServerEvent) FromNoticeCreated

func (v *ServerEvent) FromNoticeCreated(value NoticeCreated) error

FromNoticeCreated sets the held value to a NoticeCreated.

func (*ServerEvent) FromProviderRetryEvent

func (v *ServerEvent) FromProviderRetryEvent(value ProviderRetryEvent) error

FromProviderRetryEvent sets the held value to a ProviderRetryEvent.

func (*ServerEvent) FromQuestionAnsweredEvent

func (v *ServerEvent) FromQuestionAnsweredEvent(value QuestionAnsweredEvent) error

FromQuestionAnsweredEvent sets the held value to a QuestionAnsweredEvent.

func (*ServerEvent) FromQuestionAskedEvent

func (v *ServerEvent) FromQuestionAskedEvent(value QuestionAskedEvent) error

FromQuestionAskedEvent sets the held value to a QuestionAskedEvent.

func (*ServerEvent) FromSessionEvents

func (v *ServerEvent) FromSessionEvents(value SessionEvents) error

FromSessionEvents sets the held value to a SessionEvents.

func (*ServerEvent) FromSkillInjected

func (v *ServerEvent) FromSkillInjected(value SkillInjected) error

FromSkillInjected sets the held value to a SkillInjected.

func (*ServerEvent) FromToolResultEvent

func (v *ServerEvent) FromToolResultEvent(value ToolResultEvent) error

FromToolResultEvent sets the held value to a ToolResultEvent.

func (*ServerEvent) FromToolUseEvent

func (v *ServerEvent) FromToolUseEvent(value ToolUseEvent) error

FromToolUseEvent sets the held value to a ToolUseEvent.

func (*ServerEvent) FromTurnCancelled

func (v *ServerEvent) FromTurnCancelled(value TurnCancelled) error

FromTurnCancelled sets the held value to a TurnCancelled.

func (*ServerEvent) FromTurnCompleted

func (v *ServerEvent) FromTurnCompleted(value TurnCompleted) error

FromTurnCompleted sets the held value to a TurnCompleted.

func (*ServerEvent) FromTurnFailed

func (v *ServerEvent) FromTurnFailed(value TurnFailed) error

FromTurnFailed sets the held value to a TurnFailed.

func (*ServerEvent) FromTurnStarted

func (v *ServerEvent) FromTurnStarted(value TurnStarted) error

FromTurnStarted sets the held value to a TurnStarted.

func (*ServerEvent) FromUserMessageCreated

func (v *ServerEvent) FromUserMessageCreated(value UserMessageCreated) error

FromUserMessageCreated sets the held value to a UserMessageCreated.

func (*ServerEvent) FromUserMessageDelivered

func (v *ServerEvent) FromUserMessageDelivered(value UserMessageDelivered) error

FromUserMessageDelivered sets the held value to a UserMessageDelivered.

func (*ServerEvent) FromUserMessageQueued

func (v *ServerEvent) FromUserMessageQueued(value UserMessageQueued) error

FromUserMessageQueued sets the held value to a UserMessageQueued.

func (ServerEvent) MarshalJSON

func (v ServerEvent) MarshalJSON() ([]byte, error)

MarshalJSON encodes the held value.

func (*ServerEvent) UnmarshalJSON

func (v *ServerEvent) UnmarshalJSON(data []byte) error

UnmarshalJSON stores data after checking that it is exactly one variant.

func (ServerEvent) Validate

func (v ServerEvent) Validate() error

Validate checks that the held value is a valid variant.

func (ServerEvent) Value

func (v ServerEvent) Value() (any, error)

Value decodes the held value as the variant its discriminator selects.

type SessionEvents

type SessionEvents struct {
	// Not enforced by the generated code: format uuid.
	ID        string            `json:"id"`
	Type      string            `json:"type"`
	Data      SessionEventsData `json:"data"`
	Timestamp int64             `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (SessionEvents) MarshalJSON

func (v SessionEvents) MarshalJSON() ([]byte, error)

MarshalJSON encodes SessionEvents with its const properties filled in.

func (*SessionEvents) UnmarshalJSON

func (v *SessionEvents) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes SessionEvents strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (SessionEvents) Validate

func (v SessionEvents) Validate() error

Validate checks the constraints the schema declares for SessionEvents.

type SessionEventsData

type SessionEventsData struct {
	Notices []Notice `json:"notices"`
	Dropped int64    `json:"dropped"`
}

func (*SessionEventsData) UnmarshalJSON

func (v *SessionEventsData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes SessionEventsData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (SessionEventsData) Validate

func (v SessionEventsData) Validate() error

Validate checks the constraints the schema declares for SessionEventsData.

type SessionNotice

type SessionNotice struct {
	// Not enforced by the generated code: format uuid.
	ID      string `json:"id"`
	Type    string `json:"type"`
	Source  string `json:"source"`
	Summary string `json:"summary"`
	// Open. Caller-supplied at publication time.
	Data      map[string]any        `json:"data,omitempty"`
	Delivery  SessionNoticeDelivery `json:"delivery"`
	CreatedAt time.Time             `json:"createdAt"`
}

A `notice.created` frame's data. Carries no `sessionId`.

func (*SessionNotice) UnmarshalJSON

func (v *SessionNotice) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes SessionNotice strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (SessionNotice) Validate

func (v SessionNotice) Validate() error

Validate checks the constraints the schema declares for SessionNotice.

type SessionNoticeDelivery

type SessionNoticeDelivery string
const (
	SessionNoticeDeliveryQueue SessionNoticeDelivery = "queue"
	SessionNoticeDeliveryWake  SessionNoticeDelivery = "wake"
)

Values of SessionNoticeDelivery.

func (SessionNoticeDelivery) Validate

func (v SessionNoticeDelivery) Validate() error

Validate reports whether v is one of the values the schema lists.

type SkillInjected

type SkillInjected struct {
	// Not enforced by the generated code: format uuid.
	ID        string            `json:"id"`
	Type      string            `json:"type"`
	Data      SkillInjectedData `json:"data"`
	Timestamp int64             `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (SkillInjected) MarshalJSON

func (v SkillInjected) MarshalJSON() ([]byte, error)

MarshalJSON encodes SkillInjected with its const properties filled in.

func (*SkillInjected) UnmarshalJSON

func (v *SkillInjected) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes SkillInjected strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (SkillInjected) Validate

func (v SkillInjected) Validate() error

Validate checks the constraints the schema declares for SkillInjected.

type SkillInjectedData

type SkillInjectedData struct {
	Name    string `json:"name"`
	Content string `json:"content"`
}

func (*SkillInjectedData) UnmarshalJSON

func (v *SkillInjectedData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes SkillInjectedData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (SkillInjectedData) Validate

func (v SkillInjectedData) Validate() error

Validate checks the constraints the schema declares for SkillInjectedData.

type TextDelta

type TextDelta struct {
	Type string `json:"type"`
	Text string `json:"text"`
}

func (TextDelta) MarshalJSON

func (v TextDelta) MarshalJSON() ([]byte, error)

MarshalJSON encodes TextDelta with its const properties filled in.

func (*TextDelta) UnmarshalJSON

func (v *TextDelta) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes TextDelta strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (TextDelta) Validate

func (v TextDelta) Validate() error

Validate checks the constraints the schema declares for TextDelta.

type TextPayload

type TextPayload struct {
	Text string `json:"text"`
}

func (*TextPayload) UnmarshalJSON

func (v *TextPayload) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes TextPayload strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (TextPayload) Validate

func (v TextPayload) Validate() error

Validate checks the constraints the schema declares for TextPayload.

type ThinkingDelta

type ThinkingDelta struct {
	Type string `json:"type"`
	Text string `json:"text"`
}

func (ThinkingDelta) MarshalJSON

func (v ThinkingDelta) MarshalJSON() ([]byte, error)

MarshalJSON encodes ThinkingDelta with its const properties filled in.

func (*ThinkingDelta) UnmarshalJSON

func (v *ThinkingDelta) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes ThinkingDelta strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (ThinkingDelta) Validate

func (v ThinkingDelta) Validate() error

Validate checks the constraints the schema declares for ThinkingDelta.

type ToolResult

type ToolResult struct {
	CallID  string `json:"callId"`
	Name    string `json:"name"`
	Content string `json:"content"`
	IsError bool   `json:"isError"`
}

func (*ToolResult) UnmarshalJSON

func (v *ToolResult) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes ToolResult strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (ToolResult) Validate

func (v ToolResult) Validate() error

Validate checks the constraints the schema declares for ToolResult.

type ToolResultEvent

type ToolResultEvent struct {
	// Not enforced by the generated code: format uuid.
	ID        string     `json:"id"`
	Type      string     `json:"type"`
	Data      ToolResult `json:"data"`
	Timestamp int64      `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (ToolResultEvent) MarshalJSON

func (v ToolResultEvent) MarshalJSON() ([]byte, error)

MarshalJSON encodes ToolResultEvent with its const properties filled in.

func (*ToolResultEvent) UnmarshalJSON

func (v *ToolResultEvent) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes ToolResultEvent strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (ToolResultEvent) Validate

func (v ToolResultEvent) Validate() error

Validate checks the constraints the schema declares for ToolResultEvent.

type ToolUse

type ToolUse struct {
	CallID string `json:"callId"`
	Name   string `json:"name"`
	// Open. The tool's own arguments, shaped by that tool, exactly as the provider returned them; null when the provider sent none.
	Arguments map[string]any `json:"arguments"`
}

func (*ToolUse) UnmarshalJSON

func (v *ToolUse) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes ToolUse strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (ToolUse) Validate

func (v ToolUse) Validate() error

Validate checks the constraints the schema declares for ToolUse.

type ToolUseEvent

type ToolUseEvent struct {
	// Not enforced by the generated code: format uuid.
	ID        string  `json:"id"`
	Type      string  `json:"type"`
	Data      ToolUse `json:"data"`
	Timestamp int64   `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (ToolUseEvent) MarshalJSON

func (v ToolUseEvent) MarshalJSON() ([]byte, error)

MarshalJSON encodes ToolUseEvent with its const properties filled in.

func (*ToolUseEvent) UnmarshalJSON

func (v *ToolUseEvent) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes ToolUseEvent strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (ToolUseEvent) Validate

func (v ToolUseEvent) Validate() error

Validate checks the constraints the schema declares for ToolUseEvent.

type TurnCancelled

type TurnCancelled struct {
	// Not enforced by the generated code: format uuid.
	ID        string            `json:"id"`
	Type      string            `json:"type"`
	Data      TurnCancelledData `json:"data"`
	Timestamp int64             `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (TurnCancelled) MarshalJSON

func (v TurnCancelled) MarshalJSON() ([]byte, error)

MarshalJSON encodes TurnCancelled with its const properties filled in.

func (*TurnCancelled) UnmarshalJSON

func (v *TurnCancelled) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes TurnCancelled strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (TurnCancelled) Validate

func (v TurnCancelled) Validate() error

Validate checks the constraints the schema declares for TurnCancelled.

type TurnCancelledData

type TurnCancelledData struct {
	Reason string `json:"reason"`
}

func (TurnCancelledData) MarshalJSON

func (v TurnCancelledData) MarshalJSON() ([]byte, error)

MarshalJSON encodes TurnCancelledData with its const properties filled in.

func (*TurnCancelledData) UnmarshalJSON

func (v *TurnCancelledData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes TurnCancelledData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (TurnCancelledData) Validate

func (v TurnCancelledData) Validate() error

Validate checks the constraints the schema declares for TurnCancelledData.

type TurnCompleted

type TurnCompleted struct {
	// Not enforced by the generated code: format uuid.
	ID        string            `json:"id"`
	Type      string            `json:"type"`
	Data      TurnCompletedData `json:"data"`
	Timestamp int64             `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (TurnCompleted) MarshalJSON

func (v TurnCompleted) MarshalJSON() ([]byte, error)

MarshalJSON encodes TurnCompleted with its const properties filled in.

func (*TurnCompleted) UnmarshalJSON

func (v *TurnCompleted) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes TurnCompleted strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (TurnCompleted) Validate

func (v TurnCompleted) Validate() error

Validate checks the constraints the schema declares for TurnCompleted.

type TurnCompletedData

type TurnCompletedData struct {
	Model string `json:"model"`
	Text  string `json:"text"`
	// Why the model stopped its final reply, as the provider reported it, such as `stop`, or `length` when the reply reached the output token limit and was cut off. Absent when the provider reported no reason.
	FinishReason *string `json:"finishReason,omitempty"`
}

func (*TurnCompletedData) UnmarshalJSON

func (v *TurnCompletedData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes TurnCompletedData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (TurnCompletedData) Validate

func (v TurnCompletedData) Validate() error

Validate checks the constraints the schema declares for TurnCompletedData.

type TurnFailed

type TurnFailed struct {
	// Not enforced by the generated code: format uuid.
	ID        string         `json:"id"`
	Type      string         `json:"type"`
	Data      TurnFailedData `json:"data"`
	Timestamp int64          `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (TurnFailed) MarshalJSON

func (v TurnFailed) MarshalJSON() ([]byte, error)

MarshalJSON encodes TurnFailed with its const properties filled in.

func (*TurnFailed) UnmarshalJSON

func (v *TurnFailed) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes TurnFailed strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (TurnFailed) Validate

func (v TurnFailed) Validate() error

Validate checks the constraints the schema declares for TurnFailed.

type TurnFailedData

type TurnFailedData struct {
	Reason string `json:"reason"`
	// The error the turn ended with, without source locations. Absent when the turn failed before Peen recorded one.
	Error *string `json:"error,omitempty"`
}

func (TurnFailedData) MarshalJSON

func (v TurnFailedData) MarshalJSON() ([]byte, error)

MarshalJSON encodes TurnFailedData with its const properties filled in.

func (*TurnFailedData) UnmarshalJSON

func (v *TurnFailedData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes TurnFailedData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (TurnFailedData) Validate

func (v TurnFailedData) Validate() error

Validate checks the constraints the schema declares for TurnFailedData.

type TurnStarted

type TurnStarted struct {
	// Not enforced by the generated code: format uuid.
	ID   string `json:"id"`
	Type string `json:"type"`
	// `originEventId` and `originEventType` are present only on a turn a session event started.
	Data      TurnStartedData `json:"data"`
	Timestamp int64           `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (TurnStarted) MarshalJSON

func (v TurnStarted) MarshalJSON() ([]byte, error)

MarshalJSON encodes TurnStarted with its const properties filled in.

func (*TurnStarted) UnmarshalJSON

func (v *TurnStarted) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes TurnStarted strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (TurnStarted) Validate

func (v TurnStarted) Validate() error

Validate checks the constraints the schema declares for TurnStarted.

type TurnStartedData

type TurnStartedData struct {
	// Not enforced by the generated code: format uuid.
	SessionID string `json:"sessionId"`
	Model     string `json:"model"`
	Workspace string `json:"workspace"`
	// Not enforced by the generated code: format uuid.
	OriginEventID   *string `json:"originEventId,omitempty"`
	OriginEventType *string `json:"originEventType,omitempty"`
}

`originEventId` and `originEventType` are present only on a turn a session event started.

func (*TurnStartedData) UnmarshalJSON

func (v *TurnStartedData) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes TurnStartedData strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (TurnStartedData) Validate

func (v TurnStartedData) Validate() error

Validate checks the constraints the schema declares for TurnStartedData.

type UserMessage

type UserMessage struct {
	Message string `json:"message"`
	// Not enforced by the generated code: format uuid.
	SourceEventID *string `json:"sourceEventId,omitempty"`
	// The images sent with the message, without their bytes.
	Images []UserMessageImage `json:"images,omitempty"`
}

func (*UserMessage) UnmarshalJSON

func (v *UserMessage) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes UserMessage strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (UserMessage) Validate

func (v UserMessage) Validate() error

Validate checks the constraints the schema declares for UserMessage.

type UserMessageCreated

type UserMessageCreated struct {
	// Not enforced by the generated code: format uuid.
	ID        string      `json:"id"`
	Type      string      `json:"type"`
	Data      UserMessage `json:"data"`
	Timestamp int64       `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (UserMessageCreated) MarshalJSON

func (v UserMessageCreated) MarshalJSON() ([]byte, error)

MarshalJSON encodes UserMessageCreated with its const properties filled in.

func (*UserMessageCreated) UnmarshalJSON

func (v *UserMessageCreated) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes UserMessageCreated strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (UserMessageCreated) Validate

func (v UserMessageCreated) Validate() error

Validate checks the constraints the schema declares for UserMessageCreated.

type UserMessageDelivered

type UserMessageDelivered struct {
	// Not enforced by the generated code: format uuid.
	ID        string      `json:"id"`
	Type      string      `json:"type"`
	Data      UserMessage `json:"data"`
	Timestamp int64       `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (UserMessageDelivered) MarshalJSON

func (v UserMessageDelivered) MarshalJSON() ([]byte, error)

MarshalJSON encodes UserMessageDelivered with its const properties filled in.

func (*UserMessageDelivered) UnmarshalJSON

func (v *UserMessageDelivered) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes UserMessageDelivered strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (UserMessageDelivered) Validate

func (v UserMessageDelivered) Validate() error

Validate checks the constraints the schema declares for UserMessageDelivered.

type UserMessageImage added in v0.38.0

type UserMessageImage struct {
	MediaType string `json:"mediaType"`
	SizeBytes int64  `json:"sizeBytes"`
}

func (*UserMessageImage) UnmarshalJSON added in v0.38.0

func (v *UserMessageImage) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes UserMessageImage strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (UserMessageImage) Validate added in v0.38.0

func (v UserMessageImage) Validate() error

Validate checks the constraints the schema declares for UserMessageImage.

type UserMessageQueued

type UserMessageQueued struct {
	// Not enforced by the generated code: format uuid.
	ID        string      `json:"id"`
	Type      string      `json:"type"`
	Data      UserMessage `json:"data"`
	Timestamp int64       `json:"timestamp"`
	// Routing and cursor information carried alongside every frame. Not every field is present on every frame: a session-routing `message.failed` sent only to its sender carries no `sessionId`, and only a sequenced feed frame carries `sequence`.
	Metadata Metadata `json:"metadata"`
	// Not enforced by the generated code: format uuid.
	TriggeredBy *string `json:"triggeredBy,omitempty"`
}

func (UserMessageQueued) MarshalJSON

func (v UserMessageQueued) MarshalJSON() ([]byte, error)

MarshalJSON encodes UserMessageQueued with its const properties filled in.

func (*UserMessageQueued) UnmarshalJSON

func (v *UserMessageQueued) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes UserMessageQueued strictly. Required properties must be present and the decoded value must pass Validate. Properties the schema does not declare are rejected.

func (UserMessageQueued) Validate

func (v UserMessageQueued) Validate() error

Validate checks the constraints the schema declares for UserMessageQueued.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL