task

package
v0.7.15 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigExists

func ConfigExists(rootDir string) bool

ConfigExists checks whether .chunk/run.json exists at the given root directory.

func GetDefinitionByNameOrID

func GetDefinitionByNameOrID(cfg *RunConfig, nameOrID string) (string, *string, string, error)

GetDefinitionByNameOrID looks up a definition by name first, then checks if the input is a raw UUID. Returns the definition ID, the chunk environment ID, and the default branch.

func IsValidUUID

func IsValidUUID(s string) bool

IsValidUUID checks if a string is a valid UUID format.

func MapVcsTypeToOrgType

func MapVcsTypeToOrgType(vcsType string) string

MapVcsTypeToOrgType maps a VCS type string to the org type used in run config. "github" and "gh" map to "github"; everything else maps to "circleci".

func SaveRunConfig

func SaveRunConfig(workDir string, cfg *RunConfig) error

SaveRunConfig writes run config to .chunk/run.json.

func TriggerRun

func TriggerRun(ctx context.Context, client *circleci.Client, cfg *RunConfig, params RunParams) (*circleci.RunResponse, error)

Types

type RunConfig

type RunConfig struct {
	OrgID       string                   `json:"org_id"`
	ProjectID   string                   `json:"project_id"`
	OrgType     string                   `json:"org_type"`
	Definitions map[string]RunDefinition `json:"definitions"`
}

func LoadRunConfig

func LoadRunConfig(workDir string) (*RunConfig, error)

type RunDefinition

type RunDefinition struct {
	DefinitionID       string  `json:"definition_id"`
	Description        string  `json:"description,omitempty"`
	ChunkEnvironmentID *string `json:"chunk_environment_id"`
	DefaultBranch      string  `json:"default_branch"`
}

type RunParams

type RunParams struct {
	Definition     string
	Prompt         string
	Branch         string
	NewBranch      bool
	PipelineAsTool bool
}

Jump to

Keyboard shortcuts

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