data

package
v0.1.44 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: Apache-2.0 Imports: 66 Imported by: 0

Documentation

Overview

Package data provides Datly-backed read/write persistence services.

It wraps generated components for conversations, messages, turns, runs, tool calls, payloads, and related pagination/patch/delete operations.

Index

Constants

This section is empty.

Variables

View Source
var ErrConversationActive = errors.New("conversation is still in progress")
View Source
var ErrConversationGraphReferenced = errors.New("conversation_graph_referenced: the conversation graph is referenced from outside the graph")
View Source
var ErrConversationGraphTooLarge = errors.New("conversation_graph_too_large: the conversation graph exceeds the deletion limit")
View Source
var ErrConversationNonTerminal = errors.New("conversation_graph_non_terminal: every non-empty conversation in the graph must be terminal")
View Source
var ErrConversationNotFound = errors.New("conversation not found")
View Source
var ErrConversationScheduleReferenced = errors.New("conversation_schedule_referenced: a user schedule references the conversation graph")
View Source
var ErrInvalidConversationMaintenanceRequest = errors.New("invalid conversation maintenance request")
View Source
var ErrInvalidMaintenanceLease = errors.New("invalid maintenance lease request")
View Source
var ErrMaintenanceLeaseLost = errors.New("maintenance lease is no longer owned by this worker")
View Source
var ErrPermissionDenied = errors.New("permission denied")
View Source
var ErrScheduleNotFound = errors.New("schedule not found")
View Source
var ErrScheduledRunNotFound = errors.New("scheduled run not found")

Functions

func NewDatly

func NewDatly(ctx context.Context) (*datly.Service, error)

NewDatly creates a singleton datly service with configured connector. It prefers AGENTLY_DB_DSN and falls back to AGENTLY_DB_PATH for SQLite.

func NewDatlyFromWorkspace

func NewDatlyFromWorkspace(ctx context.Context, root string) (*datly.Service, error)

NewDatlyFromWorkspace creates a datly service backed by file-based SQLite in the given workspace root directory ({root}/db/agently-core.db). Data persists across restarts.

func NewDatlyInMemory

func NewDatlyInMemory(ctx context.Context) (*datly.Service, error)

NewDatlyInMemory creates a non-singleton datly service backed by in-memory sqlite.

func NewDatlyServiceFromEnv

func NewDatlyServiceFromEnv(ctx context.Context) (*datly.Service, error)

NewDatlyServiceFromEnv is an alias kept for compatibility with existing patterns.

Types

type AssistantPreview added in v0.1.8

type AssistantPreview struct {
	Output             string
	Narration          string
	HasFinalResponse   bool
	OutputAt           time.Time
	NarrationAt        time.Time
	LastMessageAt      time.Time
	LastMessageKnown   bool
	ConversationID     string
	OutputMessageID    string
	NarrationMessageID string
}

func LatestAssistantPreview added in v0.1.8

func LatestAssistantPreview(ctx context.Context, svc Service, conversationID string) (*AssistantPreview, error)

func (*AssistantPreview) PreferredText added in v0.1.8

func (p *AssistantPreview) PreferredText() string

type ConversationMaintenanceCandidate added in v0.1.43

type ConversationMaintenanceCandidate struct {
	RootID          string
	ExpectedOwnerID string
	ActivityAt      time.Time
}

ConversationMaintenanceCandidate contains only metadata needed to evaluate a graph. In particular, the scan never reads conversation text or payloads.

type ConversationMaintenanceCandidateRequest added in v0.1.43

type ConversationMaintenanceCandidateRequest struct {
	Kind           ConversationMaintenanceKind
	InactiveBefore time.Time
	AfterActivity  time.Time
	AfterRootID    string
	Limit          int
}

ConversationMaintenanceCandidateRequest defines a bounded, keyset-paged maintenance scan. It is an internal maintenance contract and does not use a request principal or user impersonation.

type ConversationMaintenanceKind added in v0.1.43

