Documentation
¶
Overview ¶
Package lists provides management of structured list files across all domains. Lists are JSON files containing arrays of items with validated schemas.
Index ¶
- Constants
- type Option
- type Service
- func (s *Service) AddItem(source, project, playbook, listName string, item *global.ListItem) (string, error)
- func (s *Service) Copy(fromSource, fromProject, fromPlaybook, fromListName string, ...) error
- func (s *Service) Create(source, project, playbook, listName, name, description string, ...) error
- func (s *Service) CreateTasks(taskCreator TaskCreator, listSource, project, playbook, listName string, ...) (*global.ListCreateTasksResponse, error)
- func (s *Service) Delete(source, project, playbook, listName string) error
- func (s *Service) Get(source, project, playbook, listName string) (*global.List, error)
- func (s *Service) GetItem(source, project, playbook, listName, itemID string) (*global.ListItem, error)
- func (s *Service) GetSummary(source, project, playbook, listName string, completeFilter string, ...) (*global.ListGetSummaryResponse, error)
- func (s *Service) List(source, project, playbook string, offset, limit int) (*global.ListListResponse, error)
- func (s *Service) RemoveItem(source, project, playbook, listName, itemID string) error
- func (s *Service) Rename(source, project, playbook, listName, newListName string) error
- func (s *Service) RenameItem(source, project, playbook, listName, itemID, newItemID string) error
- func (s *Service) SearchItems(source, project, playbook, listName, query, sourceDoc, section string, ...) (*global.ListItemSearchResponse, error)
- func (s *Service) UpdateItem(source, project, playbook, listName, itemID string, ...) error
- type TaskCreator
Constants ¶
const ( SourceProject = "project" SourcePlaybook = "playbook" SourceReference = "reference" )
Source domain constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Service)
Option is a functional option for configuring Service
func WithEmbeddedFS ¶
WithEmbeddedFS sets the embedded reference filesystem
func WithLogger ¶
WithLogger sets the logger for the service
func WithPlaybooksDir ¶
WithPlaybooksDir sets the playbooks directory
func WithProjectsDir ¶
WithProjectsDir sets the projects directory
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides list operations across all domains.
func NewService ¶
NewService creates a new lists service with functional options.
func (*Service) AddItem ¶
func (s *Service) AddItem(source, project, playbook, listName string, item *global.ListItem) (string, error)
AddItem adds a new item to a list. The listName parameter should be the list name without .json extension. If item.ID is empty, an ID will be auto-generated (item-001, item-002, etc.). For playbook lists, complete must be false - playbook items cannot be marked complete. Returns the assigned item ID (useful when auto-generated).
func (*Service) Copy ¶
func (s *Service) Copy( fromSource, fromProject, fromPlaybook, fromListName string, toSource, toProject, toPlaybook, toListName string, sample int, ) error
Copy copies a list from one location to another. This supports copying between projects, playbooks, and reference (read-only source). The from/to list names should not include .json extension. If sample > 0, randomly selects that many items from the source list.
func (*Service) Create ¶
func (s *Service) Create(source, project, playbook, listName, name, description string, items []global.ListItem) error
Create creates a new list. The listName parameter should be the list name without .json extension.
func (*Service) CreateTasks ¶
func (s *Service) CreateTasks( taskCreator TaskCreator, listSource, project, playbook, listName string, targetProject, path string, titleTemplate, taskType string, priority int, llmModelID, instructionsFile, instructionsFileSource, instructionsText, basePrompt string, qaTemplate *global.QAExecution, sample int, parallel bool, ) (*global.ListCreateTasksResponse, error)
CreateTasks creates tasks from list items. The listName parameter should be the list name without .json extension. The priority parameter is reserved for future use. The qaTemplate parameter, if non-nil, enables QA for all created tasks. The sample parameter, if > 0, randomly selects that many items from the list. The parallel parameter enables parallel task execution in the created taskset.
func (*Service) Delete ¶
Delete deletes a list. The listName parameter should be the list name without .json extension.
func (*Service) Get ¶
Get returns the full contents of a list. The listName parameter should be the list name without .json extension.
func (*Service) GetItem ¶
func (s *Service) GetItem(source, project, playbook, listName, itemID string) (*global.ListItem, error)
GetItem returns a single item from a list. The listName parameter should be the list name without .json extension.
func (*Service) GetSummary ¶
func (s *Service) GetSummary(source, project, playbook, listName string, completeFilter string, offset, limit int) (*global.ListGetSummaryResponse, error)
GetSummary returns a summary of a list with paginated items. The listName parameter should be the list name without .json extension. The completeFilter parameter is only used for project lists: "true", "false", or "" (no filter).
func (*Service) List ¶
func (s *Service) List(source, project, playbook string, offset, limit int) (*global.ListListResponse, error)
List returns all lists in the specified source.
func (*Service) RemoveItem ¶
RemoveItem removes an item from a list. The listName parameter should be the list name without .json extension.
func (*Service) Rename ¶
Rename renames a list. The listName and newListName parameters should be list names without .json extension.
func (*Service) RenameItem ¶
RenameItem renames an item's ID in a list. The listName parameter should be the list name without .json extension.
func (*Service) SearchItems ¶
func (s *Service) SearchItems(source, project, playbook, listName, query, sourceDoc, section string, tags []string, completeFilter string, offset, limit int) (*global.ListItemSearchResponse, error)
SearchItems searches for items in a list. The listName parameter should be the list name without .json extension. The completeFilter parameter is only used for project lists: "true", "false", or "" (no filter).
func (*Service) UpdateItem ¶
func (s *Service) UpdateItem(source, project, playbook, listName, itemID string, title, content, sourceDoc, section *string, tags []string, clearTags bool, complete *bool) error
UpdateItem updates an existing item in a list. The listName parameter should be the list name without .json extension. For playbook lists, complete cannot be set to true - playbook items cannot be marked complete.
type TaskCreator ¶
type TaskCreator interface {
CreateTask(project, path, title, taskType string, work *global.WorkExecution, qa *global.QAExecution) (*global.Task, error)
GetTaskSet(project, path string) (*global.TaskSet, error)
CreateTaskSet(project, path, title, description string, templates *global.DefaultTemplates, parallel bool, limits global.Limits, skipValidation bool, callbackURL string) (*global.TaskSet, error)
}
TaskCreator interface for creating tasks and managing tasksets (to avoid circular dependency)