firestore

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package firestore provides Firestore-backed implementations of AILANG storage interfaces.

Index

Constants

View Source
const DefaultSpanTTL = 7 * 24 * time.Hour // 7 days

DefaultSpanTTL is the default time-to-live for observatory span documents.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client wraps a Firestore client with project-specific configuration.

func NewClient

func NewClient(ctx context.Context) (*Client, error)

NewClient creates a new Firestore client using Application Default Credentials. Requires AILANG_CLOUD_PROJECT to be set.

func (*Client) Batch

func (c *Client) Batch() *firestore.WriteBatch

Batch creates a new Firestore write batch.

func (*Client) Close

func (c *Client) Close() error

Close closes the underlying Firestore client.

func (*Client) Collection

func (c *Client) Collection(name string) *firestore.CollectionRef

Collection returns a Firestore collection reference.

func (*Client) Doc

func (c *Client) Doc(collection, id string) *firestore.DocumentRef

Doc returns a Firestore document reference.

func (*Client) GetAll

GetAll retrieves multiple documents in a single batch read.

func (*Client) RunTransaction

func (c *Client) RunTransaction(ctx context.Context, fn func(context.Context, *firestore.Transaction) error) error

RunTransaction runs a Firestore transaction.

type CoordinatorStore

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

CoordinatorStore implements coordinator.Store backed by Firestore.

func NewCoordinatorStore

func NewCoordinatorStore(client *Client) *CoordinatorStore

NewCoordinatorStore creates a new Firestore-backed coordinator store.

func (*CoordinatorStore) Close

func (s *CoordinatorStore) Close() error

Close stops the cost sync goroutine and closes the underlying client.

func (*CoordinatorStore) CreateApprovalRequest

func (s *CoordinatorStore) CreateApprovalRequest(ctx context.Context, req *coordinator.ApprovalRequestRecord) error

func (*CoordinatorStore) CreateTask

func (s *CoordinatorStore) CreateTask(ctx context.Context, task *coordinator.TaskRecord) error

func (*CoordinatorStore) DeleteOldTasks

func (s *CoordinatorStore) DeleteOldTasks(ctx context.Context, olderThan time.Duration) (int, error)

func (*CoordinatorStore) DeleteTask

func (s *CoordinatorStore) DeleteTask(ctx context.Context, id string) error

func (*CoordinatorStore) FindDuplicateTask

func (s *CoordinatorStore) FindDuplicateTask(ctx context.Context, fingerprint uint64, _ float64) (*coordinator.TaskRecord, error)

func (*CoordinatorStore) GetApprovalRequest

func (s *CoordinatorStore) GetApprovalRequest(ctx context.Context, id string) (*coordinator.ApprovalRequestRecord, error)

func (*CoordinatorStore) GetApprovalRequestByTask

func (s *CoordinatorStore) GetApprovalRequestByTask(ctx context.Context, taskID string) (*coordinator.ApprovalRequestRecord, error)

func (*CoordinatorStore) GetApprovalRequestByTaskAnyStatus

func (s *CoordinatorStore) GetApprovalRequestByTaskAnyStatus(ctx context.Context, taskID string) (*coordinator.ApprovalRequestRecord, error)

func (*CoordinatorStore) GetCostByProvider

func (s *CoordinatorStore) GetCostByProvider() (map[string]float64, error)

GetCostByProvider returns total cost per provider from the in-memory cache. Zero Firestore reads on the hot path — counters are synced in the background.

func (*CoordinatorStore) GetTask

func (*CoordinatorStore) GetTaskAgentInfo

func (s *CoordinatorStore) GetTaskAgentInfo(ctx context.Context, taskID string) (agentID, inbox, title string, err error)

func (*CoordinatorStore) GetTaskEvents

func (s *CoordinatorStore) GetTaskEvents(ctx context.Context, taskID string, limit int) ([]*coordinator.TaskEventRecord, error)

func (*CoordinatorStore) GetTaskStats

func (s *CoordinatorStore) GetTaskStats(ctx context.Context) (*coordinator.TaskStats, error)

GetTaskStats returns aggregate task statistics, served from an in-memory cache with a 30-second TTL. This avoids a full collection scan on every API call.

func (*CoordinatorStore) GetTasksByGithubIssue

func (s *CoordinatorStore) GetTasksByGithubIssue(ctx context.Context, issueNum int) ([]*coordinator.TaskRecord, error)

func (*CoordinatorStore) GetTasksByStage

func (s *CoordinatorStore) GetTasksByStage(ctx context.Context, stage coordinator.TaskStage) ([]*coordinator.TaskRecord, error)

func (*CoordinatorStore) ListApprovedMergeHandoffsWithoutTrigger

