Documentation
¶
Index ¶
- type AdvanceBackfillCursorParams
- type AgentEvent
- type AgentSession
- type AgentSource
- type Checkpoint
- type CheckpointStat
- type CommitLink
- type CompleteBackfillParams
- type CompleteCheckpointParams
- type DBTX
- type FailCheckpointParams
- type GetAgentSessionByProviderIDParams
- type GetCheckpointSummaryRow
- type GetLatestCommitLinkRow
- type GetManifestCommitLinkParams
- type GetManifestCommitLinkRow
- type GetNextToolResultAfterParams
- type GetNextToolResultAfterRow
- type GetPreviousCommitLinkedCheckpointParams
- type GetPreviousCompletedCheckpointParams
- type GetPromptEventForTurnParams
- type GetPromptEventForTurnRow
- type GetSessionWithStatsRow
- type InsertAgentEventParams
- type InsertCheckpointParams
- type InsertCommitLinkParams
- type InsertRepositoryParams
- type InsertSessionCheckpointParams
- type ListAgentEventsBySessionPagedParams
- type ListAgentEventsBySessionParams
- type ListAgentSessionsByProviderSessionIDParams
- type ListBackfillReplayCandidatesParams
- type ListBackfillReplayCandidatesRow
- type ListCheckpointsByRepositoryParams
- type ListCheckpointsWithCommitParams
- type ListCheckpointsWithCommitRow
- type ListCommitLinksByRepositoryParams
- type ListCrossRepoSessionsParams
- type ListEventsBySessionASCRow
- type ListEventsInWindowParams
- type ListEventsInWindowRow
- type ListPackagedManifestsParams
- type ListPendingManifestsParams
- type ListRecentAIPercentagesParams
- type ListRecentAIPercentagesRow
- type ListRecentSessionsWithStatsParams
- type ListRecentSessionsWithStatsRow
- type ListSessionsForRepositoryParams
- type ListSessionsWithEventsInWindowParams
- type ListSessionsWithStatsAllParams
- type ListSessionsWithStatsAllRow
- type ListSessionsWithStatsParams
- type ListSessionsWithStatsRow
- type ListStalePendingCheckpointsParams
- type ListStalePendingCheckpointsRow
- type ListStepCompanionResultsParams
- type ListStepCompanionResultsRow
- type ListStepEventsForTurnParams
- type ListStepEventsForTurnRow
- type ListStepProvenanceForTurnParams
- type ListStepProvenanceForTurnRow
- type ListTranscriptEventsParams
- type ListTranscriptEventsRow
- type MarkManifestFailedParams
- type MarkManifestUploadedParams
- type MarkManifestUploadingParams
- type ProvenanceManifest
- type Queries
- func (q *Queries) AdvanceBackfillCursor(ctx context.Context, arg AdvanceBackfillCursorParams) error
- func (q *Queries) Close() error
- func (q *Queries) CompleteBackfill(ctx context.Context, arg CompleteBackfillParams) error
- func (q *Queries) CompleteCheckpoint(ctx context.Context, arg CompleteCheckpointParams) error
- func (q *Queries) CountCheckpointsWithSummary(ctx context.Context, repositoryID string) (int64, error)
- func (q *Queries) CountSessionsForCheckpoint(ctx context.Context, checkpointID string) (int64, error)
- func (q *Queries) DeleteCheckpointByID(ctx context.Context, checkpointID string) error
- func (q *Queries) FailCheckpoint(ctx context.Context, arg FailCheckpointParams) error
- func (q *Queries) GetActiveAgentSessionForRepo(ctx context.Context, repositoryID string) (AgentSession, error)
- func (q *Queries) GetAgentSessionByID(ctx context.Context, sessionID string) (AgentSession, error)
- func (q *Queries) GetAgentSessionByProviderID(ctx context.Context, arg GetAgentSessionByProviderIDParams) (AgentSession, error)
- func (q *Queries) GetAttributionBackfill(ctx context.Context, connectedRepoID string) (RemoteAttributionBackfill, error)
- func (q *Queries) GetCheckpointByID(ctx context.Context, checkpointID string) (Checkpoint, error)
- func (q *Queries) GetCheckpointStats(ctx context.Context, checkpointID string) (CheckpointStat, error)
- func (q *Queries) GetCheckpointSummary(ctx context.Context, checkpointID string) (GetCheckpointSummaryRow, error)
- func (q *Queries) GetCommitLinkByCommitHash(ctx context.Context, commitHash string) (CommitLink, error)
- func (q *Queries) GetCommitLinksByCheckpoint(ctx context.Context, checkpointID string) ([]CommitLink, error)
- func (q *Queries) GetLatestCheckpointForRepo(ctx context.Context, repositoryID string) (Checkpoint, error)
- func (q *Queries) GetLatestCommitLink(ctx context.Context, repositoryID string) (GetLatestCommitLinkRow, error)
- func (q *Queries) GetManifestCommitLink(ctx context.Context, arg GetManifestCommitLinkParams) (GetManifestCommitLinkRow, error)
- func (q *Queries) GetNextToolResultAfter(ctx context.Context, arg GetNextToolResultAfterParams) (GetNextToolResultAfterRow, error)
- func (q *Queries) GetPreviousCommitLinkedCheckpoint(ctx context.Context, arg GetPreviousCommitLinkedCheckpointParams) (Checkpoint, error)
- func (q *Queries) GetPreviousCompletedCheckpoint(ctx context.Context, arg GetPreviousCompletedCheckpointParams) (Checkpoint, error)
- func (q *Queries) GetPromptEventForTurn(ctx context.Context, arg GetPromptEventForTurnParams) (GetPromptEventForTurnRow, error)
- func (q *Queries) GetRepositoryByID(ctx context.Context, repositoryID string) (Repository, error)
- func (q *Queries) GetRepositoryByRootPath(ctx context.Context, rootPath string) (Repository, error)
- func (q *Queries) GetSessionWithStats(ctx context.Context, sessionID string) (GetSessionWithStatsRow, error)
- func (q *Queries) InsertAgentEvent(ctx context.Context, arg InsertAgentEventParams) error
- func (q *Queries) InsertCheckpoint(ctx context.Context, arg InsertCheckpointParams) error
- func (q *Queries) InsertCommitLink(ctx context.Context, arg InsertCommitLinkParams) error
- func (q *Queries) InsertRepository(ctx context.Context, arg InsertRepositoryParams) error
- func (q *Queries) InsertSessionCheckpoint(ctx context.Context, arg InsertSessionCheckpointParams) error
- func (q *Queries) ListAgentEventsBySession(ctx context.Context, arg ListAgentEventsBySessionParams) ([]AgentEvent, error)
- func (q *Queries) ListAgentEventsBySessionPaged(ctx context.Context, arg ListAgentEventsBySessionPagedParams) ([]AgentEvent, error)
- func (q *Queries) ListAgentSessionsByProviderSessionID(ctx context.Context, arg ListAgentSessionsByProviderSessionIDParams) ([]AgentSession, error)
- func (q *Queries) ListBackfillReplayCandidates(ctx context.Context, arg ListBackfillReplayCandidatesParams) ([]ListBackfillReplayCandidatesRow, error)
- func (q *Queries) ListCheckpointsByRepository(ctx context.Context, arg ListCheckpointsByRepositoryParams) ([]Checkpoint, error)
- func (q *Queries) ListCheckpointsWithCommit(ctx context.Context, arg ListCheckpointsWithCommitParams) ([]ListCheckpointsWithCommitRow, error)
- func (q *Queries) ListCommitLinksByRepository(ctx context.Context, arg ListCommitLinksByRepositoryParams) ([]CommitLink, error)
- func (q *Queries) ListCrossRepoSessions(ctx context.Context, arg ListCrossRepoSessionsParams) ([]AgentSession, error)
- func (q *Queries) ListDistinctProviders(ctx context.Context, repositoryID string) ([]string, error)
- func (q *Queries) ListEventsBySessionASC(ctx context.Context, sessionID string) ([]ListEventsBySessionASCRow, error)
- func (q *Queries) ListEventsInWindow(ctx context.Context, arg ListEventsInWindowParams) ([]ListEventsInWindowRow, error)
- func (q *Queries) ListPackagedManifests(ctx context.Context, arg ListPackagedManifestsParams) ([]ProvenanceManifest, error)
- func (q *Queries) ListPendingManifests(ctx context.Context, arg ListPendingManifestsParams) ([]ProvenanceManifest, error)
- func (q *Queries) ListProvidersByCheckpoint(ctx context.Context, checkpointID string) ([]string, error)
- func (q *Queries) ListRecentAIPercentages(ctx context.Context, arg ListRecentAIPercentagesParams) ([]ListRecentAIPercentagesRow, error)
- func (q *Queries) ListRecentSessionsWithStats(ctx context.Context, arg ListRecentSessionsWithStatsParams) ([]ListRecentSessionsWithStatsRow, error)
- func (q *Queries) ListRepositories(ctx context.Context) ([]Repository, error)
- func (q *Queries) ListSessionsForCheckpoint(ctx context.Context, checkpointID string) ([]AgentSession, error)
- func (q *Queries) ListSessionsForRepository(ctx context.Context, arg ListSessionsForRepositoryParams) ([]AgentSession, error)
- func (q *Queries) ListSessionsWithEventsInWindow(ctx context.Context, arg ListSessionsWithEventsInWindowParams) ([]string, error)
- func (q *Queries) ListSessionsWithStats(ctx context.Context, arg ListSessionsWithStatsParams) ([]ListSessionsWithStatsRow, error)
- func (q *Queries) ListSessionsWithStatsAll(ctx context.Context, arg ListSessionsWithStatsAllParams) ([]ListSessionsWithStatsAllRow, error)
- func (q *Queries) ListStalePendingCheckpoints(ctx context.Context, arg ListStalePendingCheckpointsParams) ([]ListStalePendingCheckpointsRow, error)
- func (q *Queries) ListStepCompanionResults(ctx context.Context, arg ListStepCompanionResultsParams) ([]ListStepCompanionResultsRow, error)
- func (q *Queries) ListStepEventsForTurn(ctx context.Context, arg ListStepEventsForTurnParams) ([]ListStepEventsForTurnRow, error)
- func (q *Queries) ListStepProvenanceForTurn(ctx context.Context, arg ListStepProvenanceForTurnParams) ([]ListStepProvenanceForTurnRow, error)
- func (q *Queries) ListTranscriptEvents(ctx context.Context, arg ListTranscriptEventsParams) ([]ListTranscriptEventsRow, error)
- func (q *Queries) MarkManifestFailed(ctx context.Context, arg MarkManifestFailedParams) error
- func (q *Queries) MarkManifestUploaded(ctx context.Context, arg MarkManifestUploadedParams) error
- func (q *Queries) MarkManifestUploading(ctx context.Context, arg MarkManifestUploadingParams) (int64, error)
- func (q *Queries) PromptEventExists(ctx context.Context, turnID sql.NullString) (bool, error)
- func (q *Queries) RecordBackfillFailure(ctx context.Context, arg RecordBackfillFailureParams) error
- func (q *Queries) RecoverStaleUploading(ctx context.Context, arg RecoverStaleUploadingParams) error
- func (q *Queries) ResetManifestForRetry(ctx context.Context, arg ResetManifestForRetryParams) error
- func (q *Queries) ResetManifestToPackaged(ctx context.Context, arg ResetManifestToPackagedParams) error
- func (q *Queries) ResolveCheckpointByPrefix(ctx context.Context, arg ResolveCheckpointByPrefixParams) ([]string, error)
- func (q *Queries) ResolveCommitLinkByPrefix(ctx context.Context, arg ResolveCommitLinkByPrefixParams) ([]string, error)
- func (q *Queries) ResolveSessionByPrefix(ctx context.Context, arg ResolveSessionByPrefixParams) ([]string, error)
- func (q *Queries) SaveCheckpointSummary(ctx context.Context, arg SaveCheckpointSummaryParams) error
- func (q *Queries) StepEventExists(ctx context.Context, arg StepEventExistsParams) (bool, error)
- func (q *Queries) UpdateCheckpointAIPercentage(ctx context.Context, arg UpdateCheckpointAIPercentageParams) error
- func (q *Queries) UpdateRepositoryEnabledAt(ctx context.Context, arg UpdateRepositoryEnabledAtParams) error
- func (q *Queries) UpsertAgentSession(ctx context.Context, arg UpsertAgentSessionParams) (AgentSession, error)
- func (q *Queries) UpsertAgentSource(ctx context.Context, arg UpsertAgentSourceParams) (AgentSource, error)
- func (q *Queries) UpsertAttributionBackfill(ctx context.Context, arg UpsertAttributionBackfillParams) error
- func (q *Queries) UpsertCheckpointStats(ctx context.Context, arg UpsertCheckpointStatsParams) error
- func (q *Queries) UpsertProvenanceManifest(ctx context.Context, arg UpsertProvenanceManifestParams) error
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type RecordBackfillFailureParams
- type RecoverStaleUploadingParams
- type RemoteAttributionBackfill
- type Repository
- type ResetManifestForRetryParams
- type ResetManifestToPackagedParams
- type ResolveCheckpointByPrefixParams
- type ResolveCommitLinkByPrefixParams
- type ResolveSessionByPrefixParams
- type SaveCheckpointSummaryParams
- type SessionCheckpoint
- type StepEventExistsParams
- type UpdateCheckpointAIPercentageParams
- type UpdateRepositoryEnabledAtParams
- type UpsertAgentSessionParams
- type UpsertAgentSourceParams
- type UpsertAttributionBackfillParams
- type UpsertCheckpointStatsParams
- type UpsertProvenanceManifestParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentEvent ¶
type AgentEvent struct {
EventID string `json:"event_id"`
SessionID string `json:"session_id"`
RepositoryID string `json:"repository_id"`
Ts int64 `json:"ts"`
Kind string `json:"kind"`
PayloadHash sql.NullString `json:"payload_hash"`
Role sql.NullString `json:"role"`
ToolUses sql.NullString `json:"tool_uses"`
TokensIn sql.NullInt64 `json:"tokens_in"`
TokensOut sql.NullInt64 `json:"tokens_out"`
TokensCacheRead sql.NullInt64 `json:"tokens_cache_read"`
TokensCacheCreate sql.NullInt64 `json:"tokens_cache_create"`
Summary sql.NullString `json:"summary"`
ProviderEventID sql.NullString `json:"provider_event_id"`
TurnID sql.NullString `json:"turn_id"`
ToolUseID sql.NullString `json:"tool_use_id"`
ToolName sql.NullString `json:"tool_name"`
EventSource string `json:"event_source"`
ProvenanceHash sql.NullString `json:"provenance_hash"`
}
type AgentSession ¶
type AgentSession struct {
SessionID string `json:"session_id"`
ProviderSessionID string `json:"provider_session_id"`
ParentSessionID sql.NullString `json:"parent_session_id"`
RepositoryID string `json:"repository_id"`
Provider string `json:"provider"`
SourceID string `json:"source_id"`
StartedAt int64 `json:"started_at"`
LastSeenAt int64 `json:"last_seen_at"`
MetadataJson string `json:"metadata_json"`
SourceRepoPath sql.NullString `json:"source_repo_path"`
Model sql.NullString `json:"model"`
}
type AgentSource ¶
type Checkpoint ¶
type Checkpoint struct {
CheckpointID string `json:"checkpoint_id"`
RepositoryID string `json:"repository_id"`
CreatedAt int64 `json:"created_at"`
Kind string `json:"kind"`
Trigger sql.NullString `json:"trigger"`
Message sql.NullString `json:"message"`
ManifestHash sql.NullString `json:"manifest_hash"`
SizeBytes sql.NullInt64 `json:"size_bytes"`
Status string `json:"status"`
CompletedAt sql.NullInt64 `json:"completed_at"`
SummaryJson sql.NullString `json:"summary_json"`
SummaryModel sql.NullString `json:"summary_model"`
}
type CheckpointStat ¶
type CommitLink ¶
type CompleteBackfillParams ¶
type FailCheckpointParams ¶
type GetCheckpointSummaryRow ¶
type GetCheckpointSummaryRow struct {
CheckpointID string `json:"checkpoint_id"`
SummaryJson sql.NullString `json:"summary_json"`
SummaryModel sql.NullString `json:"summary_model"`
}
type GetLatestCommitLinkRow ¶
type GetNextToolResultAfterParams ¶
type GetNextToolResultAfterParams struct {
SessionID string `json:"session_id"`
TurnID sql.NullString `json:"turn_id"`
Ts int64 `json:"ts"`
}
type GetNextToolResultAfterRow ¶
type GetNextToolResultAfterRow struct {
EventID string `json:"event_id"`
PayloadHash sql.NullString `json:"payload_hash"`
Summary sql.NullString `json:"summary"`
Role sql.NullString `json:"role"`
Kind string `json:"kind"`
Ts int64 `json:"ts"`
}
type GetPromptEventForTurnParams ¶
type GetPromptEventForTurnParams struct {
SessionID string `json:"session_id"`
TurnID sql.NullString `json:"turn_id"`
}
type GetPromptEventForTurnRow ¶
type GetPromptEventForTurnRow struct {
EventID string `json:"event_id"`
PayloadHash sql.NullString `json:"payload_hash"`
}
type GetSessionWithStatsRow ¶
type GetSessionWithStatsRow struct {
SessionID string `json:"session_id"`
ProviderSessionID string `json:"provider_session_id"`
ParentSessionID sql.NullString `json:"parent_session_id"`
Provider string `json:"provider"`
StartedAt int64 `json:"started_at"`
LastEventTs int64 `json:"last_event_ts"`
StepCount int64 `json:"step_count"`
ToolCallCount int64 `json:"tool_call_count"`
TokensIn int64 `json:"tokens_in"`
TokensOut int64 `json:"tokens_out"`
TokensCached int64 `json:"tokens_cached"`
}
type InsertAgentEventParams ¶
type InsertAgentEventParams struct {
EventID string `json:"event_id"`
SessionID string `json:"session_id"`
RepositoryID string `json:"repository_id"`
Ts int64 `json:"ts"`
Kind string `json:"kind"`
PayloadHash sql.NullString `json:"payload_hash"`
Role sql.NullString `json:"role"`
ToolUses sql.NullString `json:"tool_uses"`
TokensIn sql.NullInt64 `json:"tokens_in"`
TokensOut sql.NullInt64 `json:"tokens_out"`
TokensCacheRead sql.NullInt64 `json:"tokens_cache_read"`
TokensCacheCreate sql.NullInt64 `json:"tokens_cache_create"`
Summary sql.NullString `json:"summary"`
ProviderEventID sql.NullString `json:"provider_event_id"`
TurnID sql.NullString `json:"turn_id"`
ToolUseID sql.NullString `json:"tool_use_id"`
ToolName sql.NullString `json:"tool_name"`
EventSource string `json:"event_source"`
ProvenanceHash sql.NullString `json:"provenance_hash"`
}
type InsertCheckpointParams ¶
type InsertCheckpointParams struct {
CheckpointID string `json:"checkpoint_id"`
RepositoryID string `json:"repository_id"`
CreatedAt int64 `json:"created_at"`
Kind string `json:"kind"`
Trigger sql.NullString `json:"trigger"`
Message sql.NullString `json:"message"`
ManifestHash sql.NullString `json:"manifest_hash"`
SizeBytes sql.NullInt64 `json:"size_bytes"`
Status string `json:"status"`
CompletedAt sql.NullInt64 `json:"completed_at"`
}
type InsertCommitLinkParams ¶
type InsertRepositoryParams ¶
type ListAgentEventsBySessionPagedParams ¶ added in v0.2.0
type ListAgentSessionsByProviderSessionIDParams ¶ added in v0.2.0
type ListBackfillReplayCandidatesParams ¶
type ListBackfillReplayCandidatesParams struct {
RepositoryID string `json:"repository_id"`
CursorLinkedAt int64 `json:"cursor_linked_at"`
CursorCommitHash string `json:"cursor_commit_hash"`
CutoffLinkedAt int64 `json:"cutoff_linked_at"`
CutoffCommitHash string `json:"cutoff_commit_hash"`
BatchLimit int64 `json:"batch_limit"`
}
type ListCheckpointsWithCommitRow ¶
type ListCheckpointsWithCommitRow struct {
CheckpointID string `json:"checkpoint_id"`
CreatedAt int64 `json:"created_at"`
Kind string `json:"kind"`
Trigger sql.NullString `json:"trigger"`
Message sql.NullString `json:"message"`
SizeBytes sql.NullInt64 `json:"size_bytes"`
Status string `json:"status"`
CompletedAt sql.NullInt64 `json:"completed_at"`
CommitHash sql.NullString `json:"commit_hash"`
ManifestHash sql.NullString `json:"manifest_hash"`
}
type ListEventsBySessionASCRow ¶
type ListEventsBySessionASCRow struct {
EventID string `json:"event_id"`
SessionID string `json:"session_id"`
RepositoryID string `json:"repository_id"`
Ts int64 `json:"ts"`
Kind string `json:"kind"`
PayloadHash sql.NullString `json:"payload_hash"`
Role sql.NullString `json:"role"`
ToolUses sql.NullString `json:"tool_uses"`
TokensIn sql.NullInt64 `json:"tokens_in"`
TokensOut sql.NullInt64 `json:"tokens_out"`
TokensCacheRead sql.NullInt64 `json:"tokens_cache_read"`
TokensCacheCreate sql.NullInt64 `json:"tokens_cache_create"`
Summary sql.NullString `json:"summary"`
ProviderEventID sql.NullString `json:"provider_event_id"`
TurnID sql.NullString `json:"turn_id"`
ToolUseID sql.NullString `json:"tool_use_id"`
ToolName sql.NullString `json:"tool_name"`
EventSource string `json:"event_source"`
ProvenanceHash sql.NullString `json:"provenance_hash"`
Provider string `json:"provider"`
}
type ListEventsInWindowRow ¶
type ListEventsInWindowRow struct {
EventID string `json:"event_id"`
SessionID string `json:"session_id"`
Provider string `json:"provider"`
Model sql.NullString `json:"model"`
Ts int64 `json:"ts"`
Kind string `json:"kind"`
Role sql.NullString `json:"role"`
ToolUses sql.NullString `json:"tool_uses"`
TokensIn sql.NullInt64 `json:"tokens_in"`
TokensOut sql.NullInt64 `json:"tokens_out"`
TokensCacheRead sql.NullInt64 `json:"tokens_cache_read"`
TokensCacheCreate sql.NullInt64 `json:"tokens_cache_create"`
Summary sql.NullString `json:"summary"`
ProviderEventID sql.NullString `json:"provider_event_id"`
PayloadHash sql.NullString `json:"payload_hash"`
}
type ListRecentSessionsWithStatsRow ¶
type ListRecentSessionsWithStatsRow struct {
SessionID string `json:"session_id"`
ProviderSessionID string `json:"provider_session_id"`
ParentSessionID sql.NullString `json:"parent_session_id"`
Provider string `json:"provider"`
StartedAt int64 `json:"started_at"`
LastEventTs int64 `json:"last_event_ts"`
StepCount int64 `json:"step_count"`
TokensIn int64 `json:"tokens_in"`
TokensOut int64 `json:"tokens_out"`
TokensCached int64 `json:"tokens_cached"`
}
type ListSessionsWithStatsAllRow ¶
type ListSessionsWithStatsAllRow struct {
SessionID string `json:"session_id"`
ProviderSessionID string `json:"provider_session_id"`
ParentSessionID sql.NullString `json:"parent_session_id"`
Provider string `json:"provider"`
StartedAt int64 `json:"started_at"`
LastEventTs int64 `json:"last_event_ts"`
StepCount int64 `json:"step_count"`
ToolCallCount int64 `json:"tool_call_count"`
TokensIn int64 `json:"tokens_in"`
TokensOut int64 `json:"tokens_out"`
TokensCached int64 `json:"tokens_cached"`
}
type ListSessionsWithStatsRow ¶
type ListSessionsWithStatsRow struct {
SessionID string `json:"session_id"`
ProviderSessionID string `json:"provider_session_id"`
ParentSessionID sql.NullString `json:"parent_session_id"`
Provider string `json:"provider"`
StartedAt int64 `json:"started_at"`
LastEventTs int64 `json:"last_event_ts"`
StepCount int64 `json:"step_count"`
ToolCallCount int64 `json:"tool_call_count"`
TokensIn int64 `json:"tokens_in"`
TokensOut int64 `json:"tokens_out"`
TokensCached int64 `json:"tokens_cached"`
}
type ListStepCompanionResultsParams ¶
type ListStepCompanionResultsParams struct {
SessionID string `json:"session_id"`
TurnID sql.NullString `json:"turn_id"`
ToolUseID sql.NullString `json:"tool_use_id"`
}
type ListStepCompanionResultsRow ¶
type ListStepCompanionResultsRow struct {
EventID string `json:"event_id"`
PayloadHash sql.NullString `json:"payload_hash"`
Summary sql.NullString `json:"summary"`
Role sql.NullString `json:"role"`
Kind string `json:"kind"`
Ts int64 `json:"ts"`
}
type ListStepEventsForTurnParams ¶
type ListStepEventsForTurnParams struct {
SessionID string `json:"session_id"`
TurnID sql.NullString `json:"turn_id"`
}
type ListStepEventsForTurnRow ¶
type ListStepEventsForTurnRow struct {
EventID string `json:"event_id"`
Ts int64 `json:"ts"`
ToolName sql.NullString `json:"tool_name"`
ToolUseID sql.NullString `json:"tool_use_id"`
ProvenanceHash sql.NullString `json:"provenance_hash"`
PayloadHash sql.NullString `json:"payload_hash"`
Summary sql.NullString `json:"summary"`
EventSource string `json:"event_source"`
ToolUses sql.NullString `json:"tool_uses"`
}
type ListStepProvenanceForTurnParams ¶
type ListStepProvenanceForTurnParams struct {
SessionID string `json:"session_id"`
TurnID sql.NullString `json:"turn_id"`
}
type ListStepProvenanceForTurnRow ¶
type ListStepProvenanceForTurnRow struct {
EventID string `json:"event_id"`
ToolUseID sql.NullString `json:"tool_use_id"`
ToolName sql.NullString `json:"tool_name"`
ProvenanceHash sql.NullString `json:"provenance_hash"`
}
type ListTranscriptEventsRow ¶
type ListTranscriptEventsRow struct {
EventID string `json:"event_id"`
SessionID string `json:"session_id"`
Provider string `json:"provider"`
Ts int64 `json:"ts"`
Kind string `json:"kind"`
Role sql.NullString `json:"role"`
ToolUses sql.NullString `json:"tool_uses"`
TokensIn sql.NullInt64 `json:"tokens_in"`
TokensOut sql.NullInt64 `json:"tokens_out"`
TokensCacheRead sql.NullInt64 `json:"tokens_cache_read"`
TokensCacheCreate sql.NullInt64 `json:"tokens_cache_create"`
Summary sql.NullString `json:"summary"`
ProviderEventID sql.NullString `json:"provider_event_id"`
PayloadHash sql.NullString `json:"payload_hash"`
}
type MarkManifestFailedParams ¶
type MarkManifestFailedParams struct {
LastError sql.NullString `json:"last_error"`
UpdatedAt int64 `json:"updated_at"`
ManifestID string `json:"manifest_id"`
}
type ProvenanceManifest ¶
type ProvenanceManifest struct {
ManifestID string `json:"manifest_id"`
RepositoryID string `json:"repository_id"`
SessionID string `json:"session_id"`
TurnID string `json:"turn_id"`
Provider string `json:"provider"`
Kind string `json:"kind"`
TranscriptRef sql.NullString `json:"transcript_ref"`
ProvenanceBundleHash sql.NullString `json:"provenance_bundle_hash"`
StartedAt int64 `json:"started_at"`
CompletedAt sql.NullInt64 `json:"completed_at"`
Status string `json:"status"`
UploadAttempts int64 `json:"upload_attempts"`
LastError sql.NullString `json:"last_error"`
UploadTransformVersion sql.NullInt64 `json:"upload_transform_version"`
RemoteVerifiedAt sql.NullInt64 `json:"remote_verified_at"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) AdvanceBackfillCursor ¶
func (q *Queries) AdvanceBackfillCursor(ctx context.Context, arg AdvanceBackfillCursorParams) error
Advances the cursor past a successfully pushed or skipped commit. Also clears any failure state since the head-of-line commit moved.
func (*Queries) CompleteBackfill ¶
func (q *Queries) CompleteBackfill(ctx context.Context, arg CompleteBackfillParams) error
func (*Queries) CompleteCheckpoint ¶
func (q *Queries) CompleteCheckpoint(ctx context.Context, arg CompleteCheckpointParams) error
func (*Queries) CountCheckpointsWithSummary ¶
func (*Queries) CountSessionsForCheckpoint ¶
func (*Queries) DeleteCheckpointByID ¶
func (*Queries) FailCheckpoint ¶
func (q *Queries) FailCheckpoint(ctx context.Context, arg FailCheckpointParams) error
func (*Queries) GetActiveAgentSessionForRepo ¶
func (*Queries) GetAgentSessionByID ¶
func (*Queries) GetAgentSessionByProviderID ¶
func (q *Queries) GetAgentSessionByProviderID(ctx context.Context, arg GetAgentSessionByProviderIDParams) (AgentSession, error)
func (*Queries) GetAttributionBackfill ¶
func (*Queries) GetCheckpointByID ¶
func (*Queries) GetCheckpointStats ¶
func (*Queries) GetCheckpointSummary ¶
func (*Queries) GetCommitLinkByCommitHash ¶
func (*Queries) GetCommitLinksByCheckpoint ¶
func (*Queries) GetLatestCheckpointForRepo ¶
func (*Queries) GetLatestCommitLink ¶
func (q *Queries) GetLatestCommitLink(ctx context.Context, repositoryID string) (GetLatestCommitLinkRow, error)
Returns the most recent commit link for a repository. Used to snapshot the backfill cutoff at connect time.
func (*Queries) GetManifestCommitLink ¶
func (q *Queries) GetManifestCommitLink(ctx context.Context, arg GetManifestCommitLinkParams) (GetManifestCommitLinkRow, error)
Resolves the commit link for the checkpoint that covers a manifest. First finds the earliest checkpoint in the session created at or after the manifest's start time (the covering checkpoint), then joins to commit_links. Returns no rows if the covering checkpoint has no commit.
func (*Queries) GetNextToolResultAfter ¶
func (q *Queries) GetNextToolResultAfter(ctx context.Context, arg GetNextToolResultAfterParams) (GetNextToolResultAfterRow, error)
Temporal fallback for companion matching when tool_use_id is empty. Returns the first tool_result in the same turn after the given timestamp. Used by Claude transcript enrichment where tool_result rows lack tool_use_id.
func (*Queries) GetPreviousCommitLinkedCheckpoint ¶
func (q *Queries) GetPreviousCommitLinkedCheckpoint(ctx context.Context, arg GetPreviousCommitLinkedCheckpointParams) (Checkpoint, error)
Returns the most recent completed checkpoint before the given timestamp that has an associated commit link. Used by attribution to anchor the delta window to the previous commit rather than an intermediate manual or baseline checkpoint.
func (*Queries) GetPreviousCompletedCheckpoint ¶
func (q *Queries) GetPreviousCompletedCheckpoint(ctx context.Context, arg GetPreviousCompletedCheckpointParams) (Checkpoint, error)
func (*Queries) GetPromptEventForTurn ¶
func (q *Queries) GetPromptEventForTurn(ctx context.Context, arg GetPromptEventForTurnParams) (GetPromptEventForTurnRow, error)
func (*Queries) GetRepositoryByID ¶
func (*Queries) GetRepositoryByRootPath ¶
func (*Queries) GetSessionWithStats ¶
func (q *Queries) GetSessionWithStats(ctx context.Context, sessionID string) (GetSessionWithStatsRow, error)
Single session with computed stats. Same columns as ListSessionsWithStats.
func (*Queries) InsertAgentEvent ¶
func (q *Queries) InsertAgentEvent(ctx context.Context, arg InsertAgentEventParams) error
func (*Queries) InsertCheckpoint ¶
func (q *Queries) InsertCheckpoint(ctx context.Context, arg InsertCheckpointParams) error
func (*Queries) InsertCommitLink ¶
func (q *Queries) InsertCommitLink(ctx context.Context, arg InsertCommitLinkParams) error
func (*Queries) InsertRepository ¶
func (q *Queries) InsertRepository(ctx context.Context, arg InsertRepositoryParams) error
func (*Queries) InsertSessionCheckpoint ¶
func (q *Queries) InsertSessionCheckpoint(ctx context.Context, arg InsertSessionCheckpointParams) error
func (*Queries) ListAgentEventsBySession ¶
func (q *Queries) ListAgentEventsBySession(ctx context.Context, arg ListAgentEventsBySessionParams) ([]AgentEvent, error)
func (*Queries) ListAgentEventsBySessionPaged ¶ added in v0.2.0
func (q *Queries) ListAgentEventsBySessionPaged(ctx context.Context, arg ListAgentEventsBySessionPagedParams) ([]AgentEvent, error)
Keyset pagination: returns the next page of events after the given cursor. Use after_ts=0, after_event_id=” for the first page. Order is ascending (chronological) for timeline construction.
func (*Queries) ListAgentSessionsByProviderSessionID ¶ added in v0.2.0
func (q *Queries) ListAgentSessionsByProviderSessionID(ctx context.Context, arg ListAgentSessionsByProviderSessionIDParams) ([]AgentSession, error)
Search by provider_session_id across all providers in a repo. Returns multiple rows if different providers reuse the same ID.
func (*Queries) ListBackfillReplayCandidates ¶
func (q *Queries) ListBackfillReplayCandidates(ctx context.Context, arg ListBackfillReplayCandidatesParams) ([]ListBackfillReplayCandidatesRow, error)
Returns the next batch of commit links eligible for replay, ordered oldest-first. Uses (linked_at, commit_hash) tuple comparison for deterministic cursor-based pagination.
func (*Queries) ListCheckpointsByRepository ¶
func (q *Queries) ListCheckpointsByRepository(ctx context.Context, arg ListCheckpointsByRepositoryParams) ([]Checkpoint, error)
func (*Queries) ListCheckpointsWithCommit ¶
func (q *Queries) ListCheckpointsWithCommit(ctx context.Context, arg ListCheckpointsWithCommitParams) ([]ListCheckpointsWithCommitRow, error)
func (*Queries) ListCommitLinksByRepository ¶
func (q *Queries) ListCommitLinksByRepository(ctx context.Context, arg ListCommitLinksByRepositoryParams) ([]CommitLink, error)
func (*Queries) ListCrossRepoSessions ¶
func (q *Queries) ListCrossRepoSessions(ctx context.Context, arg ListCrossRepoSessionsParams) ([]AgentSession, error)
func (*Queries) ListDistinctProviders ¶
func (*Queries) ListEventsBySessionASC ¶
func (*Queries) ListEventsInWindow ¶
func (q *Queries) ListEventsInWindow(ctx context.Context, arg ListEventsInWindowParams) ([]ListEventsInWindowRow, error)
Returns all events for a repository within a time window, without requiring session_checkpoints links. Used by attribution to query events directly by repository and time range.
func (*Queries) ListPackagedManifests ¶
func (q *Queries) ListPackagedManifests(ctx context.Context, arg ListPackagedManifestsParams) ([]ProvenanceManifest, error)
Returns manifests ready for upload, scoped to a watermark timestamp. Only packaged status with attempts below the retry cap. Pass 0 for watermark_ts to drain all.
func (*Queries) ListPendingManifests ¶
func (q *Queries) ListPendingManifests(ctx context.Context, arg ListPendingManifestsParams) ([]ProvenanceManifest, error)
func (*Queries) ListProvidersByCheckpoint ¶
func (*Queries) ListRecentAIPercentages ¶
func (q *Queries) ListRecentAIPercentages(ctx context.Context, arg ListRecentAIPercentagesParams) ([]ListRecentAIPercentagesRow, error)
func (*Queries) ListRecentSessionsWithStats ¶
func (q *Queries) ListRecentSessionsWithStats(ctx context.Context, arg ListRecentSessionsWithStatsParams) ([]ListRecentSessionsWithStatsRow, error)
Same token separation as ListSessionsWithStats (see comment above).
func (*Queries) ListRepositories ¶
func (q *Queries) ListRepositories(ctx context.Context) ([]Repository, error)
func (*Queries) ListSessionsForCheckpoint ¶
func (*Queries) ListSessionsForRepository ¶
func (q *Queries) ListSessionsForRepository(ctx context.Context, arg ListSessionsForRepositoryParams) ([]AgentSession, error)
func (*Queries) ListSessionsWithEventsInWindow ¶
func (q *Queries) ListSessionsWithEventsInWindow(ctx context.Context, arg ListSessionsWithEventsInWindowParams) ([]string, error)
Returns distinct session IDs that have at least one event in the given time window [after_ts, up_to_ts] for the specified repository.
func (*Queries) ListSessionsWithStats ¶
func (q *Queries) ListSessionsWithStats(ctx context.Context, arg ListSessionsWithStatsParams) ([]ListSessionsWithStatsRow, error)
tokens_in is the non-cached input token count reported by the provider. tokens_cached is cache_read + cache_create. Claude's API reports input_tokens as only the non-cached portion; with heavy prompt caching the cached portion can be >99% of actual context, so we report them separately for clarity.
func (*Queries) ListSessionsWithStatsAll ¶
func (q *Queries) ListSessionsWithStatsAll(ctx context.Context, arg ListSessionsWithStatsAllParams) ([]ListSessionsWithStatsAllRow, error)
Same as ListSessionsWithStats but includes sessions with zero events.
func (*Queries) ListStalePendingCheckpoints ¶
func (q *Queries) ListStalePendingCheckpoints(ctx context.Context, arg ListStalePendingCheckpointsParams) ([]ListStalePendingCheckpointsRow, error)
Returns pending checkpoints older than the given threshold that have no manifest and no commit link. Used by tidy to mark abandoned checkpoints as failed.
func (*Queries) ListStepCompanionResults ¶
func (q *Queries) ListStepCompanionResults(ctx context.Context, arg ListStepCompanionResultsParams) ([]ListStepCompanionResultsRow, error)
Returns tool_result events matching a step's tool_use_id, ordered by timestamp. Returned as :many so the provider enricher can choose the right pairing when multiple results exist (e.g., retried tool calls).
func (*Queries) ListStepEventsForTurn ¶
func (q *Queries) ListStepEventsForTurn(ctx context.Context, arg ListStepEventsForTurnParams) ([]ListStepEventsForTurnRow, error)
Returns step events for provenance bundle packaging. Includes both hook-captured and transcript-sourced events so providers without direct hook capture are covered.
func (*Queries) ListStepProvenanceForTurn ¶
func (q *Queries) ListStepProvenanceForTurn(ctx context.Context, arg ListStepProvenanceForTurnParams) ([]ListStepProvenanceForTurnRow, error)
Returns step provenance hashes for a turn, used to build the upload envelope.
func (*Queries) ListTranscriptEvents ¶
func (q *Queries) ListTranscriptEvents(ctx context.Context, arg ListTranscriptEventsParams) ([]ListTranscriptEventsRow, error)
func (*Queries) MarkManifestFailed ¶
func (q *Queries) MarkManifestFailed(ctx context.Context, arg MarkManifestFailedParams) error
func (*Queries) MarkManifestUploaded ¶
func (q *Queries) MarkManifestUploaded(ctx context.Context, arg MarkManifestUploadedParams) error
func (*Queries) MarkManifestUploading ¶
func (q *Queries) MarkManifestUploading(ctx context.Context, arg MarkManifestUploadingParams) (int64, error)
Guards on status='packaged' so concurrent sync workers cannot both claim the same manifest. Caller checks rows affected: 0 means already claimed.
func (*Queries) PromptEventExists ¶
func (*Queries) RecordBackfillFailure ¶
func (q *Queries) RecordBackfillFailure(ctx context.Context, arg RecordBackfillFailureParams) error
Records a retryable failure on the current head-of-line commit.
func (*Queries) RecoverStaleUploading ¶
func (q *Queries) RecoverStaleUploading(ctx context.Context, arg RecoverStaleUploadingParams) error
Resets manifests stuck in uploading after a crash. Threshold is a unix ms timestamp; rows with updated_at older than this are reset to packaged.
func (*Queries) ResetManifestForRetry ¶
func (q *Queries) ResetManifestForRetry(ctx context.Context, arg ResetManifestForRetryParams) error
Resets a failed or uploading manifest back to packaged for retry. Increments upload_attempts and records the error for diagnostics.
func (*Queries) ResetManifestToPackaged ¶
func (q *Queries) ResetManifestToPackaged(ctx context.Context, arg ResetManifestToPackagedParams) error
Resets a manifest back to packaged without incrementing upload_attempts. Used for auth failures where the manifest itself is healthy and should not burn a retry attempt.
func (*Queries) ResolveCheckpointByPrefix ¶
func (*Queries) ResolveCommitLinkByPrefix ¶
func (*Queries) ResolveSessionByPrefix ¶
func (*Queries) SaveCheckpointSummary ¶
func (q *Queries) SaveCheckpointSummary(ctx context.Context, arg SaveCheckpointSummaryParams) error
func (*Queries) StepEventExists ¶
func (*Queries) UpdateCheckpointAIPercentage ¶
func (q *Queries) UpdateCheckpointAIPercentage(ctx context.Context, arg UpdateCheckpointAIPercentageParams) error
func (*Queries) UpdateRepositoryEnabledAt ¶
func (q *Queries) UpdateRepositoryEnabledAt(ctx context.Context, arg UpdateRepositoryEnabledAtParams) error
func (*Queries) UpsertAgentSession ¶
func (q *Queries) UpsertAgentSession(ctx context.Context, arg UpsertAgentSessionParams) (AgentSession, error)
func (*Queries) UpsertAgentSource ¶
func (q *Queries) UpsertAgentSource(ctx context.Context, arg UpsertAgentSourceParams) (AgentSource, error)
func (*Queries) UpsertAttributionBackfill ¶
func (q *Queries) UpsertAttributionBackfill(ctx context.Context, arg UpsertAttributionBackfillParams) error
Initializes replay state for a connected repo binding. If the row already exists, extends the cutoff if the new cutoff is newer (never shrinks).
func (*Queries) UpsertCheckpointStats ¶
func (q *Queries) UpsertCheckpointStats(ctx context.Context, arg UpsertCheckpointStatsParams) error
func (*Queries) UpsertProvenanceManifest ¶
func (q *Queries) UpsertProvenanceManifest(ctx context.Context, arg UpsertProvenanceManifestParams) error
type RecordBackfillFailureParams ¶
type RecordBackfillFailureParams struct {
FailedCommitHash sql.NullString `json:"failed_commit_hash"`
LastError sql.NullString `json:"last_error"`
UpdatedAt int64 `json:"updated_at"`
ConnectedRepoID string `json:"connected_repo_id"`
}
type RemoteAttributionBackfill ¶
type RemoteAttributionBackfill struct {
ConnectedRepoID string `json:"connected_repo_id"`
RepositoryID string `json:"repository_id"`
CutoffLinkedAt int64 `json:"cutoff_linked_at"`
CutoffCommitHash string `json:"cutoff_commit_hash"`
CursorLinkedAt int64 `json:"cursor_linked_at"`
CursorCommitHash string `json:"cursor_commit_hash"`
Status string `json:"status"`
FailedCommitHash sql.NullString `json:"failed_commit_hash"`
RetryAttempts int64 `json:"retry_attempts"`
LastError sql.NullString `json:"last_error"`
UpdatedAt int64 `json:"updated_at"`
}
type Repository ¶
type ResetManifestForRetryParams ¶
type ResetManifestForRetryParams struct {
LastError sql.NullString `json:"last_error"`
UpdatedAt int64 `json:"updated_at"`
ManifestID string `json:"manifest_id"`
}
type SaveCheckpointSummaryParams ¶
type SaveCheckpointSummaryParams struct {
SummaryJson sql.NullString `json:"summary_json"`
SummaryModel sql.NullString `json:"summary_model"`
CheckpointID string `json:"checkpoint_id"`
}
type SessionCheckpoint ¶
type StepEventExistsParams ¶
type StepEventExistsParams struct {
TurnID sql.NullString `json:"turn_id"`
ToolUseID sql.NullString `json:"tool_use_id"`
ToolName sql.NullString `json:"tool_name"`
}
type UpsertAgentSessionParams ¶
type UpsertAgentSessionParams struct {
SessionID string `json:"session_id"`
ProviderSessionID string `json:"provider_session_id"`
ParentSessionID sql.NullString `json:"parent_session_id"`
RepositoryID string `json:"repository_id"`
Provider string `json:"provider"`
SourceID string `json:"source_id"`
StartedAt int64 `json:"started_at"`
LastSeenAt int64 `json:"last_seen_at"`
MetadataJson string `json:"metadata_json"`
SourceRepoPath sql.NullString `json:"source_repo_path"`
Model sql.NullString `json:"model"`
}
type UpsertAgentSourceParams ¶
type UpsertProvenanceManifestParams ¶
type UpsertProvenanceManifestParams struct {
ManifestID string `json:"manifest_id"`
RepositoryID string `json:"repository_id"`
SessionID string `json:"session_id"`
TurnID string `json:"turn_id"`
Provider string `json:"provider"`
Kind string `json:"kind"`
TranscriptRef sql.NullString `json:"transcript_ref"`
ProvenanceBundleHash sql.NullString `json:"provenance_bundle_hash"`
StartedAt int64 `json:"started_at"`
CompletedAt sql.NullInt64 `json:"completed_at"`
Status string `json:"status"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}