library

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDir = "library"

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalog

type Catalog struct {
	Tasks []TaskDefinition
	// contains filtered or unexported fields
}

Catalog contains all loaded library task definitions.

func LoadCatalog

func LoadCatalog(dir string) (Catalog, error)

LoadCatalog loads and validates library tasks from ./library/*.json.

func (Catalog) ExpandRunConfig

func (c Catalog) ExpandRunConfig(taskName, repo, branch string) (config.Config, error)

ExpandRunConfig resolves one library task name into a standard harness run config.

func (Catalog) Names

func (c Catalog) Names() []string

Names returns the ordered list of callable library task names.

func (Catalog) Summaries

func (c Catalog) Summaries() []TaskSummary

Summaries returns stable task metadata for UI and runtime registration.

func (Catalog) Task added in v1.0.1

func (c Catalog) Task(name string) (TaskDefinition, bool)

Task returns one task definition by name.

type TaskDefinition

type TaskDefinition struct {
	Name          string   `json:"name"`
	DisplayName   string   `json:"displayName"`
	Type          string   `json:"type"`
	Icon          string   `json:"icon"`
	Description   string   `json:"description"`
	TargetSubdir  string   `json:"targetSubdir"`
	Prompt        string   `json:"prompt"`
	CommitMessage string   `json:"commitMessage"`
	PRTitle       string   `json:"prTitle"`
	PRBody        string   `json:"prBody"`
	Labels        []string `json:"labels"`
	GitHubHandle  string   `json:"githubHandle"`
	Reviewers     []string `json:"reviewers"`
}

TaskDefinition is one callable library entry loaded from ./library/*.json.

func (*TaskDefinition) UnmarshalJSON

func (t *TaskDefinition) UnmarshalJSON(data []byte) error

UnmarshalJSON supports canonical camelCase keys.

type TaskSummary

type TaskSummary struct {
	Name        string `json:"name"`
	DisplayName string `json:"displayName,omitempty"`
	Type        string `json:"type,omitempty"`
	Icon        string `json:"icon,omitempty"`
	Description string `json:"description,omitempty"`
	Prompt      string `json:"prompt,omitempty"`
}

TaskSummary is the public UI/runtime registration view of one library task.

func OrderSummariesByUsage

func OrderSummariesByUsage(summaries []TaskSummary, usage map[string]int) []TaskSummary

OrderSummariesByUsage reorders library tasks by descending local usage count. Ties preserve the incoming order.

Jump to

Keyboard shortcuts

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