func (s *CoordinatorStore) ListApprovedMergeHandoffsWithoutTrigger(ctx context.Context) ([]*coordinator.ApprovalRequestRecord, error)

func (*CoordinatorStore) ListPendingApprovals

func (s *CoordinatorStore) ListPendingApprovals(ctx context.Context) ([]*coordinator.ApprovalRequestRecord, error)

func (*CoordinatorStore) ListResolvedApprovals

func (s *CoordinatorStore) ListResolvedApprovals(ctx context.Context, limit int) ([]*coordinator.ApprovalRequestRecord, error)

func (*CoordinatorStore) ListTasks

func (*CoordinatorStore) MarkApprovalHandoffsTriggered

func (s *CoordinatorStore) MarkApprovalHandoffsTriggered(ctx context.Context, taskID string) error

func (*CoordinatorStore) MarkTaskCancelled

func (s *CoordinatorStore) MarkTaskCancelled(ctx context.Context, id string) error

func (*CoordinatorStore) MarkTaskCompleted

func (s *CoordinatorStore) MarkTaskCompleted(ctx context.Context, id string, result *coordinator.ExecuteResult) error

func (*CoordinatorStore) MarkTaskFailed

func (s *CoordinatorStore) MarkTaskFailed(ctx context.Context, id string, taskErr error) error

func (*CoordinatorStore) MarkTaskPendingApproval

func (s *CoordinatorStore) MarkTaskPendingApproval(ctx context.Context, id, worktreePath, worktreeBranch, baseBranch, baseCommit string, result *coordinator.ExecuteResult) error

func (*CoordinatorStore) MarkTaskQueued

func (s *CoordinatorStore) MarkTaskQueued(ctx context.Context, id string) error

func (*CoordinatorStore) MarkTaskRejected

func (s *CoordinatorStore) MarkTaskRejected(ctx context.Context, id string) error

func (*CoordinatorStore) MarkTaskRunning

func (s *CoordinatorStore) MarkTaskRunning(ctx context.Context, id, provider, worktreeID string) error

func (*CoordinatorStore) RecoverStaleTasks

func (s *CoordinatorStore) RecoverStaleTasks(ctx context.Context, staleThreshold time.Duration) (int, error)

func (*CoordinatorStore) RequeueTask

func (s *CoordinatorStore) RequeueTask(ctx context.Context, id string) error

func (*CoordinatorStore) ResetTaskToPending

func (s *CoordinatorStore) ResetTaskToPending(ctx context.Context, id string) error

func (*CoordinatorStore) ResolveApprovalRequest

func (s *CoordinatorStore) ResolveApprovalRequest(ctx context.Context, id, resolveStatus, resolvedBy string) error

func (*CoordinatorStore) ResolveApprovalRequestByTask

func (s *CoordinatorStore) ResolveApprovalRequestByTask(ctx context.Context, taskID, resolveStatus, resolvedBy string) error

func (*CoordinatorStore) RetryAllFailedTasks

func (s *CoordinatorStore) RetryAllFailedTasks(ctx context.Context) (int, error)

func (*CoordinatorStore) SetTaskDesignDocPath

func (s *CoordinatorStore) SetTaskDesignDocPath(ctx context.Context, id, path string) error

func (*CoordinatorStore) SetTaskFingerprint

func (s *CoordinatorStore) SetTaskFingerprint(ctx context.Context, id string, fingerprint uint64) error

func (*CoordinatorStore) SetTaskGithubIssue

func (s *CoordinatorStore) SetTaskGithubIssue(ctx context.Context, id string, issueNum int) error

func (*CoordinatorStore) SetTaskSprintPlanPath

func (s *CoordinatorStore) SetTaskSprintPlanPath(ctx context.Context, id, path string) error

func (*CoordinatorStore) SetTaskStage

func (s *CoordinatorStore) SetTaskStage(ctx context.Context, id string, stage coordinator.TaskStage) error

func (*CoordinatorStore) SetTaskThreadID

func (s *CoordinatorStore) SetTaskThreadID(ctx context.Context, id, threadID string) error

func (*CoordinatorStore) StartCostSync

func (s *CoordinatorStore) StartCostSync(ctx context.Context)

StartCostSync bootstraps the in-memory cost counter from Firestore and starts a background goroutine that writes dirty counters back every 5 minutes.

func (*CoordinatorStore) StopCostSync

func (s *CoordinatorStore) StopCostSync()

StopCostSync stops the background sync goroutine and performs a final flush.

func (*CoordinatorStore) StoreTaskEvent

func (s *CoordinatorStore) StoreTaskEvent(ctx context.Context, event *coordinator.TaskEventRecord) error