type ConversationMaintenanceKind string

ConversationMaintenanceKind separates independently configurable cleanup policies. The operation verifies the kind again inside its transaction.

const (
	ConversationMaintenanceInteractive       ConversationMaintenanceKind = "interactive"
	ConversationMaintenanceScheduled         ConversationMaintenanceKind = "scheduled"
	ConversationMaintenanceScheduledFallback ConversationMaintenanceKind = "scheduled_fallback"
)

type ConversationMaintenanceMode added in v0.1.43

type ConversationMaintenanceMode string

ConversationMaintenanceMode is explicit so a caller cannot accidentally turn a dry run into a deletion by omitting a boolean option.

const (
	ConversationMaintenanceDryRun ConversationMaintenanceMode = "dry_run"
	ConversationMaintenanceDelete ConversationMaintenanceMode = "delete"
)

type ConversationMaintenanceReason added in v0.1.43

type ConversationMaintenanceReason string

ConversationMaintenanceReason is a stable classification for candidates that are intentionally skipped rather than failed by an infrastructure error.

const (
	ConversationMaintenanceEligible             ConversationMaintenanceReason = "eligible"
	ConversationMaintenanceDeleted              ConversationMaintenanceReason = "deleted"
	ConversationMaintenanceNotFound             ConversationMaintenanceReason = "not_found"
	ConversationMaintenanceNotRoot              ConversationMaintenanceReason = "not_root"
	ConversationMaintenanceOwnerMissing         ConversationMaintenanceReason = "owner_missing"
	ConversationMaintenanceOwnerMismatch        ConversationMaintenanceReason = "owner_mismatch"
	ConversationMaintenanceRelatedOwnerMismatch ConversationMaintenanceReason = "related_owner_mismatch"
	ConversationMaintenanceKindMismatch         ConversationMaintenanceReason = "kind_mismatch"
	ConversationMaintenanceRecentActivity       ConversationMaintenanceReason = "recent_activity"
	ConversationMaintenanceActivityUnknown      ConversationMaintenanceReason = "activity_unknown"
	ConversationMaintenanceRunPresent           ConversationMaintenanceReason = "run_present"
	ConversationMaintenanceLiveRun              ConversationMaintenanceReason = "live_run"
	ConversationMaintenanceLiveSchedule         ConversationMaintenanceReason = "live_schedule"
	ConversationMaintenanceActiveReportExport   ConversationMaintenanceReason = "active_report_export"
	ConversationMaintenanceGraphReferenced      ConversationMaintenanceReason = "graph_referenced"
	ConversationMaintenanceScheduleReferenced   ConversationMaintenanceReason = "schedule_referenced"
	ConversationMaintenanceScheduleMissing      ConversationMaintenanceReason = "schedule_missing"
	ConversationMaintenanceInternalSchedule     ConversationMaintenanceReason = "internal_schedule"
	ConversationMaintenanceGraphTooLarge        ConversationMaintenanceReason = "graph_too_large"
)

type ConversationMaintenanceRequest added in v0.1.43

type ConversationMaintenanceRequest struct {
	RootID          string
	ExpectedOwnerID string
	Kind            ConversationMaintenanceKind
	InactiveBefore  time.Time
	Mode            ConversationMaintenanceMode
	Lease           MaintenanceLease
}

ConversationMaintenanceRequest describes one root-graph evaluation. The expected owner comes from the candidate row selected by maintenance code; it is verified across the complete graph and is never injected as request authentication.

type ConversationMaintenanceResult added in v0.1.43

type ConversationMaintenanceResult struct {
	RootID            string
	Kind              ConversationMaintenanceKind
	Mode              ConversationMaintenanceMode
	Eligible          bool
	Deleted           bool
	Reason            ConversationMaintenanceReason
	ConversationCount int
	LastActivity      time.Time
}

type ConversationPage

type ConversationPage struct {
	Rows       []*agconvlist.ConversationRowsView
	NextCursor string
	PrevCursor string
	HasMore    bool
	HasOlder   bool
	HasNewer   bool
}

