Documentation
¶
Index ¶
- Constants
- Variables
- func CurrentSchemaVersion() int
- func EncodeCursor(c ThreadsCursor) string
- type AutoThreadTitleCandidate
- type ChildPermissionSnapshotRecord
- type CommitForkOperationRequest
- type ConversationTurn
- type DelegatedApprovalDecisionRequest
- type DelegatedApprovalDecisionResult
- type DelegatedApprovalRecord
- type ExecutionSpanRecord
- type FlowerActivitySnapshot
- type FlowerHandoffRecord
- type FlowerThreadMetadata
- type FlowerTransferRecord
- type FollowupDeleteResourcesResult
- type ForkOperation
- type ForkOperationStatus
- type ForkThreadRequest
- type ForkTurnRef
- type MemoryItemRecord
- type Message
- type PermissionSnapshotRecord
- type ProviderCapabilityRecord
- type ProviderContinuationState
- type QueuedThread
- type QueuedTurn
- type RequestUserInputSecretAnswerRecord
- type RunEventRecord
- type RunEventsQuery
- type RunRecord
- type SQLiteCompactionPlan
- type SQLitePageStats
- type StartUserTurn
- type StartUserTurnResult
- type Store
- func (s *Store) AppendConversationTurn(ctx context.Context, rec ConversationTurn) (int64, error)
- func (s *Store) AppendMessage(ctx context.Context, endpointID string, threadID string, m Message, ...) (int64, error)
- func (s *Store) AppendMessageWithUploadRefs(ctx context.Context, endpointID string, threadID string, m Message, ...) (int64, error)
- func (s *Store) AppendRunEvent(ctx context.Context, rec RunEventRecord) error
- func (s *Store) BindUploadsToRef(ctx context.Context, endpointID string, threadID string, refKind string, ...) error
- func (s *Store) ClearThreadProviderContinuation(ctx context.Context, endpointID string, threadID string) error
- func (s *Store) ClearThreadState(ctx context.Context, endpointID string, threadID string) error
- func (s *Store) Close() error
- func (s *Store) CommitForkOperation(ctx context.Context, req CommitForkOperationRequest) (*Thread, error)
- func (s *Store) ConfirmThreadDeleteFilesCleaned(ctx context.Context, operationID string) (ThreadDeleteOperation, error)
- func (s *Store) ConfirmThreadDeleteFloretDeleted(ctx context.Context, operationID string) (ThreadDeleteOperation, error)
- func (s *Store) ConfirmThreadDeleteReadStateDeleted(ctx context.Context, operationID string) (ThreadDeleteOperation, error)
- func (s *Store) CountFollowupsByLane(ctx context.Context, endpointID string, threadID string, lane string) (int, error)
- func (s *Store) CountFollowupsByThreadAndLane(ctx context.Context, endpointID string, threadIDs []string, lane string) (map[string]int, error)
- func (s *Store) CountQueuedTurns(ctx context.Context, endpointID string, threadID string) (int, error)
- func (s *Store) CountQueuedTurnsByThread(ctx context.Context, endpointID string, threadIDs []string) (map[string]int, error)
- func (s *Store) CreateFollowup(ctx context.Context, rec QueuedTurn) (QueuedTurn, int, int64, error)
- func (s *Store) CreateFollowupWithUploadRefs(ctx context.Context, rec QueuedTurn, uploadIDs []string, claimedAtUnixMs int64) (QueuedTurn, int, int64, error)
- func (s *Store) CreateThread(ctx context.Context, t Thread) error
- func (s *Store) CreateThreadCheckpoint(ctx context.Context, endpointID string, threadID string, checkpointID string, ...) (ThreadCheckpointRecord, error)
- func (s *Store) CurrentThreadContextBoundary(ctx context.Context, endpointID string, threadID string) (ThreadContextBoundary, error)
- func (s *Store) DeleteFollowup(ctx context.Context, endpointID string, threadID string, followupID string) (int64, error)
- func (s *Store) DeleteFollowupResources(ctx context.Context, endpointID string, threadID string, followupID string) (FollowupDeleteResourcesResult, error)
- func (s *Store) DeleteQueuedTurn(ctx context.Context, endpointID string, threadID string, queueID string) error
- func (s *Store) DeleteQueuedTurns(ctx context.Context, endpointID string, threadID string) error
- func (s *Store) DeleteThread(ctx context.Context, endpointID string, threadID string) error
- func (s *Store) DeleteThreadContextData(ctx context.Context, endpointID string, threadID string) error
- func (s *Store) DeleteThreadMemoryItem(ctx context.Context, endpointID string, threadID string, memoryID string) error
- func (s *Store) DeleteThreadResources(ctx context.Context, endpointID string, threadID string) (ThreadDeleteResourcesResult, error)
- func (s *Store) EnqueueQueuedTurn(ctx context.Context, rec QueuedTurn) (QueuedTurn, int, error)
- func (s *Store) EnsureUpload(ctx context.Context, rec UploadRecord) error
- func (s *Store) FinalizeChildPermissionSnapshot(ctx context.Context, endpointID string, childSnapshotID string, ...) (bool, error)
- func (s *Store) FinalizeDeletedUploads(ctx context.Context, uploadIDs []string) (int64, error)
- func (s *Store) GetChildPermissionSnapshotBySpawnToolCall(ctx context.Context, endpointID string, spawnToolCallID string) (ChildPermissionSnapshotRecord, bool, error)
- func (s *Store) GetDelegatedApprovalRequest(ctx context.Context, endpointID string, parentThreadID string, actionID string) (DelegatedApprovalRecord, bool, error)
- func (s *Store) GetFinalizedChildPermissionSnapshot(ctx context.Context, endpointID string, childThreadID string, ...) (ChildPermissionSnapshotRecord, bool, error)
- func (s *Store) GetFinalizedChildPermissionSnapshotByThread(ctx context.Context, endpointID string, childThreadID string) (ChildPermissionSnapshotRecord, bool, error)
- func (s *Store) GetFirstUserThreadMessage(ctx context.Context, endpointID string, threadID string) (*Message, error)
- func (s *Store) GetFlowerHandoffByIdempotencyKey(ctx context.Context, endpointID string, idempotencyKey string) (*FlowerHandoffRecord, error)
- func (s *Store) GetFlowerThreadMetadata(ctx context.Context, endpointID string, threadID string) (*FlowerThreadMetadata, error)
- func (s *Store) GetFlowerTransferByIdempotencyKey(ctx context.Context, endpointID string, idempotencyKey string) (*FlowerTransferRecord, error)
- func (s *Store) GetForkOperation(ctx context.Context, operationID string) (*ForkOperation, error)
- func (s *Store) GetLatestThreadCheckpoint(ctx context.Context, endpointID string, threadID string) (*ThreadCheckpointRecord, error)
- func (s *Store) GetPermissionSnapshot(ctx context.Context, endpointID string, snapshotID string) (PermissionSnapshotRecord, bool, error)
- func (s *Store) GetProviderCapability(ctx context.Context, providerID string, modelName string) (*ProviderCapabilityRecord, error)
- func (s *Store) GetQueuedTurn(ctx context.Context, endpointID string, threadID string, queueID string) (*QueuedTurn, error)
- func (s *Store) GetRun(ctx context.Context, endpointID string, runID string) (*RunRecord, error)
- func (s *Store) GetThread(ctx context.Context, endpointID string, threadID string) (*Thread, error)
- func (s *Store) GetThreadCheckpoint(ctx context.Context, endpointID string, threadID string, checkpointID string) (*ThreadCheckpointRecord, error)
- func (s *Store) GetThreadDeleteOperation(ctx context.Context, endpointID string, threadID string) (*ThreadDeleteOperation, error)
- func (s *Store) GetThreadFollowupsRevision(ctx context.Context, endpointID string, threadID string) (int64, error)
- func (s *Store) GetThreadOpenGoal(ctx context.Context, endpointID string, threadID string) (string, error)
- func (s *Store) GetThreadProviderContinuation(ctx context.Context, endpointID string, threadID string) (*ThreadProviderContinuation, error)
- func (s *Store) GetThreadState(ctx context.Context, endpointID string, threadID string) (*ThreadState, error)
- func (s *Store) GetThreadTodosSnapshot(ctx context.Context, endpointID string, threadID string) (ThreadTodosSnapshot, error)
- func (s *Store) GetToolCall(ctx context.Context, endpointID string, runID string, toolID string) (*ToolCallRecord, error)
- func (s *Store) GetTranscriptMessage(ctx context.Context, endpointID string, threadID string, messageID string) (*Message, error)
- func (s *Store) GetTranscriptMessageRowIDAndJSONByMessageID(ctx context.Context, endpointID string, threadID string, messageID string) (int64, string, error)
- func (s *Store) GetUpload(ctx context.Context, endpointID string, uploadID string) (*UploadRecord, error)
- func (s *Store) InsertChildPermissionSnapshot(ctx context.Context, rec ChildPermissionSnapshotRecord) error
- func (s *Store) InsertChildPermissionSnapshotProvisional(ctx context.Context, rec ChildPermissionSnapshotRecord) error
- func (s *Store) InsertFlowerHandoff(ctx context.Context, rec FlowerHandoffRecord) (FlowerHandoffRecord, error)
- func (s *Store) InsertFlowerTransfer(ctx context.Context, rec FlowerTransferRecord) (FlowerTransferRecord, error)
- func (s *Store) InsertPermissionSnapshot(ctx context.Context, rec PermissionSnapshotRecord) error
- func (s *Store) InsertUpload(ctx context.Context, rec UploadRecord) error
- func (s *Store) ListAutoThreadTitleCandidates(ctx context.Context, limit int) ([]AutoThreadTitleCandidate, error)
- func (s *Store) ListCheckpointIDs(ctx context.Context) ([]string, error)
- func (s *Store) ListConversationTurns(ctx context.Context, endpointID string, threadID string, limit int) ([]ConversationTurn, error)
- func (s *Store) ListConversationTurnsBefore(ctx context.Context, endpointID string, threadID string, limit int, ...) ([]ConversationTurn, int64, bool, error)
- func (s *Store) ListDelegatedApprovalRequestsForThread(ctx context.Context, endpointID string, parentThreadID string, limit int) ([]DelegatedApprovalRecord, error)
- func (s *Store) ListExecutionSpansByRun(ctx context.Context, endpointID string, runID string, limit int) ([]ExecutionSpanRecord, error)
- func (s *Store) ListFlowerThreadMetadataByParent(ctx context.Context, endpointID string, parentThreadID string) ([]FlowerThreadMetadata, error)
- func (s *Store) ListFollowupsByLane(ctx context.Context, endpointID string, threadID string, lane string, ...) ([]QueuedTurn, error)
- func (s *Store) ListHistoryLite(ctx context.Context, endpointID string, threadID string, limit int) ([]Message, error)
- func (s *Store) ListMemoryItemsByScopeKind(ctx context.Context, endpointID string, threadID string, scope string, ...) ([]MemoryItemRecord, error)
- func (s *Store) ListMessages(ctx context.Context, endpointID string, threadID string, limit int, ...) ([]Message, int64, bool, error)
- func (s *Store) ListMessagesAfter(ctx context.Context, endpointID string, threadID string, limit int, ...) ([]Message, int64, bool, error)
- func (s *Store) ListPendingForkOperations(ctx context.Context, limit int) ([]ForkOperation, error)
- func (s *Store) ListPendingThreadDeleteOperations(ctx context.Context, limit int) ([]ThreadDeleteOperation, error)
- func (s *Store) ListQueuedTurns(ctx context.Context, endpointID string, threadID string, limit int) ([]QueuedTurn, error)
- func (s *Store) ListRecentExecutionSpansByThread(ctx context.Context, endpointID string, threadID string, limit int) ([]ExecutionSpanRecord, error)
- func (s *Store) ListRecentMemoryItems(ctx context.Context, endpointID string, threadID string, limit int) ([]MemoryItemRecord, error)
- func (s *Store) ListRecentStructuredUserInputs(ctx context.Context, endpointID string, threadID string, limit int) ([]StructuredUserInputRecord, error)
- func (s *Store) ListRecentThreadToolCalls(ctx context.Context, endpointID string, threadID string, limit int) ([]ToolCallRecord, error)
- func (s *Store) ListRecentTranscriptMessages(ctx context.Context, endpointID string, threadID string, limit int) ([]Message, error)
- func (s *Store) ListRequestUserInputSecretAnswers(ctx context.Context, endpointID string, threadID string, ...) ([]RequestUserInputSecretAnswerRecord, error)
- func (s *Store) ListRunEvents(ctx context.Context, endpointID string, runID string, limit int) ([]RunEventRecord, error)
- func (s *Store) ListRunEventsPage(ctx context.Context, endpointID string, runID string, query RunEventsQuery) ([]RunEventRecord, int64, bool, error)
- func (s *Store) ListThreadCheckpointIDs(ctx context.Context, endpointID string, threadID string) ([]string, error)
- func (s *Store) ListThreadContextRunEvents(ctx context.Context, endpointID string, threadID string, limit int) ([]RunEventRecord, error)
- func (s *Store) ListThreads(ctx context.Context, endpointID string, limit int, cursor ThreadsCursor) ([]Thread, string, error)
- func (s *Store) ListThreadsWithQueuedTurns(ctx context.Context, limit int) ([]QueuedThread, error)
- func (s *Store) ListUnbroadcastCommittedForkOperations(ctx context.Context, limit int) ([]ForkOperation, error)
- func (s *Store) MarkDelegatedApprovalAckUnknown(ctx context.Context, endpointID string, parentThreadID string, actionID string, ...) (bool, error)
- func (s *Store) MarkDelegatedApprovalCanceled(ctx context.Context, endpointID string, parentThreadID string, actionID string, ...) (bool, error)
- func (s *Store) MarkDelegatedApprovalDelivered(ctx context.Context, endpointID string, parentThreadID string, actionID string, ...) (bool, error)
- func (s *Store) MarkDelegatedApprovalUnavailable(ctx context.Context, endpointID string, parentThreadID string, actionID string, ...) (bool, error)
- func (s *Store) MarkForkOperationBroadcasted(ctx context.Context, operationID string, source bool, atUnixMs int64) error
- func (s *Store) MarkPendingDelegatedApprovalsUnavailable(ctx context.Context, reason string, nowUnixMs int64) (int64, error)
- func (s *Store) MarkThreadDeleteFailed(ctx context.Context, operationID string, errorCode string, errorMessage string) (ThreadDeleteOperation, error)
- func (s *Store) MaybeCompact(ctx context.Context) (SQLiteCompactionPlan, error)
- func (s *Store) PopNextQueuedTurn(ctx context.Context, endpointID string, threadID string) (*QueuedTurn, error)
- func (s *Store) PrepareExpiredUploadsForDeletion(ctx context.Context, nowUnixMs int64, limit int) ([]UploadRecord, error)
- func (s *Store) PrepareForkOperation(ctx context.Context, req ForkThreadRequest) (*ForkOperation, error)
- func (s *Store) PrepareThreadDeleteOperation(ctx context.Context, endpointID string, threadID string, ...) (ThreadDeleteOperation, error)
- func (s *Store) PruneThreadCheckpoints(ctx context.Context, endpointID string, threadID string, keep int) ([]string, error)
- func (s *Store) RecordForkOperationFailure(ctx context.Context, operationID string, code string, message string, ...) error
- func (s *Store) RecordThreadDeleteRetry(ctx context.Context, operationID string, errorCode string, errorMessage string) (ThreadDeleteOperation, error)
- func (s *Store) RecoverQueuedTurnsToDrafts(ctx context.Context, endpointID string, threadID string) ([]QueuedTurn, int64, error)
- func (s *Store) RenameThread(ctx context.Context, endpointID string, threadID string, title string, ...) error
- func (s *Store) ReorderFollowups(ctx context.Context, endpointID string, threadID string, lane string, ...) (int64, error)
- func (s *Store) ReplaceRequestUserInputSecretAnswers(ctx context.Context, endpointID string, threadID string, ...) error
- func (s *Store) ReplaceStructuredUserInputs(ctx context.Context, endpointID string, threadID string, ...) error
- func (s *Store) ReplaceThreadTodosSnapshot(ctx context.Context, rec ThreadTodosSnapshot, expectedVersion *int64) (ThreadTodosSnapshot, error)
- func (s *Store) RescheduleUploadDeletion(ctx context.Context, uploadIDs []string, retryAtUnixMs int64) error
- func (s *Store) ResetStaleActiveThreadRunStates(ctx context.Context) (int64, error)
- func (s *Store) SQLitePageStats(ctx context.Context) (SQLitePageStats, error)
- func (s *Store) SetAutoThreadTitle(ctx context.Context, endpointID string, threadID string, title string, ...) (bool, error)
- func (s *Store) SetThreadCheckpointWorkspaceJSON(ctx context.Context, endpointID string, threadID string, checkpointID string, ...) error
- func (s *Store) SetThreadOpenGoal(ctx context.Context, endpointID string, threadID string, goal string) error
- func (s *Store) SetThreadPinned(ctx context.Context, endpointID string, threadID string, pinned bool, ...) (int64, error)
- func (s *Store) SetThreadProviderContinuation(ctx context.Context, endpointID string, threadID string, ...) error
- func (s *Store) SetThreadProviderContinuationIfBoundaryMatches(ctx context.Context, endpointID string, threadID string, ...) error
- func (s *Store) StartUserTurn(ctx context.Context, rec StartUserTurn) (StartUserTurnResult, error)
- func (s *Store) SubmitDelegatedApprovalDecisionCAS(ctx context.Context, req DelegatedApprovalDecisionRequest) (DelegatedApprovalDecisionResult, error)
- func (s *Store) UpdateFollowupText(ctx context.Context, endpointID string, threadID string, followupID string, ...) (int64, error)
- func (s *Store) UpdatePendingDelegatedApprovalPresentation(ctx context.Context, rec DelegatedApprovalRecord) (bool, error)
- func (s *Store) UpdateQueuedTurn(ctx context.Context, endpointID string, threadID string, queueID string, ...) error
- func (s *Store) UpdateThreadLastMessagePreview(ctx context.Context, endpointID string, threadID string, preview string, ...) error
- func (s *Store) UpdateThreadModelAndReasoningSelection(ctx context.Context, endpointID string, threadID string, modelID string, ...) error
- func (s *Store) UpdateThreadModelID(ctx context.Context, endpointID string, threadID string, modelID string) error
- func (s *Store) UpdateThreadPermissionType(ctx context.Context, endpointID string, threadID string, permissionType string) error
- func (s *Store) UpdateThreadReasoningSelection(ctx context.Context, endpointID string, threadID string, ...) error
- func (s *Store) UpdateThreadRunState(ctx context.Context, endpointID string, threadID string, runStatus string, ...) error
- func (s *Store) UpdateTranscriptMessageJSONByRowID(ctx context.Context, endpointID string, rowID int64, messageJSON string, ...) error
- func (s *Store) UpsertDelegatedApprovalRequest(ctx context.Context, rec DelegatedApprovalRecord) error
- func (s *Store) UpsertExecutionSpan(ctx context.Context, rec ExecutionSpanRecord) error
- func (s *Store) UpsertFlowerThreadMetadata(ctx context.Context, rec FlowerThreadMetadata) error
- func (s *Store) UpsertMemoryItem(ctx context.Context, rec MemoryItemRecord) error
- func (s *Store) UpsertProjectedMessage(ctx context.Context, endpointID string, threadID string, m Message, ...) (int64, error)
- func (s *Store) UpsertProjectedThread(ctx context.Context, t Thread) error
- func (s *Store) UpsertProjectedThreadWithFlowerMetadata(ctx context.Context, t Thread, meta FlowerThreadMetadata) error
- func (s *Store) UpsertProviderCapability(ctx context.Context, rec ProviderCapabilityRecord) error
- func (s *Store) UpsertRun(ctx context.Context, rec RunRecord) error
- func (s *Store) UpsertThreadState(ctx context.Context, st ThreadState) error
- func (s *Store) UpsertToolCall(ctx context.Context, rec ToolCallRecord) error
- type StructuredUserInputRecord
- type Thread
- type ThreadCheckpointRecord
- type ThreadContextBoundary
- type ThreadDeleteOperation
- type ThreadDeleteResourcesResult
- type ThreadDeleteSnapshotV1
- type ThreadProviderContinuation
- type ThreadRunStateWrite
- type ThreadState
- type ThreadTodosSnapshot
- type ThreadsCursor
- type ToolCallRecord
- type UploadRecord
- type UploadRefRecord
Constants ¶
const ( FollowupLaneQueued = "queued" FollowupLaneDraft = "draft" )
const ( ThreadTitleSourceAuto = "auto" ThreadTitleSourceUser = "user" )
const ( RuntimeRestartedRunErrorCode = "runtime_restarted" RuntimeRestartedRunErrorMessage = "The local runtime restarted before this reply finished." )
const ( ThreadDeleteSnapshotSchemaV1 = 1 ThreadDeleteOperationPending = "pending" ThreadDeleteOperationCommitted = "committed" ThreadDeleteOperationFailed = "failed" )
const ( UploadStateStaged = "staged" UploadStateLive = "live" UploadStateDeleting = "deleting" UploadRefKindMessage = "message" UploadRefKindQueuedTurn = "queued_turn" )
const (
CheckpointKindPreRun = "pre_run"
)
const ForkSnapshotSchemaVersion = 1
Variables ¶
var ( ErrForkOperationConflict = errors.New("thread fork operation conflicts with existing request") ErrForkDestinationConflict = errors.New("thread fork destination conflicts with existing operation") ErrForkOperationFailed = errors.New("thread fork operation is failed") ErrForkResultConflict = errors.New("thread fork result conflicts with source snapshot") )
var ErrDuplicateUserTurnMessage = errors.New("duplicate user turn message")
var ErrFlowerIdempotencyCollision = errors.New("flower idempotency collision")
var ErrFollowupsRevisionChanged = errors.New("followups revision changed")
var ErrInvalidFollowupOrder = errors.New("invalid followup order")
var ErrThreadContextBoundaryChanged = errors.New("thread context boundary changed")
var ErrThreadIDRetired = errors.New("thread id retired")
var ErrThreadTodosVersionConflict = errors.New("thread todos version conflict")
Functions ¶
func CurrentSchemaVersion ¶
func CurrentSchemaVersion() int
CurrentSchemaVersion returns the latest threadstore schema version expected by migrations.
func EncodeCursor ¶
func EncodeCursor(c ThreadsCursor) string
EncodeCursor encodes a cursor as a URL-safe base64 string.
Types ¶
type ChildPermissionSnapshotRecord ¶ added in v0.7.2
type ChildPermissionSnapshotRecord struct {
ChildSnapshotID string
EndpointID string
ParentSnapshotID string
SpawnToolCallID string
ParentThreadID string
ParentRunID string
SubagentID string
ChildThreadID string
ChildRunID string
State string
SnapshotJSON string
SnapshotHash string
RegistryHash string
SchemaHash string
PresentationHash string
CreatedAtUnixMs int64
FinalizedAtUnixMs int64
}
type CommitForkOperationRequest ¶ added in v0.9.0
type CommitForkOperationRequest struct {
OperationID string
FloretTurnRefs []ForkTurnRef
FloretResultJSON string
UpdatedAtUnixMs int64
}
type ConversationTurn ¶
type ConversationTurn struct {
ID int64 `json:"id"`
TurnID string `json:"turn_id"`
EndpointID string `json:"endpoint_id"`
ThreadID string `json:"thread_id"`
RunID string `json:"run_id"`
UserMessageID string `json:"user_message_id"`
AssistantMessageID string `json:"assistant_message_id"`
CreatedAtUnixMs int64 `json:"created_at_unix_ms"`
}
ConversationTurn records product-message and Floret turn correlation for one semantic turn. AssistantMessageID is a presentation/correlation id; Floret-backed turns must not require it to own a transcript row.
type DelegatedApprovalDecisionRequest ¶ added in v0.7.2
type DelegatedApprovalDecisionResult ¶ added in v0.7.2
type DelegatedApprovalDecisionResult struct {
Accepted bool
Replayed bool
Conflict bool
Record DelegatedApprovalRecord
}
type DelegatedApprovalRecord ¶ added in v0.7.2
type DelegatedApprovalRecord struct {
ActionID string
EndpointID string
ParentThreadID string
ParentUserPublicID string
ParentRunID string
ParentTurnID string
SubagentID string
ChildThreadID string
ChildRunID string
ChildTurnID string
ChildToolCallID string
ApprovalID string
RefHash string
RequestFingerprint string
State string
Status string
DeliveryState string
ChildExecutionState string
Version int64
SurfaceEpoch int64
RequestedAtUnixMs int64
ResolvedAtUnixMs int64
ExpiresAtUnixMs int64
ActionJSON string
CreatedAtUnixMs int64
UpdatedAtUnixMs int64
}
type ExecutionSpanRecord ¶
type ExecutionSpanRecord struct {
SpanID string `json:"span_id"`
EndpointID string `json:"endpoint_id"`
ThreadID string `json:"thread_id"`
RunID string `json:"run_id"`
Kind string `json:"kind"`
Name string `json:"name"`
Status string `json:"status"`
PayloadJSON string `json:"payload_json"`
StartedAtUnixMs int64 `json:"started_at_unix_ms"`
EndedAtUnixMs int64 `json:"ended_at_unix_ms"`
UpdatedAtUnixMs int64 `json:"updated_at_unix_ms"`
}
ExecutionSpanRecord captures structured execution evidence.
type FlowerActivitySnapshot ¶ added in v0.7.2
type FlowerHandoffRecord ¶ added in v0.7.1
type FlowerHandoffRecord struct {
HandoffID string `json:"handoff_id"`
EndpointID string `json:"endpoint_id"`
SourceThreadID string `json:"source_thread_id"`
DestinationThreadID string `json:"destination_thread_id"`
IdempotencyKey string `json:"idempotency_key"`
EnvelopeHash string `json:"envelope_hash"`
State string `json:"state"`
EnvelopeJSON string `json:"envelope_json"`
CreatedAtUnixMs int64 `json:"created_at_unix_ms"`
UpdatedAtUnixMs int64 `json:"updated_at_unix_ms"`
}
type FlowerThreadMetadata ¶ added in v0.7.1
type FlowerThreadMetadata struct {
EndpointID string `json:"endpoint_id"`
ThreadID string `json:"thread_id"`
OwnerKind string `json:"owner_kind"`
OwnerID string `json:"owner_id"`
ParentThreadID string `json:"parent_thread_id"`
ParentRunID string `json:"parent_run_id"`
ContextJSON string `json:"context_json"`
ActionJSON string `json:"action_json"`
UpdatedAtUnixMs int64 `json:"updated_at_unix_ms"`
HomeRuntimeID string `json:"home_runtime_id"`
HomeRuntimeKind string `json:"home_runtime_kind"`
OriginEnvPublicID string `json:"origin_env_public_id"`
PrimaryTargetID string `json:"primary_target_id"`
ActiveTargetIDsJSON string `json:"active_target_ids_json"`
}
type FlowerTransferRecord ¶ added in v0.7.1
type FlowerTransferRecord struct {
TransferID string `json:"transfer_id"`
EndpointID string `json:"endpoint_id"`
SourceThreadID string `json:"source_thread_id"`
DestinationThreadID string `json:"destination_thread_id"`
IdempotencyKey string `json:"idempotency_key"`
ManifestHash string `json:"manifest_hash"`
ApprovalHash string `json:"approval_hash"`
State string `json:"state"`
PlanJSON string `json:"plan_json"`
CreatedAtUnixMs int64 `json:"created_at_unix_ms"`
UpdatedAtUnixMs int64 `json:"updated_at_unix_ms"`
}
type FollowupDeleteResourcesResult ¶
type FollowupDeleteResourcesResult struct {
Revision int64
UploadsToDelete []UploadRecord
}
type ForkOperation ¶ added in v0.9.0
type ForkOperation struct {
OperationID string
EndpointID string
SourceThreadID string
DestinationThreadID string
RequestFingerprint string
Status ForkOperationStatus
SnapshotSchemaVersion int
SnapshotJSON string
FloretResultJSON string
RetryCount int
ErrorCode string
ErrorMessage string
SourceBroadcastedAtUnixMs int64
DestinationBroadcastedAtUnixMs int64
CreatedAtUnixMs int64
UpdatedAtUnixMs int64
}
type ForkOperationStatus ¶ added in v0.9.0
type ForkOperationStatus string
const ( ForkOperationPending ForkOperationStatus = "pending" ForkOperationCommitted ForkOperationStatus = "committed" ForkOperationFailed ForkOperationStatus = "failed" )
type ForkThreadRequest ¶ added in v0.7.1
type ForkTurnRef ¶ added in v0.7.2
type MemoryItemRecord ¶
type MemoryItemRecord struct {
MemoryID string `json:"memory_id"`
EndpointID string `json:"endpoint_id"`
ThreadID string `json:"thread_id"`
Scope string `json:"scope"`
Kind string `json:"kind"`
Content string `json:"content"`
SourceRefsJSON string `json:"source_refs_json"`
Importance float64 `json:"importance"`
Freshness float64 `json:"freshness"`
Confidence float64 `json:"confidence"`
CreatedAtUnixMs int64 `json:"created_at_unix_ms"`
UpdatedAtUnixMs int64 `json:"updated_at_unix_ms"`
}
MemoryItemRecord is the normalized semantic memory entry.
type Message ¶
type Message struct {
ID int64 `json:"id"`
ThreadID string `json:"thread_id"`
EndpointID string `json:"endpoint_id"`
MessageID string `json:"message_id"`
Role string `json:"role"`
AuthorUserPublicID string `json:"author_user_public_id"`
AuthorUserEmail string `json:"author_user_email"`
Status string `json:"status"`
CreatedAtUnixMs int64 `json:"created_at_unix_ms"`
UpdatedAtUnixMs int64 `json:"updated_at_unix_ms"`
TextContent string `json:"text_content"`
MessageJSON string `json:"message_json"`
}
type PermissionSnapshotRecord ¶ added in v0.7.2
type ProviderCapabilityRecord ¶
type ProviderCapabilityRecord struct {
ProviderID string `json:"provider_id"`
ModelName string `json:"model_name"`
CapabilityJSON string `json:"capability_json"`
UpdatedAtUnixMs int64 `json:"updated_at_unix_ms"`
}
ProviderCapabilityRecord caches capability json by provider/model.
type ProviderContinuationState ¶ added in v0.7.1
type ProviderContinuationState struct {
Kind string `json:"kind,omitempty"`
ID string `json:"id,omitempty"`
Attributes map[string]string `json:"attributes,omitempty"`
}
func (ProviderContinuationState) IsZero ¶ added in v0.7.1
func (s ProviderContinuationState) IsZero() bool
type QueuedThread ¶ added in v0.7.2
type QueuedThread struct {
EndpointID string `json:"endpoint_id"`
ThreadID string `json:"thread_id"`
RunStatus string `json:"run_status"`
RunErrorCode string `json:"run_error_code"`
RunError string `json:"run_error"`
WaitingUserInputJSON string `json:"waiting_user_input_json"`
NamespacePublicID string `json:"namespace_public_id"`
QueuedTurnCount int `json:"queued_turn_count"`
FirstQueuedAtUnixMs int64 `json:"first_queued_at_unix_ms"`
FirstQueuedSortIndex int64 `json:"first_queued_sort_index"`
FirstQueuedTurnID string `json:"first_queued_turn_id"`
}
type QueuedTurn ¶
type QueuedTurn struct {
QueueID string `json:"queue_id"`
ThreadID string `json:"thread_id"`
EndpointID string `json:"endpoint_id"`
ChannelID string `json:"channel_id"`
Lane string `json:"lane"`
MessageID string `json:"message_id"`
ModelID string `json:"model_id"`
TextContent string `json:"text_content"`
AttachmentsJSON string `json:"attachments_json"`
ContextActionJSON string `json:"context_action_json"`
OptionsJSON string `json:"options_json"`
SessionMetaJSON string `json:"session_meta_json"`
CreatedByUserPublicID string `json:"created_by_user_public_id"`
CreatedByUserEmail string `json:"created_by_user_email"`
SortIndex int64 `json:"sort_index"`
CreatedAtUnixMs int64 `json:"created_at_unix_ms"`
UpdatedAtUnixMs int64 `json:"updated_at_unix_ms"`
}
type RequestUserInputSecretAnswerRecord ¶
type RequestUserInputSecretAnswerRecord struct {
ID int64 `json:"id"`
EndpointID string `json:"endpoint_id"`
ThreadID string `json:"thread_id"`
ResponseMessageID string `json:"response_message_id"`
QuestionID string `json:"question_id"`
Text string `json:"text,omitempty"`
CreatedAtUnixMs int64 `json:"created_at_unix_ms"`
}
type RunEventRecord ¶
type RunEventRecord struct {
ID int64 `json:"id"`
EndpointID string `json:"endpoint_id"`
ThreadID string `json:"thread_id"`
RunID string `json:"run_id"`
StreamKind string `json:"stream_kind"`
EventType string `json:"event_type"`
PayloadJSON string `json:"payload_json"`
AtUnixMs int64 `json:"at_unix_ms"`
}
type RunEventsQuery ¶
type RunRecord ¶
type RunRecord struct {
RunID string `json:"run_id"`
EndpointID string `json:"endpoint_id"`
ThreadID string `json:"thread_id"`
MessageID string `json:"message_id"`
State string `json:"state"`
ErrorCode string `json:"error_code"`
ErrorMessage string `json:"error_message"`
AttemptCount int `json:"attempt_count"`
StartedAtUnixMs int64 `json:"started_at_unix_ms"`
EndedAtUnixMs int64 `json:"ended_at_unix_ms"`
UpdatedAtUnixMs int64 `json:"updated_at_unix_ms"`
}
type SQLiteCompactionPlan ¶
type SQLiteCompactionPlan struct {
ShouldCompact bool
UseIncremental bool
PageSize int64
PageCount int64
FreelistCount int64
FreeBytes int64
PagesToRelease int64
}
func BuildSQLiteCompactionPlan ¶
func BuildSQLiteCompactionPlan(stats SQLitePageStats) SQLiteCompactionPlan
type SQLitePageStats ¶
type StartUserTurn ¶ added in v0.7.2
type StartUserTurn struct {
EndpointID string
ThreadID string
UserMessage Message
UploadIDs []string
Run RunRecord
Turn ConversationTurn
RunState ThreadRunStateWrite
SourceQueueID string
RequireSourceQueue bool
StructuredUserInputs []StructuredUserInputRecord
RequestUserInputSecrets []RequestUserInputSecretAnswerRecord
UploadClaimedAtUnixMs int64
}
type StartUserTurnResult ¶ added in v0.7.2
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a local SQLite-backed persistence layer for AI threads and messages.
Notes: - Data is scoped by endpoint_id (env public id). It is intentionally shared within the same env for collaboration. - WAL is enabled to support concurrent reads while writing (multiple browser sessions).
func OpenResettingInvalidSchema ¶ added in v0.7.1
func (*Store) AppendConversationTurn ¶
func (*Store) AppendMessage ¶
func (s *Store) AppendMessage(ctx context.Context, endpointID string, threadID string, m Message, updatedByID string, updatedByEmail string) (int64, error)
AppendMessage inserts a message into the thread and updates thread metadata in the same transaction.
func (*Store) AppendMessageWithUploadRefs ¶
func (*Store) AppendRunEvent ¶
func (s *Store) AppendRunEvent(ctx context.Context, rec RunEventRecord) error
func (*Store) BindUploadsToRef ¶
func (*Store) ClearThreadProviderContinuation ¶
func (*Store) ClearThreadState ¶
func (*Store) CommitForkOperation ¶ added in v0.9.0
func (*Store) ConfirmThreadDeleteFilesCleaned ¶ added in v0.9.0
func (*Store) ConfirmThreadDeleteFloretDeleted ¶ added in v0.9.0
func (*Store) ConfirmThreadDeleteReadStateDeleted ¶ added in v0.9.0
func (*Store) CountFollowupsByLane ¶
func (*Store) CountFollowupsByThreadAndLane ¶
func (*Store) CountQueuedTurns ¶
func (*Store) CountQueuedTurnsByThread ¶
func (*Store) CreateFollowup ¶
func (s *Store) CreateFollowup(ctx context.Context, rec QueuedTurn) (QueuedTurn, int, int64, error)
func (*Store) CreateFollowupWithUploadRefs ¶
func (s *Store) CreateFollowupWithUploadRefs(ctx context.Context, rec QueuedTurn, uploadIDs []string, claimedAtUnixMs int64) (QueuedTurn, int, int64, error)
func (*Store) CreateThreadCheckpoint ¶
func (*Store) CurrentThreadContextBoundary ¶ added in v0.7.2
func (*Store) DeleteFollowup ¶
func (*Store) DeleteFollowupResources ¶
func (*Store) DeleteQueuedTurn ¶
func (*Store) DeleteQueuedTurns ¶
func (*Store) DeleteThread ¶
func (*Store) DeleteThreadContextData ¶
func (*Store) DeleteThreadMemoryItem ¶
func (*Store) DeleteThreadResources ¶
func (*Store) EnqueueQueuedTurn ¶
func (s *Store) EnqueueQueuedTurn(ctx context.Context, rec QueuedTurn) (QueuedTurn, int, error)
func (*Store) EnsureUpload ¶
func (s *Store) EnsureUpload(ctx context.Context, rec UploadRecord) error
func (*Store) FinalizeChildPermissionSnapshot ¶ added in v0.7.2
func (*Store) FinalizeDeletedUploads ¶
func (*Store) GetChildPermissionSnapshotBySpawnToolCall ¶ added in v0.7.2
func (*Store) GetDelegatedApprovalRequest ¶ added in v0.7.2
func (*Store) GetFinalizedChildPermissionSnapshot ¶ added in v0.7.2
func (*Store) GetFinalizedChildPermissionSnapshotByThread ¶ added in v0.7.2
func (*Store) GetFirstUserThreadMessage ¶
func (*Store) GetFlowerHandoffByIdempotencyKey ¶ added in v0.7.1
func (*Store) GetFlowerThreadMetadata ¶ added in v0.7.1
func (*Store) GetFlowerTransferByIdempotencyKey ¶ added in v0.7.1
func (*Store) GetForkOperation ¶ added in v0.9.0
func (*Store) GetLatestThreadCheckpoint ¶
func (*Store) GetPermissionSnapshot ¶ added in v0.7.2
func (*Store) GetProviderCapability ¶
func (*Store) GetQueuedTurn ¶
func (*Store) GetThreadCheckpoint ¶
func (*Store) GetThreadDeleteOperation ¶ added in v0.9.0
func (*Store) GetThreadFollowupsRevision ¶
func (*Store) GetThreadOpenGoal ¶
func (*Store) GetThreadProviderContinuation ¶
func (*Store) GetThreadState ¶
func (*Store) GetThreadTodosSnapshot ¶
func (*Store) GetToolCall ¶
func (*Store) GetTranscriptMessage ¶
func (*Store) GetTranscriptMessageRowIDAndJSONByMessageID ¶
func (s *Store) GetTranscriptMessageRowIDAndJSONByMessageID(ctx context.Context, endpointID string, threadID string, messageID string) (int64, string, error)
GetTranscriptMessageRowIDAndJSONByMessageID returns (row_id, message_json) for a transcript message.
func (*Store) InsertChildPermissionSnapshot ¶ added in v0.7.2
func (s *Store) InsertChildPermissionSnapshot(ctx context.Context, rec ChildPermissionSnapshotRecord) error
func (*Store) InsertChildPermissionSnapshotProvisional ¶ added in v0.7.2
func (s *Store) InsertChildPermissionSnapshotProvisional(ctx context.Context, rec ChildPermissionSnapshotRecord) error
func (*Store) InsertFlowerHandoff ¶ added in v0.7.1
func (s *Store) InsertFlowerHandoff(ctx context.Context, rec FlowerHandoffRecord) (FlowerHandoffRecord, error)
func (*Store) InsertFlowerTransfer ¶ added in v0.7.1
func (s *Store) InsertFlowerTransfer(ctx context.Context, rec FlowerTransferRecord) (FlowerTransferRecord, error)
func (*Store) InsertPermissionSnapshot ¶ added in v0.7.2
func (s *Store) InsertPermissionSnapshot(ctx context.Context, rec PermissionSnapshotRecord) error
func (*Store) InsertUpload ¶
func (s *Store) InsertUpload(ctx context.Context, rec UploadRecord) error
func (*Store) ListAutoThreadTitleCandidates ¶
func (*Store) ListCheckpointIDs ¶
func (*Store) ListConversationTurns ¶
func (*Store) ListConversationTurnsBefore ¶ added in v0.7.2
func (*Store) ListDelegatedApprovalRequestsForThread ¶ added in v0.7.2
func (*Store) ListExecutionSpansByRun ¶
func (*Store) ListFlowerThreadMetadataByParent ¶ added in v0.7.2
func (*Store) ListFollowupsByLane ¶
func (*Store) ListHistoryLite ¶
func (s *Store) ListHistoryLite(ctx context.Context, endpointID string, threadID string, limit int) ([]Message, error)
ListHistoryLite returns the latest messages as (role, status, text_content), in ascending order.
func (*Store) ListMemoryItemsByScopeKind ¶
func (*Store) ListMessages ¶
func (s *Store) ListMessages(ctx context.Context, endpointID string, threadID string, limit int, beforeID int64) ([]Message, int64, bool, error)
ListMessages returns messages in ascending order by internal id.
If beforeID <= 0, it returns the latest messages. Otherwise, it returns messages with id < beforeID. The returned nextBeforeID is the smallest id in the result (for loading older history).
func (*Store) ListMessagesAfter ¶
func (s *Store) ListMessagesAfter(ctx context.Context, endpointID string, threadID string, limit int, afterID int64) ([]Message, int64, bool, error)
ListMessagesAfter returns messages in ascending order by internal id.
It returns messages with id > afterID. The returned nextAfterID is the largest id in the result (for incremental backfill). If no messages are returned, nextAfterID equals afterID.
func (*Store) ListPendingForkOperations ¶ added in v0.9.0
func (*Store) ListPendingThreadDeleteOperations ¶ added in v0.9.0
func (*Store) ListQueuedTurns ¶
func (*Store) ListRecentExecutionSpansByThread ¶
func (*Store) ListRecentMemoryItems ¶
func (*Store) ListRecentStructuredUserInputs ¶
func (*Store) ListRecentThreadToolCalls ¶
func (*Store) ListRecentTranscriptMessages ¶
func (*Store) ListRequestUserInputSecretAnswers ¶
func (*Store) ListRunEvents ¶
func (*Store) ListRunEventsPage ¶
func (s *Store) ListRunEventsPage(ctx context.Context, endpointID string, runID string, query RunEventsQuery) ([]RunEventRecord, int64, bool, error)
func (*Store) ListThreadCheckpointIDs ¶
func (*Store) ListThreadContextRunEvents ¶ added in v0.7.2
func (*Store) ListThreads ¶
func (*Store) ListThreadsWithQueuedTurns ¶ added in v0.7.2
func (*Store) ListUnbroadcastCommittedForkOperations ¶ added in v0.9.0
func (*Store) MarkDelegatedApprovalAckUnknown ¶ added in v0.7.2
func (*Store) MarkDelegatedApprovalCanceled ¶ added in v0.8.0
func (*Store) MarkDelegatedApprovalDelivered ¶ added in v0.7.2
func (*Store) MarkDelegatedApprovalUnavailable ¶ added in v0.7.2
func (*Store) MarkForkOperationBroadcasted ¶ added in v0.9.0
func (*Store) MarkPendingDelegatedApprovalsUnavailable ¶ added in v0.7.2
func (*Store) MarkThreadDeleteFailed ¶ added in v0.9.0
func (*Store) MaybeCompact ¶
func (s *Store) MaybeCompact(ctx context.Context) (SQLiteCompactionPlan, error)
func (*Store) PopNextQueuedTurn ¶
func (*Store) PrepareExpiredUploadsForDeletion ¶
func (*Store) PrepareForkOperation ¶ added in v0.9.0
func (s *Store) PrepareForkOperation(ctx context.Context, req ForkThreadRequest) (*ForkOperation, error)
func (*Store) PrepareThreadDeleteOperation ¶ added in v0.9.0
func (*Store) PruneThreadCheckpoints ¶
func (*Store) RecordForkOperationFailure ¶ added in v0.9.0
func (*Store) RecordThreadDeleteRetry ¶ added in v0.9.0
func (*Store) RecoverQueuedTurnsToDrafts ¶
func (*Store) RenameThread ¶
func (*Store) ReorderFollowups ¶
func (*Store) ReplaceRequestUserInputSecretAnswers ¶
func (*Store) ReplaceStructuredUserInputs ¶
func (*Store) ReplaceThreadTodosSnapshot ¶
func (s *Store) ReplaceThreadTodosSnapshot(ctx context.Context, rec ThreadTodosSnapshot, expectedVersion *int64) (ThreadTodosSnapshot, error)
func (*Store) RescheduleUploadDeletion ¶
func (*Store) ResetStaleActiveThreadRunStates ¶
ResetStaleActiveThreadRunStates marks startup-orphaned active thread states as canceled.
Why this exists: - Active runs are held in memory during normal execution. - If the runtime process restarts, those in-memory runs are gone. - Any persisted thread state that still looks "active" must be reset so UI does not show phantom running threads.
func (*Store) SQLitePageStats ¶
func (s *Store) SQLitePageStats(ctx context.Context) (SQLitePageStats, error)
func (*Store) SetAutoThreadTitle ¶
func (*Store) SetThreadCheckpointWorkspaceJSON ¶
func (*Store) SetThreadOpenGoal ¶
func (*Store) SetThreadPinned ¶ added in v0.7.1
func (*Store) SetThreadProviderContinuation ¶
func (*Store) SetThreadProviderContinuationIfBoundaryMatches ¶ added in v0.7.2
func (s *Store) SetThreadProviderContinuationIfBoundaryMatches(ctx context.Context, endpointID string, threadID string, expected ThreadContextBoundary, cont ThreadProviderContinuation) error
func (*Store) StartUserTurn ¶ added in v0.7.2
func (s *Store) StartUserTurn(ctx context.Context, rec StartUserTurn) (StartUserTurnResult, error)
func (*Store) SubmitDelegatedApprovalDecisionCAS ¶ added in v0.7.2
func (s *Store) SubmitDelegatedApprovalDecisionCAS(ctx context.Context, req DelegatedApprovalDecisionRequest) (DelegatedApprovalDecisionResult, error)
func (*Store) UpdateFollowupText ¶
func (*Store) UpdatePendingDelegatedApprovalPresentation ¶ added in v0.8.0
func (*Store) UpdateQueuedTurn ¶
func (*Store) UpdateThreadLastMessagePreview ¶ added in v0.7.2
func (*Store) UpdateThreadModelAndReasoningSelection ¶ added in v0.7.2
func (*Store) UpdateThreadModelID ¶
func (*Store) UpdateThreadPermissionType ¶ added in v0.7.2
func (*Store) UpdateThreadReasoningSelection ¶ added in v0.7.2
func (*Store) UpdateThreadRunState ¶
func (*Store) UpdateTranscriptMessageJSONByRowID ¶
func (s *Store) UpdateTranscriptMessageJSONByRowID(ctx context.Context, endpointID string, rowID int64, messageJSON string, updatedAtUnixMs int64) error
UpdateTranscriptMessageJSONByRowID updates transcript_messages.message_json without mutating thread metadata.
func (*Store) UpsertDelegatedApprovalRequest ¶ added in v0.7.2
func (s *Store) UpsertDelegatedApprovalRequest(ctx context.Context, rec DelegatedApprovalRecord) error
func (*Store) UpsertExecutionSpan ¶
func (s *Store) UpsertExecutionSpan(ctx context.Context, rec ExecutionSpanRecord) error
func (*Store) UpsertFlowerThreadMetadata ¶ added in v0.7.1
func (s *Store) UpsertFlowerThreadMetadata(ctx context.Context, rec FlowerThreadMetadata) error
func (*Store) UpsertMemoryItem ¶
func (s *Store) UpsertMemoryItem(ctx context.Context, rec MemoryItemRecord) error
func (*Store) UpsertProjectedMessage ¶ added in v0.7.2
func (s *Store) UpsertProjectedMessage(ctx context.Context, endpointID string, threadID string, m Message, updatedByID string, updatedByEmail string) (int64, error)
UpsertProjectedMessage stores or replaces one host-owned transcript message identified by endpoint, thread, and message id.
func (*Store) UpsertProjectedThread ¶ added in v0.7.2
UpsertProjectedThread stores a host-owned thread projection without assuming the normal user-created thread lifecycle.
func (*Store) UpsertProjectedThreadWithFlowerMetadata ¶ added in v0.7.2
func (s *Store) UpsertProjectedThreadWithFlowerMetadata(ctx context.Context, t Thread, meta FlowerThreadMetadata) error
UpsertProjectedThreadWithFlowerMetadata atomically stores a projected thread and its Flower ownership metadata, so projection-only threads cannot leak into ordinary thread-list queries between separate writes.
func (*Store) UpsertProviderCapability ¶
func (s *Store) UpsertProviderCapability(ctx context.Context, rec ProviderCapabilityRecord) error
func (*Store) UpsertThreadState ¶
func (s *Store) UpsertThreadState(ctx context.Context, st ThreadState) error
func (*Store) UpsertToolCall ¶
func (s *Store) UpsertToolCall(ctx context.Context, rec ToolCallRecord) error
type StructuredUserInputRecord ¶
type StructuredUserInputRecord struct {
ID int64 `json:"id"`
EndpointID string `json:"endpoint_id"`
ThreadID string `json:"thread_id"`
ResponseMessageID string `json:"response_message_id"`
PromptID string `json:"prompt_id"`
ToolID string `json:"tool_id"`
ReasonCode string `json:"reason_code"`
QuestionID string `json:"question_id"`
Header string `json:"header"`
QuestionText string `json:"question_text"`
SelectedChoiceID string `json:"selected_choice_id"`
SelectedChoiceLabel string `json:"selected_choice_label"`
Text string `json:"text,omitempty"`
PublicSummary string `json:"public_summary"`
ContainsSecret bool `json:"contains_secret"`
CreatedAtUnixMs int64 `json:"created_at_unix_ms"`
}
type Thread ¶
type Thread struct {
ThreadID string `json:"thread_id"`
EndpointID string `json:"endpoint_id"`
NamespacePublicID string `json:"namespace_public_id"`
ModelID string `json:"model_id"`
ReasoningSelectionJSON string `json:"reasoning_selection_json"`
PermissionType string `json:"permission_type"`
WorkingDir string `json:"working_dir"`
Title string `json:"title"`
TitleSource string `json:"title_source"`
TitleGeneratedAtUnixMs int64 `json:"title_generated_at_unix_ms"`
TitleInputMessageID string `json:"title_input_message_id"`
TitleModelID string `json:"title_model_id"`
TitlePromptVersion string `json:"title_prompt_version"`
RunStatus string `json:"run_status"`
RunUpdatedAtUnixMs int64 `json:"run_updated_at_unix_ms"`
RunErrorCode string `json:"run_error_code"`
RunError string `json:"run_error"`
WaitingUserInputJSON string `json:"waiting_user_input_json"`
LastContextRunID string `json:"last_context_run_id"`
PinnedAtUnixMs int64 `json:"pinned_at_unix_ms"`
FlowerActivityRevision int64 `json:"flower_activity_revision"`
FlowerActivitySignature string `json:"flower_activity_signature"`
FlowerActivityWaitingPromptID string `json:"flower_activity_waiting_prompt_id"`
CreatedByUserPublicID string `json:"created_by_user_public_id"`
CreatedByUserEmail string `json:"created_by_user_email"`
UpdatedByUserPublicID string `json:"updated_by_user_public_id"`
UpdatedByUserEmail string `json:"updated_by_user_email"`
CreatedAtUnixMs int64 `json:"created_at_unix_ms"`
UpdatedAtUnixMs int64 `json:"updated_at_unix_ms"`
LastMessageAtUnixMs int64 `json:"last_message_at_unix_ms"`
LastMessagePreview string `json:"last_message_preview"`
}
type ThreadCheckpointRecord ¶
type ThreadCheckpointRecord struct {
CheckpointID string `json:"checkpoint_id"`
EndpointID string `json:"endpoint_id"`
ThreadID string `json:"thread_id"`
RunID string `json:"run_id"`
Kind string `json:"kind"`
CreatedAtUnixMs int64 `json:"created_at_unix_ms"`
ThreadJSON string `json:"thread_json"`
DerivedJSON string `json:"derived_json"`
WorkspaceJSON string `json:"workspace_json"`
TranscriptMaxID int64 `json:"transcript_max_id"`
TurnsMaxID int64 `json:"turns_max_id"`
ToolCallsMaxID int64 `json:"tool_calls_max_id"`
RunEventsMaxID int64 `json:"run_events_max_id"`
}
ThreadCheckpointRecord is a persisted record for a single thread checkpoint.
type ThreadContextBoundary ¶ added in v0.7.2
type ThreadDeleteOperation ¶ added in v0.9.0
type ThreadDeleteOperation struct {
OperationID string
EndpointID string
ThreadID string
Status string
Snapshot ThreadDeleteSnapshotV1
SnapshotValid bool
SnapshotErrorCode string
ProductDataDeletedAtUnixMs int64
FilesCleanedAtUnixMs int64
FloretDeletedAtUnixMs int64
ReadStateDeletedAtUnixMs int64
RetryCount int
ErrorCode string
ErrorMessage string
CreatedAtUnixMs int64
UpdatedAtUnixMs int64
CommittedAtUnixMs int64
}
type ThreadDeleteResourcesResult ¶
type ThreadDeleteResourcesResult struct {
CheckpointIDs []string
UploadsToDelete []UploadRecord
}
type ThreadDeleteSnapshotV1 ¶ added in v0.9.0
type ThreadProviderContinuation ¶
type ThreadProviderContinuation struct {
State ProviderContinuationState `json:"state"`
ProviderID string `json:"provider_id"`
Model string `json:"model"`
BaseURL string `json:"base_url"`
UpdatedAtUnixMs int64 `json:"updated_at_unix_ms"`
}
func (ThreadProviderContinuation) IsZero ¶
func (c ThreadProviderContinuation) IsZero() bool
func (ThreadProviderContinuation) Normalized ¶
func (c ThreadProviderContinuation) Normalized() ThreadProviderContinuation
type ThreadRunStateWrite ¶ added in v0.7.2
type ThreadState ¶
type ThreadState struct {
EndpointID string `json:"endpoint_id"`
ThreadID string `json:"thread_id"`
OpenGoal string `json:"open_goal"`
LastAssistantSummary string `json:"last_assistant_summary"`
ProviderContinuation ThreadProviderContinuation `json:"provider_continuation,omitempty"`
UpdatedAtUnixMs int64 `json:"updated_at_unix_ms"`
}
type ThreadTodosSnapshot ¶
type ThreadTodosSnapshot struct {
EndpointID string `json:"endpoint_id"`
ThreadID string `json:"thread_id"`
Version int64 `json:"version"`
TodosJSON string `json:"todos_json"`
UpdatedAtUnixMs int64 `json:"updated_at_unix_ms"`
UpdatedByRunID string `json:"updated_by_run_id"`
UpdatedByToolID string `json:"updated_by_tool_id"`
}
ThreadTodosSnapshot stores the thread-level todo list snapshot.
type ThreadsCursor ¶
func DecodeCursor ¶
func DecodeCursor(raw string) (ThreadsCursor, bool)
type ToolCallRecord ¶
type ToolCallRecord struct {
RunID string `json:"run_id"`
ToolID string `json:"tool_id"`
ToolName string `json:"tool_name"`
Status string `json:"status"`
ArgsJSON string `json:"args_json"`
ResultJSON string `json:"result_json"`
ErrorCode string `json:"error_code"`
ErrorMessage string `json:"error_message"`
Retryable bool `json:"retryable"`
RecoveryAction string `json:"recovery_action"`
StartedAtUnixMs int64 `json:"started_at_unix_ms"`
EndedAtUnixMs int64 `json:"ended_at_unix_ms"`
LatencyMS int64 `json:"latency_ms"`
}
type UploadRecord ¶
type UploadRecord struct {
UploadID string `json:"upload_id"`
EndpointID string `json:"endpoint_id"`
StorageRelPath string `json:"storage_relpath"`
Name string `json:"name"`
MimeType string `json:"mime_type"`
SizeBytes int64 `json:"size_bytes"`
State string `json:"state"`
CreatedAtUnixMs int64 `json:"created_at_unix_ms"`
ClaimedAtUnixMs int64 `json:"claimed_at_unix_ms"`
DeleteAfterUnixMs int64 `json:"delete_after_unix_ms"`
}