func (*CoordinatorStore) UpdateTask

func (s *CoordinatorStore) UpdateTask(ctx context.Context, task *coordinator.TaskRecord) error

func (*CoordinatorStore) UpdateTaskChainInfo

func (s *CoordinatorStore) UpdateTaskChainInfo(ctx context.Context, id, chainID, stageID string) error

func (*CoordinatorStore) UpdateTaskMetrics

func (s *CoordinatorStore) UpdateTaskMetrics(ctx context.Context, id string, peakCPU, peakMemory float64) error

type MessagingStore

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

MessagingStore implements messaging.MessageStore backed by Firestore.

func NewMessagingStore

func NewMessagingStore(client *Client) *MessagingStore

NewMessagingStore creates a new Firestore-backed messaging store.

func (*MessagingStore) ApplyDuplicates

func (s *MessagingStore) ApplyDuplicates(groups []messaging.DuplicateGroup, runID string) error

func (*MessagingStore) ApproveApproval

func (s *MessagingStore) ApproveApproval(approvalID, reviewedBy string, reviewNotes string, tokenDuration time.Duration) error

func (*MessagingStore) ClaimMessage

func (s *MessagingStore) ClaimMessage(messageID, claimedBy string) error

func (*MessagingStore) CleanupInboxMessages

func (s *MessagingStore) CleanupInboxMessages(olderThan time.Duration, expiredOnly bool) (int64, error)

func (*MessagingStore) CleanupOldHistory

func (s *MessagingStore) CleanupOldHistory(retentionDays int) (int64, int64, error)

func (*MessagingStore) ClearDuplicateMarker

func (s *MessagingStore) ClearDuplicateMarker(msgID string) error

func (*MessagingStore) Close

func (s *MessagingStore) Close() error

Close closes the underlying client.

func (*MessagingStore) CountInboxMessagesByStatus

func (s *MessagingStore) CountInboxMessagesByStatus(inbox string) (map[string]int64, error)

func (*MessagingStore) CreateApproval

func (s *MessagingStore) CreateApproval(threadID, instanceID string, effectDelta *messaging.EffectDelta, proposal, impact string, estimatedCost float64) (*messaging.Approval, error)

func (*MessagingStore) CreateMessage

func (s *MessagingStore) CreateMessage(threadID, fromType, fromID, toType, toID, kind, content, metadataJSON string) (*messaging.Message, error)

func (*MessagingStore) CreateThread

func (s *MessagingStore) CreateThread(title, createdByType, createdByID, targetAgent string) (*messaging.Thread, error)

func (*MessagingStore) CreateThreadWithWorkspace

func (s *MessagingStore) CreateThreadWithWorkspace(title, createdByType, createdByID, targetAgent, workspace string) (*messaging.Thread, error)

func (*MessagingStore) DeleteThread

func (s *MessagingStore) DeleteThread(threadID string) error

func (*MessagingStore) FindDuplicates

func (s *MessagingStore) FindDuplicates(inbox string, threshold float64) ([]messaging.DuplicateGroup, error)

func (*MessagingStore) FindMessageByPrefix

func (s *MessagingStore) FindMessageByPrefix(prefix string) (string, error)

FindMessageByPrefix resolves a short ID prefix to a full message ID. Firestore doesn't support LIKE queries, so we use range queries on the ID field.

func (*MessagingStore) FindSimilar

func (s *MessagingStore) FindSimilar(msgID string, threshold float64, limit int) ([]messaging.SearchHit, error)

func (*MessagingStore) ForwardInboxMessage

func (s *MessagingStore) ForwardInboxMessage(id string, toInbox string) error

func (*MessagingStore) GetActiveAgents

func (s *MessagingStore) GetActiveAgents() ([]messaging.ActiveAgent, error)

func (*MessagingStore) GetAgentMetrics

func (s *MessagingStore) GetAgentMetrics(agentID string) (*messaging.AggregatedMetrics, error)

func (*MessagingStore) GetAgentStats

func (s *MessagingStore) GetAgentStats(agentID string) (*messaging.AgentStats, error)

func (*MessagingStore) GetAggregatedExecutionStats

func (s *MessagingStore) GetAggregatedExecutionStats() (*messaging.ExecutionStats, error)

func (*MessagingStore) GetApproval

func (s *MessagingStore) GetApproval(approvalID string) (*messaging.Approval, error)

func (*MessagingStore) GetApprovalHistory

func (s *MessagingStore) GetApprovalHistory(threadID string, limit int) ([]messaging.ApprovalHistoryEntry, error)

func (*MessagingStore) GetApprovalsByStatus

func (s *MessagingStore) GetApprovalsByStatus(approvalStatus string, limit int) ([]messaging.Approval, error)