type Direction

type Direction string
const (
	DirectionBefore Direction = "before"
	DirectionAfter  Direction = "after"
	DirectionLatest Direction = "latest"
)

type MaintenanceLease added in v0.1.43

type MaintenanceLease struct {
	Key        string
	OwnerID    string
	Token      string
	LeaseUntil time.Time
}

MaintenanceLease identifies one acquisition of a distributed maintenance lease. Token changes on every acquisition so a former owner cannot mutate data after another worker has taken the lease.

type MaintenanceLeaseAcquireRequest added in v0.1.43

type MaintenanceLeaseAcquireRequest struct {
	Key     string
	OwnerID string
	TTL     time.Duration
}

type MaintenanceLeaseAcquireResult added in v0.1.43

type MaintenanceLeaseAcquireResult struct {
	Acquired bool
	Lease    MaintenanceLease
}

type MaintenanceLeaseRenewResult added in v0.1.43

type MaintenanceLeaseRenewResult struct {
	Renewed    bool
	LeaseUntil time.Time
}

type MessagePage

type MessagePage struct {
	Rows       []*agmessagelist.MessageRowsView
	NextCursor string
	PrevCursor string
	HasMore    bool
}

type Option

type Option func(*options)

Option customizes read execution without changing generated input DTOs.

func WithAdminPrincipal

func WithAdminPrincipal(userID string) Option

WithAdminPrincipal bypasses visibility restrictions.

func WithPrincipal

func WithPrincipal(userID string) Option

WithPrincipal enforces conversation visibility rules for reads.

func WithQuerySelector

func WithQuerySelector(selectors ...*hstate.NamedQuerySelector) Option

WithQuerySelector delegates pagination/projection/order constraints to Datly selectors.

type OrphanMaintenanceAction added in v0.1.43

type OrphanMaintenanceAction string

OrphanMaintenanceAction describes the operation allowed for a reported orphan. The action is part of the static schema contract and is never supplied by the cleanup caller.

const (
	OrphanMaintenanceSafeDelete OrphanMaintenanceAction = "safe-delete"
	OrphanMaintenanceSafeDetach OrphanMaintenanceAction = "safe-detach"
	OrphanMaintenanceReportOnly OrphanMaintenanceAction = "report-only"
)

type OrphanMaintenanceCandidate added in v0.1.43

type OrphanMaintenanceCandidate struct {
	CursorID       string
	RuleID         string
	Action         OrphanMaintenanceAction
	Table          string
	RecordID       string
	ReferenceTable string
	ReferenceID    string
	ObservedAt     time.Time
}

OrphanMaintenanceCandidate contains identifiers only. The orphan scan never selects message content, payload bodies, report documents, or other large values.

type OrphanMaintenanceCandidateRequest added in v0.1.43

type OrphanMaintenanceCandidateRequest struct {
	OlderThan   time.Time
	AfterCursor string
	Limit       int
}

OrphanMaintenanceCandidateRequest defines a bounded, keyset-paged orphan report. OlderThan is the grace-period cutoff; AfterCursor is opaque and must come from a previously returned candidate.

type OrphanMaintenanceReason added in v0.1.43

type OrphanMaintenanceReason string
const (
	OrphanMaintenanceDeletedReason          OrphanMaintenanceReason = "deleted"
	OrphanMaintenanceDetachedReason         OrphanMaintenanceReason = "detached"
	OrphanMaintenanceReportOnlyReason       OrphanMaintenanceReason = "report_only"
	OrphanMaintenanceNoLongerEligibleReason OrphanMaintenanceReason = "no_longer_eligible"
)

type OrphanMaintenanceRequest added in v0.1.43

type OrphanMaintenanceRequest struct {
	RuleID    string
	RecordID  string
	OlderThan time.Time
	Lease     MaintenanceLease
}

OrphanMaintenanceRequest identifies one previously reported orphan. The rule, age and missing-parent condition are all re-evaluated in a serializable transaction before any mutation is allowed.

