Documentation
¶
Index ¶
- Constants
- Variables
- type Artifact
- type ArtifactStore
- type Fact
- type Job
- type JobFilter
- type SQLiteStore
- func (s *SQLiteStore) Close() error
- func (s *SQLiteStore) CreateArtifact(ctx context.Context, artifact Artifact) error
- func (s *SQLiteStore) CreateJob(ctx context.Context, job Job) error
- func (s *SQLiteStore) DeleteJob(ctx context.Context, id string) error
- func (s *SQLiteStore) DeleteJobsByWorkerRef(ctx context.Context, workerRef string) error
- func (s *SQLiteStore) GetJob(ctx context.Context, id string) (Job, error)
- func (s *SQLiteStore) ListArtifacts(ctx context.Context, jobID string) ([]Artifact, error)
- func (s *SQLiteStore) ListArtifactsForExpiredJobs(ctx context.Context, kind string, before time.Time) ([]Artifact, error)
- func (s *SQLiteStore) ListFacts(ctx context.Context, jobID string) ([]Fact, error)
- func (s *SQLiteStore) ListJobs(ctx context.Context, filter JobFilter) ([]Job, error)
- func (s *SQLiteStore) ReplaceFacts(ctx context.Context, jobID string, facts []Fact) error
- func (s *SQLiteStore) UpdateJob(ctx context.Context, job Job) error
- type Store
Constants ¶
View Source
const ( StatusPending = "pending" StatusRunning = "running" StatusCompleted = "completed" StatusFailed = "failed" StatusCanceled = "canceled" )
View Source
const ( KindWebResearch = "web_research" KindSubagent = "subagent" )
Variables ¶
View Source
var ErrNotFound = errors.New("work: not found")
Functions ¶
This section is empty.
Types ¶
type Artifact ¶
type Artifact struct {
ID string `json:"id"`
JobID string `json:"job_id"`
SourceID string `json:"source_id,omitempty"`
SourceURL string `json:"source_url,omitempty"`
Kind string `json:"kind"`
Path string `json:"path"`
MIMEType string `json:"mime_type,omitempty"`
ByteCount int64 `json:"byte_count,omitempty"`
Summary string `json:"summary,omitempty"`
MetadataJSON string `json:"metadata_json,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
type ArtifactStore ¶
type ArtifactStore struct {
// contains filtered or unexported fields
}
func NewArtifactStore ¶
func NewArtifactStore(root string) *ArtifactStore
type Fact ¶
type Fact struct {
ID string `json:"id"`
JobID string `json:"job_id"`
Claim string `json:"claim"`
Confidence float64 `json:"confidence,omitempty"`
SourceIDs []string `json:"source_ids,omitempty"`
ArtifactIDs []string `json:"artifact_ids,omitempty"`
MetadataJSON string `json:"metadata_json,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
type Job ¶
type Job struct {
ID string `json:"id"`
Kind string `json:"kind"`
Status string `json:"status"`
Task string `json:"task,omitempty"`
Summary string `json:"summary,omitempty"`
ResultJSON string `json:"result_json,omitempty"`
WorkerRef string `json:"worker_ref,omitempty"`
TokenUsageJSON string `json:"token_usage_json,omitempty"`
InputJSON string `json:"input_json,omitempty"`
Error string `json:"error,omitempty"`
Attempts int `json:"attempts,omitempty"`
HeartbeatAt *time.Time `json:"heartbeat_at,omitempty"`
StartedAt *time.Time `json:"started_at,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
}
type SQLiteStore ¶
type SQLiteStore struct {
// contains filtered or unexported fields
}
func NewSQLiteStore ¶
func NewSQLiteStore(path string) (*SQLiteStore, error)
func (*SQLiteStore) Close ¶
func (s *SQLiteStore) Close() error
func (*SQLiteStore) CreateArtifact ¶
func (s *SQLiteStore) CreateArtifact(ctx context.Context, artifact Artifact) error
func (*SQLiteStore) DeleteJob ¶
func (s *SQLiteStore) DeleteJob(ctx context.Context, id string) error
func (*SQLiteStore) DeleteJobsByWorkerRef ¶
func (s *SQLiteStore) DeleteJobsByWorkerRef(ctx context.Context, workerRef string) error
func (*SQLiteStore) ListArtifacts ¶
func (*SQLiteStore) ListArtifactsForExpiredJobs ¶
func (*SQLiteStore) ReplaceFacts ¶
type Store ¶
type Store interface {
CreateJob(ctx context.Context, job Job) error
UpdateJob(ctx context.Context, job Job) error
GetJob(ctx context.Context, id string) (Job, error)
ListJobs(ctx context.Context, filter JobFilter) ([]Job, error)
DeleteJob(ctx context.Context, id string) error
DeleteJobsByWorkerRef(ctx context.Context, workerRef string) error
CreateArtifact(ctx context.Context, artifact Artifact) error
ListArtifacts(ctx context.Context, jobID string) ([]Artifact, error)
ListArtifactsForExpiredJobs(ctx context.Context, kind string, before time.Time) ([]Artifact, error)
ReplaceFacts(ctx context.Context, jobID string, facts []Fact) error
ListFacts(ctx context.Context, jobID string) ([]Fact, error)
}
Click to show internal directories.
Click to hide internal directories.