func (*MessagingStore) GetDistinctWorkspaces

func (s *MessagingStore) GetDistinctWorkspaces() ([]string, error)

func (*MessagingStore) GetExecutionStatsByThread

func (s *MessagingStore) GetExecutionStatsByThread(threadID string) (*messaging.ExecutionStats, error)

func (*MessagingStore) GetGlobalMetrics

func (s *MessagingStore) GetGlobalMetrics() (*messaging.AggregatedMetrics, error)

func (*MessagingStore) GetHierarchy

func (s *MessagingStore) GetHierarchy() (*messaging.HierarchyResponse, error)

func (*MessagingStore) GetInboxMessage

func (s *MessagingStore) GetInboxMessage(id string) (*messaging.InboxMessage, error)

func (*MessagingStore) GetInstanceHistory

func (s *MessagingStore) GetInstanceHistory(agentID string, limit int) ([]messaging.InstanceHistoryEntry, error)

func (*MessagingStore) GetKnownAgents

func (s *MessagingStore) GetKnownAgents() ([]messaging.AgentInfo, error)

func (*MessagingStore) GetMessageFlowEdges

func (s *MessagingStore) GetMessageFlowEdges() ([]messaging.MessageFlowEdge, error)

func (*MessagingStore) GetMessages

func (s *MessagingStore) GetMessages(toType, toID, deliveryState string) ([]messaging.Message, error)

func (*MessagingStore) GetMessagesFromSeq

func (s *MessagingStore) GetMessagesFromSeq(threadID string, fromSeq int, limit int) ([]messaging.Message, error)

func (*MessagingStore) GetMetrics

func (s *MessagingStore) GetMetrics(scopeType, scopeID string) (*messaging.AggregatedMetrics, error)

func (*MessagingStore) GetMetricsTrends

func (s *MessagingStore) GetMetricsTrends(scopeType, scopeID, period string, limit int) ([]map[string]interface{}, error)

func (*MessagingStore) GetOrCreateThreadWithWorkspace

func (s *MessagingStore) GetOrCreateThreadWithWorkspace(title, createdByType, createdByID, targetAgent, workspace string) (*messaging.Thread, bool, error)

func (*MessagingStore) GetThread

func (s *MessagingStore) GetThread(threadID string) (*messaging.Thread, error)

func (*MessagingStore) GetThreadAggregateStats

func (s *MessagingStore) GetThreadAggregateStats() (*messaging.ThreadAggregateStats, error)

func (*MessagingStore) GetThreadByTitleAndAgent

func (s *MessagingStore) GetThreadByTitleAndAgent(title, targetAgent string) (*messaging.Thread, error)

func (*MessagingStore) GetThreadMetrics

func (s *MessagingStore) GetThreadMetrics(threadID string) (*messaging.AggregatedMetrics, error)

func (*MessagingStore) GetThreadWorkspace

func (s *MessagingStore) GetThreadWorkspace(threadID string) (string, error)

func (*MessagingStore) GetThreadsByStatus

func (s *MessagingStore) GetThreadsByStatus(threadStatus string, limit int) ([]messaging.Thread, error)

func (*MessagingStore) GetThreadsFiltered

func (s *MessagingStore) GetThreadsFiltered(filter messaging.ThreadFilter) ([]messaging.Thread, error)

func (*MessagingStore) InboxMessageExistsByGitHub

func (s *MessagingStore) InboxMessageExistsByGitHub(repo string, issueNumber int) (bool, error)

func (*MessagingStore) InboxMessageExistsByTitle

func (s *MessagingStore) InboxMessageExistsByTitle(inbox string, title string) (string, error)

func (*MessagingStore) InsertInboxMessage

func (s *MessagingStore) InsertInboxMessage(msg *messaging.InboxMessage) error

func (*MessagingStore) InsertInboxMessageWithContext

func (s *MessagingStore) InsertInboxMessageWithContext(ctx context.Context, msg *messaging.InboxMessage) error

func (*MessagingStore) ListInboxMessages

func (s *MessagingStore) ListInboxMessages(opts messaging.InboxListOptions) ([]messaging.InboxMessage, error)

func (*MessagingStore) MarkAllAsAcked

func (s *MessagingStore) MarkAllAsAcked(toType, toID string) (int64, error)

func (*MessagingStore) MarkAllInboxMessagesRead

func (s *MessagingStore) MarkAllInboxMessagesRead(inbox string) (int64, error)

func (*MessagingStore) MarkAsAcked

func (s *MessagingStore) MarkAsAcked(messageID string) error

func (*MessagingStore) MarkAsUnacked