type OrphanMaintenanceResult added in v0.1.43

type OrphanMaintenanceResult struct {
	RuleID   string
	RecordID string
	Action   OrphanMaintenanceAction
	Eligible bool
	Mutated  bool
	Deleted  bool
	Detached bool
	Reason   OrphanMaintenanceReason
}

type PageInput

type PageInput struct {
	Limit     int
	Cursor    string
	Direction Direction
}

type RunStepPage

type RunStepPage struct {
	Rows       []*agrunsteps.RunStepsView
	NextCursor string
	PrevCursor string
	HasMore    bool
}

type ScheduledRunMaintenanceCandidate added in v0.1.43

type ScheduledRunMaintenanceCandidate struct {
	RunID string
	// ExpectedOwnerID is a diagnostic snapshot. System retention does not use
	// historical owner columns as an authorization boundary.
	ExpectedOwnerID string
	ActivityAt      time.Time
}

ScheduledRunMaintenanceCandidate contains only bounded metadata used by the cleanup worker. It deliberately excludes prompts, messages and payloads.

type ScheduledRunMaintenanceCandidateRequest added in v0.1.43

type ScheduledRunMaintenanceCandidateRequest struct {
	InactiveBefore time.Time
	AfterActivity  time.Time
	AfterRunID     string
	Limit          int
}

type ScheduledRunMaintenanceRequest added in v0.1.43

type ScheduledRunMaintenanceRequest struct {
	RunID string
	// ExpectedOwnerID is retained for caller compatibility and diagnostics.
	// It is intentionally not enforced by system scheduled-run retention.
	ExpectedOwnerID string
	InactiveBefore  time.Time
	Mode            ConversationMaintenanceMode
	Lease           MaintenanceLease
}

type ScheduledRunMaintenanceResult added in v0.1.43

type ScheduledRunMaintenanceResult struct {
	RunID             string
	ScheduleID        string
	Source            ScheduledRunMaintenanceSource
	Mode              ConversationMaintenanceMode
	Eligible          bool
	Deleted           bool
	Reason            ConversationMaintenanceReason
	ConversationCount int
	LastActivity      time.Time
}

type ScheduledRunMaintenanceSource added in v0.1.43

type ScheduledRunMaintenanceSource string

ScheduledRunMaintenanceSource identifies the persisted scheduler-run representation. MySQL installations can still contain legacy schedule_run rows; SQLite uses only run.

const (
	ScheduledRunMaintenanceCurrent ScheduledRunMaintenanceSource = "run"
	ScheduledRunMaintenanceLegacy  ScheduledRunMaintenanceSource = "schedule_run"
)

type Service

