models

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TurnStateRunning     TurnState = "running"
	TurnStateCompleted   TurnState = "completed"
	TurnStateFailed      TurnState = "failed"
	TurnStateCancelled   TurnState = "cancelled"
	TurnStateInterrupted TurnState = "interrupted"

	MessageRoleUser      MessageRole = "user"
	MessageRoleAssistant MessageRole = "assistant"
	MessageRoleTool      MessageRole = "tool"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Compaction

type Compaction struct {
	ID                     uuid.UUID
	SessionID              uuid.UUID
	FromMessageID          uuid.UUID
	ToMessageID            uuid.UUID
	FromSequence           int64
	ToSequence             int64
	Summary                string
	SourceMessageCount     int64
	InputTokenCount        int64
	SummaryTokenCount      int64
	ModelID                string
	PromptHash             string
	CreatedAt              time.Time
	SupersedesCompactionID *uuid.UUID
}

Compaction is one immutable summary covering a completed message prefix.

func (Compaction) TableName

func (Compaction) TableName() string

TableName pins the schema-owned compactions table name.

type ContextSnapshot

type ContextSnapshot struct {
	Hash            string `gorm:"primaryKey"`
	ManifestJSON    string
	ResolvedContent string
	CreatedAt       time.Time
}

ContextSnapshot stores one immutable resolved harness context.

func (ContextSnapshot) TableName

func (ContextSnapshot) TableName() string

TableName pins the schema-owned context_snapshots table name.

type Event

type Event struct {
	ID               uuid.UUID
	SessionID        uuid.UUID
	TurnID           uuid.UUID
	Sequence         int64
	RequestID        uuid.UUID
	EventType        string
	PayloadJSON      string
	ParentToolCallID string
	CreatedAt        time.Time
}

Event is one ordered internal or protocol event in a session transcript.

func (Event) TableName

func (Event) TableName() string

TableName pins the schema-owned events table name.

type Message

type Message struct {
	ID            uuid.UUID
	SessionID     uuid.UUID
	TurnID        uuid.UUID
	Sequence      int64
	Workspace     string
	Role          MessageRole
	Content       string
	ModelID       string
	Thinking      string
	ToolCallsJSON string
	ToolCallID    string
	IsError       bool
	Incomplete    bool
	CreatedAt     time.Time
}

Message is one durable user, assistant, or tool transcript record.

func (Message) TableName

func (Message) TableName() string

TableName pins the schema-owned messages table name.

type MessageRole

type MessageRole string

MessageRole identifies a transcript message source.

type PromptSnapshot

type PromptSnapshot struct {
	Hash            string `gorm:"primaryKey"`
	EffectivePrompt string
	CreatedAt       time.Time
}

PromptSnapshot stores one immutable effective prompt.

func (PromptSnapshot) TableName

func (PromptSnapshot) TableName() string

TableName pins the schema-owned prompt_snapshots table name.

type Session

type Session struct {
	ID                    uuid.UUID
	CreatedAt             time.Time
	UpdatedAt             time.Time
	LastMessageAt         *time.Time
	MessageCount          int64
	CompletedTurnCount    int64
	LastCompletedSequence int64
	ActiveContextHash     string
	RootAgent             string
	ModelID               string
}

Session is the durable metadata for one Peen conversation.

func (Session) TableName

func (Session) TableName() string

TableName pins the schema-owned sessions table name.

type Turn

type Turn struct {
	ID                    uuid.UUID
	SessionID             uuid.UUID
	RequestID             uuid.UUID
	Workspace             string
	State                 TurnState
	CancelRequested       bool
	StartedAt             time.Time
	CompletedAt           *time.Time
	FailureClassification string
	ContextSnapshotHash   *string
	PromptSnapshotHash    *string
}

Turn is one request execution within a session.

func (Turn) TableName

func (Turn) TableName() string

TableName pins the schema-owned turns table name.

type TurnState

type TurnState string

TurnState is the durable lifecycle state of one session turn.

Jump to

Keyboard shortcuts

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