agent

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package agent provides the "jira agent" command group for agentic SDLC. Commands implement a ready → claim → work → discover → close loop backed by Jira Cloud issues, links, and transitions.

Index

Constants

View Source
const (
	CategoryToDo       = "new"
	CategoryInProgress = "indeterminate"
	CategoryDone       = "done"
)

Status category keys used by Jira Cloud. Commands match on these rather than status names for portability across project workflows.

Variables

This section is empty.

Functions

func AgentReadyFields

func AgentReadyFields() []string

AgentReadyFields returns the Jira fields needed for ready queue computation.

func FindBlockers

func FindBlockers(issue *api.Issue) []api.LinkedIssue

FindBlockers returns the list of unresolved blocking issues. A blocker is an issue linked via "is blocked by" whose status category is not "done".

func FindTransitionByCategory

func FindTransitionByCategory(transitions []api.Transition, category string) (*api.Transition, error)

FindTransitionByCategory finds a transition whose target status matches the given category key ("indeterminate", "done", "new").

func IsBlocked

func IsBlocked(issue *api.Issue) bool

IsBlocked checks if an issue has unresolved "is blocked by" links.

func MapPriorityRank

func MapPriorityRank(priority *api.Priority) int

MapPriorityRank converts a Jira priority name to a numeric rank (0-4). Lower rank = higher priority. Unknown priorities get rank 2 (Medium).

func NewCmdAgent

func NewCmdAgent(f *factory.Factory) *cobra.Command

NewCmdAgent creates the "agent" command group.

func NewCmdBlocked

func NewCmdBlocked(f *factory.Factory) *cobra.Command

NewCmdBlocked creates the "agent blocked" command.

func NewCmdClaim

func NewCmdClaim(f *factory.Factory) *cobra.Command

NewCmdClaim creates the "agent claim" command.

func NewCmdClose

func NewCmdClose(f *factory.Factory) *cobra.Command

NewCmdClose creates the "agent close" command.

func NewCmdDiscover

func NewCmdDiscover(f *factory.Factory) *cobra.Command

NewCmdDiscover creates the "agent discover" command.

func NewCmdPrime

func NewCmdPrime(f *factory.Factory) *cobra.Command

NewCmdPrime creates the "agent prime" command.

func NewCmdReady

func NewCmdReady(f *factory.Factory) *cobra.Command

NewCmdReady creates the "agent ready" command.

func NewCmdStatus

func NewCmdStatus(f *factory.Factory) *cobra.Command

NewCmdStatus creates the "agent status" command.

func ResolveIssueTypeName

func ResolveIssueTypeName(ctx context.Context, client *api.Client, project string, wantSubtask bool, fallback string) string

ResolveIssueTypeName returns the project's own name for a sub-task or a standard issue type.

The names are not fixed across Jira: a company-managed project calls its sub-task type "Sub-task" while a team-managed one calls it "Subtask", and a project need not have a type called "Task" at all. Hardcoding either name makes the command fail on half the projects in existence.

fallback is returned when the project's metadata cannot be read — the caller is better off attempting the create and surfacing Jira's own error than failing early on a permissions problem.

func SortByPriorityThenCreated

func SortByPriorityThenCreated(issues []api.Issue)

SortByPriorityThenCreated sorts issues by priority rank (ascending), then by created date (ascending) for stable ordering.

Types

type BlockedOptions

type BlockedOptions struct {
	Factory *factory.Factory
	Project string
	Limit   int
}

BlockedOptions holds all resolved inputs for the agent blocked command.

type ClaimOptions

type ClaimOptions struct {
	Factory *factory.Factory
	KeyOrID string
	Force   bool
}

ClaimOptions holds all resolved inputs for the agent claim command.

type CloseOptions

type CloseOptions struct {
	Factory     *factory.Factory
	KeyOrID     string
	Reason      string
	SuggestNext bool
	ClaimNext   bool
}

CloseOptions holds all resolved inputs for the agent close command.

type DiscoverOptions

type DiscoverOptions struct {
	Factory     *factory.Factory
	ParentKey   string
	Title       string
	Description string
	Type        string
	Priority    string
	Labels      []string
	AsSubtask   bool
	LinkType    string
	BodyFile    string
}

DiscoverOptions holds all resolved inputs for the agent discover command.

type PrimeOptions

type PrimeOptions struct {
	Factory *factory.Factory
	Project string
	Full    bool
}

PrimeOptions holds all resolved inputs for the agent prime command.

type ReadyOptions

type ReadyOptions struct {
	Factory    *factory.Factory
	Project    string
	Limit      int
	Assignee   string
	Unassigned bool
	Type       string
	Labels     []string
	Priority   string
	Component  string
	Sort       string
	Sprint     string
}

ReadyOptions holds all resolved inputs for the agent ready command.

type StatusOptions

type StatusOptions struct {
	Factory *factory.Factory
	Project string
}

StatusOptions holds all resolved inputs for the agent status command.

Jump to

Keyboard shortcuts

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