type Service interface {
	Raw() *datly.Service

	GetConversation(ctx context.Context, id string, in *agconv.ConversationInput, opts ...Option) (*agconv.ConversationView, error)
	GetGoal(ctx context.Context, conversationID string, in *aggoal.GoalInput, opts ...Option) (*aggoal.GoalView, error)
	ListConversations(ctx context.Context, in *agconvlist.ConversationRowsInput, page *PageInput, opts ...Option) (*ConversationPage, error)
	GetMessage(ctx context.Context, id string, in *agmessage.MessageInput, opts ...Option) (*agmessage.MessageView, error)
	GetMessagesPage(ctx context.Context, in *agmessagelist.MessageRowsInput, page *PageInput, opts ...Option) (*MessagePage, error)
	GetMessageByElicitation(ctx context.Context, conversationID, elicitationID string, opts ...Option) (*elicitationmsg.MessageView, error)

	GetRun(ctx context.Context, id string, in *agrun.RunRowsInput, opts ...Option) (*agrun.RunRowsView, error)
	GetRunStepsPage(ctx context.Context, in *agrunsteps.RunStepsInput, page *PageInput, opts ...Option) (*RunStepPage, error)
	GetActiveRun(ctx context.Context, in *agrunactive.ActiveRunsInput, opts ...Option) (*agrunactive.ActiveRunsView, error)
	ListStaleRuns(ctx context.Context, in *agrunstale.StaleRunsInput, opts ...Option) ([]*agrunstale.StaleRunsView, error)

	GetActiveTurn(ctx context.Context, in *agturnactive.ActiveTurnsInput, opts ...Option) (*agturnactive.ActiveTurnsView, error)
	GetTurnByID(ctx context.Context, in *agturnbyid.TurnLookupInput, opts ...Option) (*agturnbyid.TurnLookupView, error)
	GetTurnsPage(ctx context.Context, in *agturnlistall.TurnRowsInput, page *PageInput, opts ...Option) (*TurnPage, error)
	GetNextQueuedTurn(ctx context.Context, in *agturnnext.QueuedTurnInput, opts ...Option) (*agturnnext.QueuedTurnView, error)
	ListQueuedTurns(ctx context.Context, in *agturnlist.QueuedTurnsInput, opts ...Option) ([]*agturnlist.QueuedTurnsView, error)
	CountQueuedTurns(ctx context.Context, in *agturncount.QueuedTotalInput, opts ...Option) (int, error)

	GetToolCallByOp(ctx context.Context, opID string, in *agtoolcall.ToolCallRowsInput, opts ...Option) ([]*agtoolcall.ToolCallRowsView, error)
	ListPayloadRows(ctx context.Context, in *agpayload.PayloadRowsInput, opts ...Option) ([]*agpayload.PayloadRowsView, error)

	ListGeneratedFiles(ctx context.Context, conversationID string, opts ...Option) ([]*gfread.GeneratedFileView, error)

	PatchConversations(ctx context.Context, rows []*agconvwrite.MutableConversationView) ([]*agconvwrite.MutableConversationView, error)
	PatchGoals(ctx context.Context, rows []*aggoalwrite.MutableGoalView) ([]*aggoalwrite.MutableGoalView, error)
	PatchMessages(ctx context.Context, rows []*agmessagewrite.MutableMessageView) ([]*agmessagewrite.MutableMessageView, error)
	PatchTurns(ctx context.Context, rows []*agturnwrite.MutableTurnView) ([]*agturnwrite.MutableTurnView, error)
	PatchModelCalls(ctx context.Context, rows []*agmodelcallwrite.MutableModelCallView) ([]*agmodelcallwrite.MutableModelCallView, error)
	PatchToolCalls(ctx context.Context, rows []*agtoolcallwrite.MutableToolCallView) ([]*agtoolcallwrite.MutableToolCallView, error)
	PatchPayloads(ctx context.Context, rows []*agpayloadwrite.MutablePayloadView) ([]*agpayloadwrite.MutablePayloadView, error)
	PatchRuns(ctx context.Context, rows []*agrunwrite.MutableRunView) ([]*agrunwrite.MutableRunView, error)

	DeleteConversations(ctx context.Context, ids ...string) error
	DeleteGoals(ctx context.Context, ids ...string) error
	DeleteConversationTree(ctx context.Context, ids ...string) error
	ListConversationMaintenanceCandidates(ctx context.Context, request ConversationMaintenanceCandidateRequest) ([]ConversationMaintenanceCandidate, error)
	MaintainConversationTree(ctx context.Context, request ConversationMaintenanceRequest) (*ConversationMaintenanceResult, error)
	ListScheduledRunMaintenanceCandidates(ctx context.Context, request ScheduledRunMaintenanceCandidateRequest) ([]ScheduledRunMaintenanceCandidate, error)
	MaintainScheduledRun(ctx context.Context, request ScheduledRunMaintenanceRequest) (*ScheduledRunMaintenanceResult, error)
	ListOrphanMaintenanceCandidates(ctx context.Context, request OrphanMaintenanceCandidateRequest) ([]OrphanMaintenanceCandidate, error)
	MaintainOrphanCandidate(ctx context.Context, request OrphanMaintenanceRequest) (*OrphanMaintenanceResult, error)
	ListTechnicalMaintenanceCandidates(ctx context.Context, request TechnicalMaintenanceCandidateRequest) ([]TechnicalMaintenanceCandidate, error)
	MaintainTechnicalCandidate(ctx context.Context, request TechnicalMaintenanceRequest) (*TechnicalMaintenanceResult, error)
	AcquireMaintenanceLease(ctx context.Context, request MaintenanceLeaseAcquireRequest) (*MaintenanceLeaseAcquireResult, error)
	RenewMaintenanceLease(ctx context.Context, lease MaintenanceLease, ttl time.Duration) (*MaintenanceLeaseRenewResult, error)
	ReleaseMaintenanceLease(ctx context.Context, lease MaintenanceLease) (bool, error)
	DeleteExpiredMaintenanceLeases(ctx context.Context, lease MaintenanceLease) (int64, error)
	DeleteScheduledRun(ctx context.Context, id string) error
	DeleteScheduleCascade(ctx context.Context, id string) error
	DeleteMessages(ctx context.Context, ids ...string) error
	DeleteTurns(ctx context.Context, ids ...string) error
	DeleteModelCalls(ctx context.Context, messageIDs ...string) error
	DeleteToolCalls(ctx context.Context, messageIDs ...string) error
	DeletePayloads(ctx context.Context, ids ...string) error
	DeleteRuns(ctx context.Context, ids ...string) error
}