func (s *MessagingStore) MarkAsUnacked(messageID string) error

func (*MessagingStore) MarkInboxMessageRead

func (s *MessagingStore) MarkInboxMessageRead(id string) error

func (*MessagingStore) MarkInboxMessageUnread

func (s *MessagingStore) MarkInboxMessageUnread(id string) error

func (*MessagingStore) NewThreadFilter

func (s *MessagingStore) NewThreadFilter(threadStatus, workspace string, limit int) messaging.ThreadFilter

func (*MessagingStore) RecordAgentInstance

func (s *MessagingStore) RecordAgentInstance(agentID, instanceID string) error

func (*MessagingStore) RecordApprovalHistory

func (s *MessagingStore) RecordApprovalHistory(approvalID, threadID, agentID, action, actor, proposal, impact string, estimatedCost *float64, capabilityToken string) error

func (*MessagingStore) RecordInstanceEnd

func (s *MessagingStore) RecordInstanceEnd(instanceID string, exitCode int, totalTokens, totalCostCents, threadCount int) error

func (*MessagingStore) RecordInstanceStart

func (s *MessagingStore) RecordInstanceStart(agentID, instanceID string) error

func (*MessagingStore) RecordMetrics

func (s *MessagingStore) RecordMetrics(threadID, agentID string, stats *messaging.MessageExecutionStats) error

func (*MessagingStore) RegisterAgent

func (s *MessagingStore) RegisterAgent(agentID, label, agentStatus string) error

func (*MessagingStore) RejectApproval

func (s *MessagingStore) RejectApproval(approvalID, reviewedBy string, reviewNotes string) error

func (*MessagingStore) SemanticSearch

func (s *MessagingStore) SemanticSearch(opts messaging.SearchOptions) ([]messaging.SearchHit, error)

SemanticSearch performs SimHash-based semantic search over inbox messages. Firestore doesn't support bitwise operations, so we scan and filter client-side. For neural search, the caller should provide an Embedder in opts.

func (*MessagingStore) SetThreadTargetAgent

func (s *MessagingStore) SetThreadTargetAgent(threadID, targetAgent string) error

func (*MessagingStore) SetThreadWorkspace

func (s *MessagingStore) SetThreadWorkspace(threadID, workspace string) error

func (*MessagingStore) Subscribe

func (s *MessagingStore) Subscribe(instanceID, threadID string) error

func (*MessagingStore) UpdateAckSeq

func (s *MessagingStore) UpdateAckSeq(instanceID, threadID string, ackSeq int) error

func (*MessagingStore) UpdateAgentStatus

func (s *MessagingStore) UpdateAgentStatus(agentID, agentStatus string) error

func (*MessagingStore) UpdateInboxMessageGitHub

func (s *MessagingStore) UpdateInboxMessageGitHub(messageID string, issueNumber int, repo string) error

func (*MessagingStore) UpdateMessageEmbedding

func (s *MessagingStore) UpdateMessageEmbedding(msgID string, embedding []float32, model string) error

func (*MessagingStore) UpdateMessageEnvelope

func (s *MessagingStore) UpdateMessageEnvelope(msgID string, env *messaging.Envelope, overwrite bool) error

func (*MessagingStore) UpdateThreadTitle

func (s *MessagingStore) UpdateThreadTitle(threadID, title string) error

type ObservatoryStore

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

ObservatoryStore implements observatory.Backend backed by Firestore.

func NewObservatoryStore

func NewObservatoryStore(client *Client) *ObservatoryStore

NewObservatoryStore creates a new Firestore-backed observatory store.

func (*ObservatoryStore) BackfillSpansWorkspace

func (s *ObservatoryStore) BackfillSpansWorkspace(ctx context.Context, sessionID, workspace string) (int64, error)

func (*ObservatoryStore) Close

func (s *ObservatoryStore) Close() error

func (*ObservatoryStore) CountChatMessages

func (s *ObservatoryStore) CountChatMessages(ctx context.Context, q obs.ChatMessageQuery) (total int, withTaskID int, err error)

func (*ObservatoryStore) CreateAgentAssignment

func (s *ObservatoryStore) CreateAgentAssignment(ctx context.Context, a *obs.AgentAssignment) error

func (*ObservatoryStore) CreateChain

func (*ObservatoryStore) CreateMessage

func (s *ObservatoryStore) CreateMessage(ctx context.Context, m *obs.Message) error

func (*ObservatoryStore) CreateMetric

func (s *ObservatoryStore) CreateMetric(ctx context.Context, m *obs.Metric) error

func (*ObservatoryStore) CreateSpan

func (s *ObservatoryStore) CreateSpan(ctx context.Context, span *obs.Span) error

