Documentation
¶
Index ¶
- Constants
- type AgentRun
- type AgentRunDefinition
- type AgentRunEvent
- type AgentRunState
- type Compaction
- type ContextSnapshot
- type Event
- type Job
- type JobOutputLine
- type JobOutputStream
- type JobSignal
- type JobSignalRequest
- type JobState
- type Message
- type MessageRole
- type ModelCall
- type ModelCallState
- type ModelRun
- type ModelRunStage
- type ModelRunState
- type NoticeDelivery
- type NoticeState
- type PromptSnapshot
- type Session
- type SessionNotice
- type Turn
- type TurnState
Constants ¶
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" AgentRunStateRunning AgentRunState = "running" AgentRunStateCompleted AgentRunState = "completed" AgentRunStateFailed AgentRunState = "failed" AgentRunStateCancelled AgentRunState = "cancelled" AgentRunStateInterrupted AgentRunState = "interrupted" AgentRunDefinitionStored AgentRunDefinition = "stored" AgentRunDefinitionAdHoc AgentRunDefinition = "ad-hoc" NoticeDeliveryQueue NoticeDelivery = "queue" NoticeDeliveryWake NoticeDelivery = "wake" NoticeStatePending NoticeState = "pending" NoticeStateDelivered NoticeState = "delivered" JobStateRunning JobState = "running" JobStateExited JobState = "exited" JobStateSignalled JobState = "signalled" JobStateFailed JobState = "failed" JobStateInterrupted JobState = "interrupted" JobOutputStreamStdout JobOutputStream = "stdout" JobOutputStreamStderr JobOutputStream = "stderr" JobSignalStop JobSignal = "stop" JobSignalKill JobSignal = "kill" ModelRunStageTurn ModelRunStage = "turn" ModelRunStageChild ModelRunStage = "child" ModelRunStageCompaction ModelRunStage = "compaction" ModelRunStateRunning ModelRunState = "running" ModelRunStateCompleted ModelRunState = "completed" ModelRunStateFailed ModelRunState = "failed" ModelRunStateCancelled ModelRunState = "cancelled" ModelRunStateInterrupted ModelRunState = "interrupted" ModelCallStateRunning ModelCallState = "running" ModelCallStateCompleted ModelCallState = "completed" ModelCallStateFailed ModelCallState = "failed" ModelCallStateCancelled ModelCallState = "cancelled" ModelCallStateInterrupted ModelCallState = "interrupted" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentRun ¶ added in v0.4.0
type AgentRun struct {
ID uuid.UUID
SessionID uuid.UUID
ParentTurnID uuid.UUID
ParentAgentRunID *uuid.UUID
ParentToolCallID string
RequestID uuid.UUID
Name string
Definition AgentRunDefinition
Depth int64
Workspace string
ModelReference string
ModelID string
Task string
Instructions string
AllowedToolsJSON string
SystemPrompt string
EventCount int64
CancelRequested bool
State AgentRunState
ResponseText string
ResponseThinking string
ResponseMessagesJSON string
FinishReason string
PromptTokenCount int64
CompletionTokenCount int64
FailureClassification string
FailureDetail string
StartedAt time.Time
EndedAt *time.Time
}
AgentRun is one durable child-agent execution launched from a session turn.
type AgentRunDefinition ¶ added in v0.4.0
type AgentRunDefinition string
AgentRunDefinition records whether a child is stored or inline.
type AgentRunEvent ¶ added in v0.4.0
type AgentRunEvent struct {
ID uuid.UUID
SessionID uuid.UUID
AgentRunID uuid.UUID
Sequence int64
EventType string
PayloadJSON string
CreatedAt time.Time
}
AgentRunEvent is one ordered, replayable child-agent event.
func (AgentRunEvent) TableName ¶ added in v0.4.0
func (AgentRunEvent) TableName() string
TableName pins the schema-owned agent_run_events table name.
type AgentRunState ¶ added in v0.4.0
type AgentRunState string
AgentRunState is the durable lifecycle state of one child-agent run.
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.
type Job ¶ added in v0.4.0
type Job struct {
ID uuid.UUID
SessionID uuid.UUID
TurnID uuid.UUID
ToolCallID string
PID int64 `gorm:"column:pid"`
Purpose string
Command string
Directory string
State JobState
ExitCode int64
FailureDetail string
StartedAt time.Time
EndedAt *time.Time
}
Job is one durable supervised process launched from a session turn.
type JobOutputLine ¶ added in v0.4.0
type JobOutputLine struct {
ID uuid.UUID
SessionID uuid.UUID
JobID uuid.UUID
Sequence int64
Stream JobOutputStream
Content string
CreatedAt time.Time
}
JobOutputLine is one ordered immutable stdout or stderr line.
func (JobOutputLine) TableName ¶ added in v0.4.0
func (JobOutputLine) TableName() string
TableName pins the schema-owned job_output_lines table name.
type JobOutputStream ¶ added in v0.4.0
type JobOutputStream string
JobOutputStream identifies one process output stream.
type JobSignal ¶ added in v0.4.0
type JobSignal string
JobSignal identifies a requested process signal.
type JobSignalRequest ¶ added in v0.4.0
type JobSignalRequest struct {
ID uuid.UUID
SessionID uuid.UUID
JobID uuid.UUID
Signal JobSignal
Accepted bool
StateAtRequest JobState
RequestedAt time.Time
}
JobSignalRequest records every accepted or no-op request to signal a job.
func (JobSignalRequest) TableName ¶ added in v0.4.0
func (JobSignalRequest) TableName() string
TableName pins the schema-owned job_signal_requests table name.
type JobState ¶ added in v0.4.0
type JobState string
JobState is the durable lifecycle state of one supervised process.
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
CompactionID *uuid.UUID
IsError bool
Incomplete bool
CreatedAt time.Time
}
Message is one durable user, assistant, or tool transcript record.
type ModelCall ¶ added in v0.4.0
type ModelCall struct {
ID uuid.UUID
SessionID uuid.UUID
ModelRunID uuid.UUID
Round int64
RequestMessagesJSON string
RequestToolsJSON string
State ModelCallState
ResponseMessageJSON string
ResponseUsageJSON string
RetryAttemptsJSON string
RetryAttemptCount int64
PromptTokens int64
CompletionTokens int64
TotalTokens int64
ReasoningTokens int64
CacheReadTokens int64
CacheWriteTokens int64
CacheWriteLongTTLTokens int64
WastedPromptTokens int64
WastedCompletionTokens int64
WastedTotalTokens int64
TotalAttempts int64
ResponseModelID string
FinishReason string
ResponseCostAmount string
RetryCostAmount string
BilledCostAmount string
CostKnown bool
FailureClassification string
FailureDetail string
StartedAt time.Time
CompletedAt *time.Time
}
ModelCall records one outbound provider round within a logical ModelRun.
type ModelCallState ¶ added in v0.4.0
type ModelCallState string
ModelCallState is the durable lifecycle state of one provider round.
type ModelRun ¶ added in v0.4.0
type ModelRun struct {
ID uuid.UUID
SessionID uuid.UUID
TurnID uuid.UUID
AgentRunID *uuid.UUID
Stage ModelRunStage
ModelReference string
ConnectionName string
RequestedModelID string
ResponseModelID string
RequestSettingsJSON string
State ModelRunState
ResponseText string
ResponseThinking string
ResponseMessagesJSON string
ResponseInjectionsJSON string
ResponseUsageJSON string
ResponseCostAmount string
RetryCostAmount string
BilledCostAmount string
CostKnown bool
FinishReason string
FailureClassification string
FailureDetail string
StartedAt time.Time
CompletedAt *time.Time
}
ModelRun records one logical Elelem Run invocation. It keeps the complete non-secret input and output audit record while ModelCall splits its provider rounds into separately replayable rows.
type ModelRunStage ¶ added in v0.4.0
type ModelRunStage string
ModelRunStage identifies the Peen operation that issued model work.
type ModelRunState ¶ added in v0.4.0
type ModelRunState string
ModelRunState is the durable lifecycle state of one logical model run.
type NoticeDelivery ¶ added in v0.4.0
type NoticeDelivery string
NoticeDelivery identifies whether an outside notice can wake a session.
type NoticeState ¶ added in v0.4.0
type NoticeState string
NoticeState records whether a notice has reached the model context.
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.
type SessionNotice ¶ added in v0.4.0
type SessionNotice struct {
ID uuid.UUID
SessionID uuid.UUID
Sequence int64
Type string
Source string
Summary string
DataJSON string
Delivery NoticeDelivery
State NoticeState
CreatedAt time.Time
DeliveredAt *time.Time
}
SessionNotice is a durable report waiting for or already delivered to a session.
func (SessionNotice) TableName ¶ added in v0.4.0
func (SessionNotice) TableName() string
TableName pins the schema-owned session_notices 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.