Service is a thin facade over generated Datly read components.

func NewService

func NewService(dao *datly.Service) Service

NewService creates a thin data service on top of a Datly DAO.

func NewThinServiceFromEnv

func NewThinServiceFromEnv(ctx context.Context) (Service, error)

NewThinServiceFromEnv creates a thin data.Service backed by env-configured Datly.

func NewThinServiceInMemory

func NewThinServiceInMemory(ctx context.Context) (Service, error)

NewThinServiceInMemory creates a thin data.Service backed by in-memory sqlite.

type TechnicalMaintenanceCandidate added in v0.1.43

type TechnicalMaintenanceCandidate struct {
	CursorID   string
	Kind       TechnicalMaintenanceKind
	Scope      TechnicalMaintenanceScope
	RecordID   string
	ObservedAt time.Time
}

TechnicalMaintenanceCandidate contains identifiers and timestamps only. It never loads report JSON, audit metadata, export inline_data, or other blobs.

type TechnicalMaintenanceCandidateRequest added in v0.1.43

type TechnicalMaintenanceCandidateRequest struct {
	Scope       TechnicalMaintenanceScope
	OlderThan   time.Time
	EvaluatedAt time.Time
	AfterCursor string
	Limit       int
}

TechnicalMaintenanceCandidateRequest describes one bounded, keyset-paged scan. OlderThan is the configured retention cutoff, including for expired sessions. EvaluatedAt is captured once per policy pass and is used for positive per-row TTLs.

type TechnicalMaintenanceKind added in v0.1.43

type TechnicalMaintenanceKind string

TechnicalMaintenanceKind identifies the small, bounded unit revalidated by technical retention. report_shared_artifact is intentionally absent: saved reports are durable user data and must never be selected by this API.

const (
	TechnicalMaintenanceReportRun       TechnicalMaintenanceKind = "report_run"
	TechnicalMaintenanceReportExportJob TechnicalMaintenanceKind = "report_export_job"
	TechnicalMaintenanceReportAudit     TechnicalMaintenanceKind = "report_audit_event"
	TechnicalMaintenanceSession         TechnicalMaintenanceKind = "session"
)

type TechnicalMaintenanceReason added in v0.1.43

type TechnicalMaintenanceReason string
const (
	TechnicalMaintenanceEligibleReason         TechnicalMaintenanceReason = "eligible"
	TechnicalMaintenanceDeletedReason          TechnicalMaintenanceReason = "deleted"
	TechnicalMaintenanceNoLongerEligibleReason TechnicalMaintenanceReason = "no_longer_eligible"
)