func (*ObservatoryStore) CreateSpanEvent

func (s *ObservatoryStore) CreateSpanEvent(ctx context.Context, e *obs.SpanEvent) error

func (*ObservatoryStore) CreateStage

func (s *ObservatoryStore) CreateStage(ctx context.Context, req *obs.StageCreateRequest) (*obs.ChainStage, error)

func (*ObservatoryStore) CreateTask

func (s *ObservatoryStore) CreateTask(ctx context.Context, t *obs.Task) error

func (*ObservatoryStore) CreateWorkspace

func (s *ObservatoryStore) CreateWorkspace(ctx context.Context, w *obs.Workspace) error

func (*ObservatoryStore) DeleteAgentAssignment

func (s *ObservatoryStore) DeleteAgentAssignment(ctx context.Context, id string) error

func (*ObservatoryStore) DeleteMessage

func (s *ObservatoryStore) DeleteMessage(ctx context.Context, id string) error

func (*ObservatoryStore) DeleteSpan

func (s *ObservatoryStore) DeleteSpan(ctx context.Context, id string) error

func (*ObservatoryStore) DeleteSpanEvent

func (s *ObservatoryStore) DeleteSpanEvent(ctx context.Context, id int64) error

func (*ObservatoryStore) DeleteTask

func (s *ObservatoryStore) DeleteTask(ctx context.Context, id string) error

func (*ObservatoryStore) DeleteWorkspace

func (s *ObservatoryStore) DeleteWorkspace(ctx context.Context, id string) error

func (*ObservatoryStore) FindLatestUnfinishedTool

func (s *ObservatoryStore) FindLatestUnfinishedTool(ctx context.Context, sessionID, toolName string) (string, error)

func (*ObservatoryStore) GetAgentAssignment

func (s *ObservatoryStore) GetAgentAssignment(ctx context.Context, id string) (*obs.AgentAssignment, error)

func (*ObservatoryStore) GetAgentStats

func (s *ObservatoryStore) GetAgentStats(ctx context.Context, agentID string) (*obs.AgentStats, error)

func (*ObservatoryStore) GetChain

func (*ObservatoryStore) GetChainByGitHubIssue

func (s *ObservatoryStore) GetChainByGitHubIssue(ctx context.Context, repo string, issueNumber int) (*obs.ExecutionChain, error)

func (*ObservatoryStore) GetChainByMessageID

func (s *ObservatoryStore) GetChainByMessageID(ctx context.Context, messageID string) (*obs.ExecutionChain, error)

func (*ObservatoryStore) GetChainByTaskID

func (s *ObservatoryStore) GetChainByTaskID(ctx context.Context, taskID string) (*obs.ExecutionChain, error)

func (*ObservatoryStore) GetChainStages

func (s *ObservatoryStore) GetChainStages(ctx context.Context, chainID string, opts obs.ChainReadOptions) ([]*obs.ChainStage, error)

func (*ObservatoryStore) GetChainStats

func (s *ObservatoryStore) GetChainStats(ctx context.Context) (*obs.ChainStats, error)

func (*ObservatoryStore) GetChainStatsByAgent

func (s *ObservatoryStore) GetChainStatsByAgent(ctx context.Context, createdAfter *time.Time) ([]*obs.AgentStatsResult, error)

func (*ObservatoryStore) GetChainStatusCounts

func (s *ObservatoryStore) GetChainStatusCounts(ctx context.Context, createdAfter *time.Time) (*obs.ChainStatusCounts, error)

func (*ObservatoryStore) GetChatMessagesBySession

func (s *ObservatoryStore) GetChatMessagesBySession(ctx context.Context, sessionID string, startTime, endTime time.Time) ([]*obs.ChatMessage, error)

func (*ObservatoryStore) GetChatMessagesByTaskID

func (s *ObservatoryStore) GetChatMessagesByTaskID(ctx context.Context, taskID string) ([]*obs.ChatMessage, error)

func (*ObservatoryStore) GetExecTaskHierarchy

func (s *ObservatoryStore) GetExecTaskHierarchy(ctx context.Context, limit int) ([]*obs.ExecTaskNode, error)

func (*ObservatoryStore) GetExecTaskHierarchyWithMessages

func (s *ObservatoryStore) GetExecTaskHierarchyWithMessages(ctx context.Context, limit int) (*obs.ExecHierarchyWithMessages, error)

func (*ObservatoryStore) GetMessage

func (s *ObservatoryStore) GetMessage(ctx context.Context, id string) (*obs.Message, error)

func (*ObservatoryStore) GetMetricsSummary

func (s *ObservatoryStore) GetMetricsSummary(ctx context.Context) (*obs.MetricsSummary, error)

