Documentation
¶
Index ¶
- Constants
- Variables
- type AppendStepEventInput
- type AppendTraceEventInput
- type ClosePrincipalInput
- type Conversation
- type ConversationAnchors
- type ConversationStatus
- type ConversationTitle
- type CreateConversation
- type CreateRunInput
- type DeleteConversationInput
- type DeleteConversationResult
- type DeleteTrigger
- type EnsurePrincipalInput
- type Entry
- type EntryKind
- type InterruptKind
- type InterruptResponse
- type InterruptStatus
- type ListConversationsFilter
- type OpenTerminalSessionInput
- type OpenTerminalSessionRawInput
- type PendingInterrupt
- type PrincipalStatus
- type ProjectConversationPrincipal
- type ProjectConversationRun
- type ProjectConversationStepEvent
- type ProjectConversationTraceEvent
- type RecordRunUsageInput
- type RetentionCleanupResult
- type RetentionCleanupSkip
- type RetentionCleanupSkipReason
- type RunStatus
- type RunUsageSnapshot
- type RuntimeState
- type Source
- type TerminalMode
- type Turn
- type TurnStatus
- type UpdatePrincipalRuntimeInput
- type UpdateProviderRateLimitInput
- type UpdateRunInput
Constants ¶
View Source
const ( DefaultTerminalCols = 120 DefaultTerminalRows = 30 MaxTerminalSize = 65535 )
View Source
const CostRecordedEventType string = "project_conversation.cost_recorded"
View Source
const MaxConversationTitleRunes = 120
Variables ¶
View Source
var ( ErrNotFound = errors.New("chat conversation resource not found") ErrConflict = errors.New("chat conversation resource conflict") ErrInvalidInput = errors.New("chat conversation invalid input") ErrTurnAlreadyActive = fmt.Errorf( "%w: project conversation already has an active turn", ErrConflict, ) ErrInterruptPending = fmt.Errorf( "%w: project conversation has a pending interrupt", ErrConflict, ) ErrWorkspaceDirty = fmt.Errorf( "%w: project conversation workspace has uncommitted changes", ErrConflict, ) ErrWorkspaceDeleteFailed = fmt.Errorf( "%w: project conversation workspace deletion failed", ErrConflict, ) ErrWorkspacePathConflict = fmt.Errorf( "%w: project conversation workspace path is unsafe", ErrConflict, ) )
Functions ¶
This section is empty.
Types ¶
type AppendStepEventInput ¶
type AppendTraceEventInput ¶
type ClosePrincipalInput ¶
type Conversation ¶
type Conversation struct {
ID uuid.UUID
ProjectID uuid.UUID
UserID string
Source Source
ProviderID uuid.UUID
Status ConversationStatus
Title ConversationTitle
ProviderThreadID *string
LastTurnID *string
ProviderThreadStatus *string
ProviderThreadActiveFlags []string
RollingSummary string
LastActivityAt time.Time
CreatedAt time.Time
UpdatedAt time.Time
}
type ConversationAnchors ¶
type ConversationStatus ¶
type ConversationStatus string
const ( ConversationStatusActive ConversationStatus = "active" ConversationStatusInterrupted ConversationStatus = "interrupted" ConversationStatusClosed ConversationStatus = "closed" )
type ConversationTitle ¶ added in v0.3.0
type ConversationTitle string
func ParseConversationTitleFromFirstUserMessage ¶ added in v0.3.0
func ParseConversationTitleFromFirstUserMessage(raw string) (ConversationTitle, error)
func (ConversationTitle) String ¶ added in v0.3.0
func (t ConversationTitle) String() string
type CreateConversation ¶
type CreateRunInput ¶
type CreateRunInput struct {
RunID uuid.UUID
PrincipalID uuid.UUID
ConversationID uuid.UUID
ProjectID uuid.UUID
ProviderID uuid.UUID
TurnID *uuid.UUID
Status RunStatus
SessionID *string
WorkspacePath *string
ProviderThreadID *string
ProviderTurnID *string
RuntimeStartedAt *time.Time
LastHeartbeatAt *time.Time
CurrentStepStatus *string
CurrentStepSummary *string
CurrentStepChangedAt *time.Time
}
type DeleteConversationInput ¶ added in v0.4.0
type DeleteConversationInput struct {
Force bool
Trigger DeleteTrigger
}
type DeleteConversationResult ¶ added in v0.4.0
type DeleteConversationResult struct {
ConversationID uuid.UUID
ProjectID uuid.UUID
UserID string
Trigger DeleteTrigger
WorkspacePath string
WorkspaceDeleted bool
WorkspaceDirty bool
EntriesDeleted int
TurnsDeleted int
InterruptsDeleted int
RunsDeleted int
TraceEventsDeleted int
StepEventsDeleted int
AgentTokensDeleted int
DeletedAt time.Time
}
type DeleteTrigger ¶ added in v0.4.0
type DeleteTrigger string
const ( DeleteTriggerManual DeleteTrigger = "manual" DeleteTriggerRetention DeleteTrigger = "retention" )
type EnsurePrincipalInput ¶
type InterruptKind ¶
type InterruptKind string
const ( InterruptKindCommandExecutionApproval InterruptKind = "command_execution_approval" InterruptKindFileChangeApproval InterruptKind = "file_change_approval" InterruptKindUserInput InterruptKind = "user_input" )
type InterruptResponse ¶
type InterruptStatus ¶
type InterruptStatus string
const ( InterruptStatusPending InterruptStatus = "pending" InterruptStatusResolved InterruptStatus = "resolved" )
type ListConversationsFilter ¶
type OpenTerminalSessionInput ¶ added in v0.4.0
type OpenTerminalSessionInput struct {
Mode TerminalMode
RepoPath *string
CWDPath *string
Cols int
Rows int
}
func ParseOpenTerminalSessionInput ¶ added in v0.4.0
func ParseOpenTerminalSessionInput(raw OpenTerminalSessionRawInput) (OpenTerminalSessionInput, error)
type OpenTerminalSessionRawInput ¶ added in v0.4.0
type PendingInterrupt ¶
type PrincipalStatus ¶
type PrincipalStatus string
const ( PrincipalStatusActive PrincipalStatus = "active" PrincipalStatusClosed PrincipalStatus = "closed" )
type ProjectConversationPrincipal ¶
type ProjectConversationPrincipal struct {
ID uuid.UUID
ConversationID uuid.UUID
ProjectID uuid.UUID
ProviderID uuid.UUID
Name string
Status PrincipalStatus
RuntimeState RuntimeState
CurrentSessionID *string
CurrentWorkspacePath *string
CurrentRunID *uuid.UUID
LastHeartbeatAt *time.Time
CurrentStepStatus *string
CurrentStepSummary *string
CurrentStepChangedAt *time.Time
ClosedAt *time.Time
CreatedAt time.Time
UpdatedAt time.Time
}
type ProjectConversationRun ¶
type ProjectConversationRun struct {
ID uuid.UUID
PrincipalID uuid.UUID
ConversationID uuid.UUID
ProjectID uuid.UUID
ProviderID uuid.UUID
TurnID *uuid.UUID
Status RunStatus
SessionID *string
WorkspacePath *string
ProviderThreadID *string
ProviderTurnID *string
RuntimeStartedAt *time.Time
TerminalAt *time.Time
LastError *string
LastHeartbeatAt *time.Time
CostAmount float64
InputTokens int64
OutputTokens int64
CachedInputTokens int64
CacheCreationTokens int64
ReasoningTokens int64
PromptTokens int64
CandidateTokens int64
ToolTokens int64
TotalTokens int64
CurrentStepStatus *string
CurrentStepSummary *string
CurrentStepChangedAt *time.Time
CreatedAt time.Time
}
type RecordRunUsageInput ¶
type RecordRunUsageInput struct {
RunID uuid.UUID
ProjectID uuid.UUID
ProviderID uuid.UUID
RecordedAt time.Time
Totals RunUsageSnapshot
Delta RunUsageSnapshot
}
type RetentionCleanupResult ¶ added in v0.4.0
type RetentionCleanupResult struct {
ProjectID uuid.UUID
Scanned int
Deleted []DeleteConversationResult
Skipped []RetentionCleanupSkip
RanAt time.Time
}
type RetentionCleanupSkip ¶ added in v0.4.0
type RetentionCleanupSkipReason ¶ added in v0.4.0
type RetentionCleanupSkipReason string
const ( RetentionCleanupSkipLatestWindow RetentionCleanupSkipReason = "latest_window" RetentionCleanupSkipRecentActivity RetentionCleanupSkipReason = "recent_activity" RetentionCleanupSkipRuntimeActive RetentionCleanupSkipReason = "runtime_active" RetentionCleanupSkipPendingInput RetentionCleanupSkipReason = "pending_interrupt" RetentionCleanupSkipDirtyWorkspace RetentionCleanupSkipReason = "dirty_workspace" )
type RunUsageSnapshot ¶
type RuntimeState ¶
type RuntimeState string
const ( RuntimeStateInactive RuntimeState = "inactive" RuntimeStateReady RuntimeState = "ready" RuntimeStateExecuting RuntimeState = "executing" RuntimeStateInterrupted RuntimeState = "interrupted" )
type Source ¶
type Source string
const (
SourceProjectSidebar Source = "project_sidebar"
)
func ParseSource ¶
type TerminalMode ¶ added in v0.4.0
type TerminalMode string
const (
TerminalModeShell TerminalMode = "shell"
)
func ParseTerminalMode ¶ added in v0.4.0
func ParseTerminalMode(raw string) (TerminalMode, error)
type TurnStatus ¶
type TurnStatus string
const ( TurnStatusPending TurnStatus = "pending" TurnStatusRunning TurnStatus = "running" TurnStatusInterrupted TurnStatus = "interrupted" TurnStatusCompleted TurnStatus = "completed" TurnStatusFailed TurnStatus = "failed" TurnStatusTerminated TurnStatus = "terminated" )
type UpdateRunInput ¶
Click to show internal directories.
Click to hide internal directories.