type TechnicalMaintenanceRequest added in v0.1.43

type TechnicalMaintenanceRequest struct {
	Kind        TechnicalMaintenanceKind
	Scope       TechnicalMaintenanceScope
	RecordID    string
	OlderThan   time.Time
	EvaluatedAt time.Time
	Mode        ConversationMaintenanceMode
	Lease       MaintenanceLease
}

type TechnicalMaintenanceResult added in v0.1.43

type TechnicalMaintenanceResult struct {
	Kind        TechnicalMaintenanceKind
	Scope       TechnicalMaintenanceScope
	RecordID    string
	Mode        ConversationMaintenanceMode
	Eligible    bool
	Deleted     bool
	DeletedRows int64
	Reason      TechnicalMaintenanceReason
}

type TechnicalMaintenanceScope added in v0.1.43

type TechnicalMaintenanceScope string

TechnicalMaintenanceScope selects the retention policy associated with a technical row. Rows linked to a conversation inherit its interactive or scheduled classification. Rows with no live conversation are unclassified.

const (
	TechnicalMaintenanceInteractive  TechnicalMaintenanceScope = "interactive"
	TechnicalMaintenanceScheduled    TechnicalMaintenanceScope = "scheduled"
	TechnicalMaintenanceUnclassified TechnicalMaintenanceScope = "unclassified"
)

type TerminalArtifactCandidate added in v0.1.17

type TerminalArtifactCandidate struct {
	Kind           TerminalArtifactKind
	ID             string
	ConversationID string
	TurnID         string
	Linkage        TerminalArtifactLinkage
	ExpectedLink   string
	ExpectedRun    string
	TerminalStatus string
	Reason         string
}

TerminalArtifactCandidate contains only the identity and optimistic guard values captured at startup. Message content and artifact payloads are never retained in memory.

type TerminalArtifactCleanupStore added in v0.1.17

type TerminalArtifactCleanupStore interface {
	SnapshotTerminalArtifactCandidates(ctx context.Context, terminalSince time.Time, terminalTurnLimit int) ([]TerminalArtifactCandidate, error)
	CleanupTerminalArtifactCandidates(ctx context.Context, candidates []TerminalArtifactCandidate, completedAt time.Time) ([]TerminalArtifactDisposition, error)
}

TerminalArtifactCleanupStore is an optional, narrow startup-maintenance capability. It deliberately is not part of Service so callers that do not use the Datly store do not need to expose direct SQL maintenance methods.

type TerminalArtifactDisposition added in v0.1.17

type TerminalArtifactDisposition uint8
const (
	TerminalArtifactUnresolved TerminalArtifactDisposition = iota
	TerminalArtifactRepaired
	TerminalArtifactAlreadyResolved
	TerminalArtifactNoLongerEligible
)

type TerminalArtifactKind added in v0.1.17

type TerminalArtifactKind string
const (
	TerminalArtifactModelCall TerminalArtifactKind = "model_call"
	TerminalArtifactToolCall  TerminalArtifactKind = "tool_call"
	TerminalArtifactMessage   TerminalArtifactKind = "message"
)

type TerminalArtifactLinkage added in v0.1.17

type TerminalArtifactLinkage string
const (
	TerminalArtifactDirectTurn  TerminalArtifactLinkage = "direct_turn"
	TerminalArtifactMessageTurn TerminalArtifactLinkage = "message_turn"
	TerminalArtifactRun         TerminalArtifactLinkage = "run"
	TerminalArtifactLegacyRun   TerminalArtifactLinkage = "legacy_run"
)

type TurnPage

type TurnPage struct {
	Rows       []*agturnlistall.TurnRowsView
	NextCursor string
	PrevCursor string
	HasMore    bool
}

Directories

Path Synopsis
Package memory provides an in-memory conversation client implementation.
Package memory provides an in-memory conversation client implementation.

Jump to

Keyboard shortcuts

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