func (*ObservatoryStore) GetProviderComparison

func (s *ObservatoryStore) GetProviderComparison(ctx context.Context) ([]*obs.ProviderComparison, error)

func (*ObservatoryStore) GetSession

func (s *ObservatoryStore) GetSession(ctx context.Context, sessionID string) (*obs.Session, error)

func (*ObservatoryStore) GetSessionMetricsSummary

func (s *ObservatoryStore) GetSessionMetricsSummary(ctx context.Context, sessionID string) (*obs.SessionMetricsSummary, error)

func (*ObservatoryStore) GetSessionTools

func (s *ObservatoryStore) GetSessionTools(ctx context.Context, sessionID string) ([]obs.SessionTool, error)

func (*ObservatoryStore) GetSessionWorkspace

func (s *ObservatoryStore) GetSessionWorkspace(sessionID string) (string, error)

func (*ObservatoryStore) GetSpan

func (s *ObservatoryStore) GetSpan(ctx context.Context, id string) (*obs.Span, error)

func (*ObservatoryStore) GetSpanEvents

func (s *ObservatoryStore) GetSpanEvents(ctx context.Context, spanID string) ([]obs.SpanEvent, error)

func (*ObservatoryStore) GetSpanHierarchy

func (s *ObservatoryStore) GetSpanHierarchy(ctx context.Context, limit int) (*obs.SpanHierarchyResult, error)

func (*ObservatoryStore) GetSpanLitesByStageID

func (s *ObservatoryStore) GetSpanLitesByStageID(ctx context.Context, stageID string, limit, offset int) (*obs.SpanLitePage, error)

func (*ObservatoryStore) GetSpansByStageID

func (s *ObservatoryStore) GetSpansByStageID(ctx context.Context, stageID string) ([]*obs.Span, error)

func (*ObservatoryStore) GetStage

func (s *ObservatoryStore) GetStage(ctx context.Context, id string) (*obs.ChainStage, error)

func (*ObservatoryStore) GetTask

func (s *ObservatoryStore) GetTask(ctx context.Context, id string) (*obs.Task, error)

func (*ObservatoryStore) GetTaskTimeline

func (s *ObservatoryStore) GetTaskTimeline(ctx context.Context, taskID string) ([]*obs.TaskTimeline, error)

func (*ObservatoryStore) GetToolForSpan

func (s *ObservatoryStore) GetToolForSpan(ctx context.Context, sessionID, toolName string, spanTime time.Time) (*obs.SessionTool, error)

func (*ObservatoryStore) GetToolsByTimestampRange

func (s *ObservatoryStore) GetToolsByTimestampRange(ctx context.Context, start, end time.Time, toolName string) ([]obs.SessionTool, error)

func (*ObservatoryStore) GetTrace

func (s *ObservatoryStore) GetTrace(ctx context.Context, traceID string) (*obs.Trace, error)

func (*ObservatoryStore) GetWorkspace

func (s *ObservatoryStore) GetWorkspace(ctx context.Context, id string) (*obs.Workspace, error)

func (*ObservatoryStore) GetWorkspaceStats

func (s *ObservatoryStore) GetWorkspaceStats(ctx context.Context, id string) (*obs.WorkspaceStats, error)

func (*ObservatoryStore) InsertToolStart

func (s *ObservatoryStore) InsertToolStart(ctx context.Context, sessionID, toolUseID, toolName, toolInput string) error

func (*ObservatoryStore) LinkOrphanedSpansBySession

func (s *ObservatoryStore) LinkOrphanedSpansBySession(ctx context.Context, sessionID, taskID, assignmentID string) (int64, error)

func (*ObservatoryStore) LinkSpanToChain

func (s *ObservatoryStore) LinkSpanToChain(ctx context.Context, spanID, chainID, stageID string) error

func (*ObservatoryStore) ListAgentAssignments

func (s *ObservatoryStore) ListAgentAssignments(ctx context.Context, taskID string) ([]*obs.AgentAssignment, error)

func (*ObservatoryStore) ListChains

func (s *ObservatoryStore) ListChains(ctx context.Context, opts obs.ChainListOptions) ([]*obs.ChainSummary, error)

func (*ObservatoryStore) ListMessages

func (s *ObservatoryStore) ListMessages(ctx context.Context, opts obs.MessageListOptions) ([]*obs.Message, error)

func (*ObservatoryStore) ListMetrics

func (s *ObservatoryStore) ListMetrics(ctx context.Context, opts obs.MetricListOptions) ([]*obs.Metric, error)

func (*ObservatoryStore) ListPendingApprovals

func (s *ObservatoryStore) ListPendingApprovals(ctx context.Context, limit int) ([]*obs.PendingApprovalInfo, error)

