Documentation
¶
Overview ¶
Package inputs defines the agent-facing input types shared by the xpo CLI (--json mode) and the MCP server. Both transports decode user input into these structs and then call into the internal/exponential service layer, so there is exactly one validation/conversion path regardless of transport.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeStrict ¶
DecodeStrict unmarshals JSON, rejecting unknown fields so typos surface instead of silently dropping data.
func LinksToDependencies ¶
func LinksToDependencies(links []LinkInput) ([]model.Dependency, error)
LinksToDependencies converts agent-facing LinkInputs to internal model.Dependency values, normalizing the type string.
func UpdatePayloadEmpty ¶
func UpdatePayloadEmpty(p model.UpdatePayload) bool
UpdatePayloadEmpty reports whether every field of p is unset (a no-op patch). Used by both CLI and MCP write paths to reject empty updates rather than wasting an event.
func ValidateStatus ¶
ValidateStatus returns nil if s is one of the five known issue statuses.
Types ¶
type AddInput ¶
type AddInput struct {
Title string `json:"title" jsonschema:"Issue title (required)"`
Description string `json:"description,omitempty" jsonschema:"Markdown description; multi-line and special characters supported"`
Status string `json:"status,omitempty" jsonschema:"Initial status: BACKLOG, PLANNED, DOING, BLOCKED, or DONE (default BACKLOG)"`
Parent string `json:"parent,omitempty" jsonschema:"Parent issue ID for sub-issue relationships"`
StoryPoints int `json:"story_points,omitempty" jsonschema:"Effort estimate in story points"`
Priority int `json:"priority,omitempty"`
Assignee string `json:"assignee,omitempty" jsonschema:"Assignee in 'Name <email>' format"`
Labels []string `json:"labels,omitempty" jsonschema:"Labels such as feature, bug, epic"`
CycleID string `json:"cycle_id,omitempty" jsonschema:"Cycle ID (YYYY-MM-DD start date) to assign this issue to"`
Links []LinkInput `json:"links,omitempty" jsonschema:"Dependencies/relationships to other issues, set at creation time"`
}
AddInput is the agent-facing payload for creating an issue. JSON field names favour ergonomic short forms (parent, story_points, links) over the internal storage names (parent_id, estimate, dependencies). The jsonschema tags are consumed by the MCP SDK to generate tool input schemas.
func (AddInput) ToCreatePayload ¶
func (in AddInput) ToCreatePayload() (model.CreatePayload, error)
ToCreatePayload validates and converts to the internal CreatePayload type.
type CommentInput ¶
type CommentInput struct {
Body string `json:"body" jsonschema:"Comment text in markdown"`
}
CommentInput is the agent-facing payload for adding a comment.
type LinkInput ¶
type LinkInput struct {
Target string `json:"target" jsonschema:"Target issue ID"`
Type string `` /* 128-byte string literal not displayed */
}
LinkInput describes one dependency/relationship target. The source side is implicit (the issue being created or updated).
type UpdateInput ¶
type UpdateInput struct {
Title *string `json:"title,omitempty"`
Description *string `json:"description,omitempty" jsonschema:"Replace the issue description"`
Status *string `json:"status,omitempty" jsonschema:"New status: BACKLOG, PLANNED, DOING, BLOCKED, or DONE"`
Parent *string `json:"parent,omitempty"`
StoryPoints *int `json:"story_points,omitempty"`
Priority *int `json:"priority,omitempty"`
Assignee *string `json:"assignee,omitempty"`
Labels []string `json:"labels,omitempty" jsonschema:"Replace the full label list"`
CycleID *string `json:"cycle_id,omitempty" jsonschema:"Cycle ID (YYYY-MM-DD start date) to assign this issue to"`
Links []LinkInput `json:"links,omitempty" jsonschema:"Replace the full dependency list"`
}
UpdateInput is a partial patch. Pointer fields distinguish 'not provided' (nil — no change) from 'cleared' (pointer to empty value).
func (UpdateInput) ToUpdatePayload ¶
func (in UpdateInput) ToUpdatePayload() (model.UpdatePayload, error)
ToUpdatePayload validates and converts to the internal UpdatePayload type.