func (*ObservatoryStore) ListSpans

func (s *ObservatoryStore) ListSpans(ctx context.Context, opts obs.SpanListOptions) ([]*obs.Span, error)

func (*ObservatoryStore) ListTasks

func (s *ObservatoryStore) ListTasks(ctx context.Context, opts obs.TaskListOptions) ([]*obs.Task, error)

func (*ObservatoryStore) ListTraces

func (s *ObservatoryStore) ListTraces(ctx context.Context, opts obs.TraceQuery) ([]*obs.TraceSummary, error)

func (*ObservatoryStore) ListWorkspaces

func (s *ObservatoryStore) ListWorkspaces(ctx context.Context) ([]*obs.Workspace, error)

func (*ObservatoryStore) LookupTaskBySessionID

func (s *ObservatoryStore) LookupTaskBySessionID(ctx context.Context, sessionID string) (taskID, assignmentID, traceID string)

func (*ObservatoryStore) MarkMessageArchived

func (s *ObservatoryStore) MarkMessageArchived(ctx context.Context, id string) error

func (*ObservatoryStore) MarkMessageRead

func (s *ObservatoryStore) MarkMessageRead(ctx context.Context, id string) error

func (*ObservatoryStore) RecalculateTaskAggregates

func (s *ObservatoryStore) RecalculateTaskAggregates(ctx context.Context, taskID string) error

func (*ObservatoryStore) UpdateAgentAssignment

func (s *ObservatoryStore) UpdateAgentAssignment(ctx context.Context, a *obs.AgentAssignment) error

func (*ObservatoryStore) UpdateChainMetrics

func (s *ObservatoryStore) UpdateChainMetrics(ctx context.Context, id string, cost float64, tokens, turns int) error

func (*ObservatoryStore) UpdateChainStatus

func (s *ObservatoryStore) UpdateChainStatus(ctx context.Context, chainID string, chainStatus obs.ChainStatus) error

func (*ObservatoryStore) UpdateMessage

func (s *ObservatoryStore) UpdateMessage(ctx context.Context, m *obs.Message) error

func (*ObservatoryStore) UpdateSessionEnded

func (s *ObservatoryStore) UpdateSessionEnded(ctx context.Context, sessionID string) error

func (*ObservatoryStore) UpdateSpan

func (s *ObservatoryStore) UpdateSpan(ctx context.Context, span *obs.Span) error
func (s *ObservatoryStore) UpdateSpanLinks(ctx context.Context, spanID, taskID, assignmentID string) error

func (*ObservatoryStore) UpdateStageApproval

func (s *ObservatoryStore) UpdateStageApproval(ctx context.Context, stageID string, approvalStatus obs.ApprovalStatus, approvalType obs.ApprovalType, feedback string) error

func (*ObservatoryStore) UpdateStageError

func (s *ObservatoryStore) UpdateStageError(ctx context.Context, stageID, errorMessage string) error

func (*ObservatoryStore) UpdateStageMetrics

func (s *ObservatoryStore) UpdateStageMetrics(ctx context.Context, stageID string, cost float64, tokensIn, tokensOut, turns, toolCalls int, durationMs int64) error

func (*ObservatoryStore) UpdateStageSession

func (s *ObservatoryStore) UpdateStageSession(ctx context.Context, stageID, sessionID string) error

func (*ObservatoryStore) UpdateStageStatus

func (s *ObservatoryStore) UpdateStageStatus(ctx context.Context, stageID string, stageStatus obs.ChainStageStatus) error

func (*ObservatoryStore) UpdateTask

func (s *ObservatoryStore) UpdateTask(ctx context.Context, t *obs.Task) error

func (*ObservatoryStore) UpdateToolEnd

func (s *ObservatoryStore) UpdateToolEnd(ctx context.Context, toolUseID, toolResponse string, success bool) error

func (*ObservatoryStore) UpdateWorkspace

func (s *ObservatoryStore) UpdateWorkspace(ctx context.Context, w *obs.Workspace) error

func (*ObservatoryStore) UpsertSession

func (s *ObservatoryStore) UpsertSession(ctx context.Context, sessionID, workspace, version, source string) error

func (*ObservatoryStore) UpsertSessionWithCorrelation

func (s *ObservatoryStore) UpsertSessionWithCorrelation(ctx context.Context, sessionID, workspace, version, source string, corr *obs.SessionCorrelation) error

func (*ObservatoryStore) WithSpanTTL

func (s *ObservatoryStore) WithSpanTTL(d time.Duration) *ObservatoryStore

WithSpanTTL sets the TTL for observatory span documents.

Jump to

Keyboard shortcuts

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