Documentation
¶
Index ¶
- Constants
- func BuildMCPCall(tool MCPTool, arguments map[string]interface{}, customSelection string) (string, map[string]interface{}, error)
- type AgentActivities
- type AgentActivity
- type AgentSession
- type Attachment
- type Attachments
- type Client
- func (c *Client) ArchiveProject(ctx context.Context, id string) (*Project, error)
- func (c *Client) CreateAttachment(ctx context.Context, input map[string]interface{}) (*Attachment, error)
- func (c *Client) CreateComment(ctx context.Context, issueID string, body string) (*Comment, error)
- func (c *Client) CreateIssue(ctx context.Context, input map[string]interface{}) (*Issue, error)
- func (c *Client) CreateIssueRelation(ctx context.Context, issueID, relatedIssueID, relationType string) (*IssueRelation, error)
- func (c *Client) CreateLabel(ctx context.Context, input map[string]interface{}) (*Label, error)
- func (c *Client) CreateProject(ctx context.Context, input map[string]interface{}) (*Project, error)
- func (c *Client) DeleteComment(ctx context.Context, id string) error
- func (c *Client) DeleteIssueRelation(ctx context.Context, relationID string) error
- func (c *Client) DeleteLabel(ctx context.Context, id string) error
- func (c *Client) DeleteProject(ctx context.Context, id string) error
- func (c *Client) DiscoverMCPTools(ctx context.Context) ([]MCPTool, error)
- func (c *Client) Execute(ctx context.Context, query string, variables map[string]interface{}, ...) error
- func (c *Client) ExecuteRaw(ctx context.Context, query string, variables map[string]interface{}) (*GraphQLResponse, error)
- func (c *Client) FindUserByIdentifier(ctx context.Context, identifier string) (*User, error)
- func (c *Client) GetComment(ctx context.Context, id string) (*Comment, error)
- func (c *Client) GetIssue(ctx context.Context, id string) (*Issue, error)
- func (c *Client) GetIssueAgentSession(ctx context.Context, issueID string) (*Issue, error)
- func (c *Client) GetIssueComments(ctx context.Context, issueID string, first int, after string, orderBy string) (*Comments, error)
- func (c *Client) GetIssueRelations(ctx context.Context, issueID string) ([]IssueRelation, error)
- func (c *Client) GetIssues(ctx context.Context, filter map[string]interface{}, first int, after string, ...) (*Issues, error)
- func (c *Client) GetLabel(ctx context.Context, id string) (*Label, error)
- func (c *Client) GetProject(ctx context.Context, id string) (*Project, error)
- func (c *Client) GetProjectMilestones(ctx context.Context, projectID string) ([]ProjectMilestone, error)
- func (c *Client) GetProjects(ctx context.Context, filter map[string]interface{}, first int, after string, ...) (*Projects, error)
- func (c *Client) GetRateLimit(ctx context.Context) (*RateLimit, error)
- func (c *Client) GetTeam(ctx context.Context, key string) (*Team, error)
- func (c *Client) GetTeamLabels(ctx context.Context, teamKey string) ([]Label, error)
- func (c *Client) GetTeamMembers(ctx context.Context, teamKey string) (*Users, error)
- func (c *Client) GetTeamStates(ctx context.Context, teamKey string) ([]WorkflowState, error)
- func (c *Client) GetTeams(ctx context.Context, first int, after string, orderBy string) (*Teams, error)
- func (c *Client) GetUser(ctx context.Context, email string) (*User, error)
- func (c *Client) GetUsers(ctx context.Context, first int, after string, orderBy string) (*Users, error)
- func (c *Client) GetViewer(ctx context.Context) (*User, error)
- func (c *Client) IssueSearch(ctx context.Context, term string, filter map[string]interface{}, first int, ...) (*Issues, error)
- func (c *Client) MentionAgent(ctx context.Context, issueID string, agentHandle string, message string) (string, error)
- func (c *Client) UpdateComment(ctx context.Context, id string, body string) (*Comment, error)
- func (c *Client) UpdateIssue(ctx context.Context, id string, input map[string]interface{}) (*Issue, error)
- func (c *Client) UpdateLabel(ctx context.Context, id string, input map[string]interface{}) (*Label, error)
- func (c *Client) UpdateProject(ctx context.Context, id string, input map[string]interface{}) (*Project, error)
- func (c *Client) UpdateWorkflowState(ctx context.Context, id string, input map[string]interface{}) (*WorkflowState, error)
- type Comment
- type Comments
- type CustomerTicket
- type Cycle
- type Document
- type Documents
- type ExternalUser
- type GraphQLError
- type GraphQLErrorLocation
- type GraphQLRequest
- type GraphQLResponse
- type Initiative
- type Issue
- type IssueHistory
- type IssueHistoryEntry
- type IssueRelation
- type IssueRelations
- type Issues
- type Label
- type Labels
- type MCPArg
- type MCPTool
- type Milestone
- type PageInfo
- type Project
- type ProjectLink
- type ProjectLinks
- type ProjectMilestone
- type ProjectUpdate
- type ProjectUpdates
- type Projects
- type RateLimit
- type Reaction
- type Roadmap
- type Roadmaps
- type SlackComment
- type State
- type Team
- type Teams
- type Template
- type User
- type Users
- type WorkflowState
Constants ¶
const (
BaseURL = "https://api.linear.app/graphql"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AgentActivities ¶ added in v0.1.2
type AgentActivities struct {
Nodes []AgentActivity `json:"nodes"`
PageInfo PageInfo `json:"pageInfo"`
}
AgentActivities represents a paginated activity list for an agent session.
type AgentActivity ¶ added in v0.1.2
type AgentActivity struct {
ID string `json:"id"`
CreatedAt time.Time `json:"createdAt"`
Ephemeral bool `json:"ephemeral"`
Content map[string]interface{} `json:"content"`
}
AgentActivity represents one activity event.
type AgentSession ¶ added in v0.1.2
type AgentSession struct {
ID string `json:"id"`
Status string `json:"status"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
AppUser *User `json:"appUser"`
Activities *AgentActivities `json:"activities"`
}
AgentSession represents an agent execution session associated with a comment.
type Attachment ¶ added in v0.1.1
type Attachment struct {
ID string `json:"id"`
Title string `json:"title"`
Subtitle *string `json:"subtitle"`
URL string `json:"url"`
Metadata map[string]interface{} `json:"metadata"`
CreatedAt time.Time `json:"createdAt"`
Creator *User `json:"creator"`
// Use a map to capture any extra fields Linear might return
Extra map[string]interface{} `json:"-"`
}
Attachment represents a file attachment or link
func (*Attachment) UnmarshalJSON ¶ added in v0.1.1
func (a *Attachment) UnmarshalJSON(data []byte) error
UnmarshalJSON implements custom unmarshaling to handle unexpected fields from Linear API
type Attachments ¶ added in v0.1.1
type Attachments struct {
Nodes []Attachment `json:"nodes"`
}
Attachments represents a paginated list of attachments
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClientWithURL ¶ added in v0.1.1
NewClientWithURL creates a new Linear API client with custom URL
func (*Client) ArchiveProject ¶ added in v0.1.2
ArchiveProject archives a project (soft delete)
func (*Client) CreateAttachment ¶ added in v0.1.2
func (c *Client) CreateAttachment(ctx context.Context, input map[string]interface{}) (*Attachment, error)
CreateAttachment creates a new attachment on an issue.
func (*Client) CreateComment ¶ added in v0.1.1
CreateComment creates a new comment on an issue
func (*Client) CreateIssue ¶ added in v0.1.1
CreateIssue creates a new issue
func (*Client) CreateIssueRelation ¶ added in v0.1.7
func (c *Client) CreateIssueRelation(ctx context.Context, issueID, relatedIssueID, relationType string) (*IssueRelation, error)
CreateIssueRelation creates a relation between two issues. issueID is the issue to add the relation to. relatedIssueID is the other issue in the relation. relationType is one of: "blocks", "duplicate", "related". For "blocks": issueID is blocked by relatedIssueID.
func (*Client) CreateLabel ¶ added in v0.1.2
CreateLabel creates a new issue label.
func (*Client) CreateProject ¶ added in v0.1.2
CreateProject creates a new project
func (*Client) DeleteComment ¶ added in v0.1.2
DeleteComment deletes a comment by ID.
func (*Client) DeleteIssueRelation ¶ added in v0.1.7
DeleteIssueRelation removes a relation between two issues by relation ID.
func (*Client) DeleteLabel ¶ added in v0.1.2
DeleteLabel deletes an issue label by ID.
func (*Client) DeleteProject ¶ added in v0.1.2
DeleteProject permanently deletes a project
func (*Client) DiscoverMCPTools ¶ added in v0.1.9
func (*Client) Execute ¶
func (c *Client) Execute(ctx context.Context, query string, variables map[string]interface{}, result interface{}) error
Execute performs a GraphQL request
func (*Client) ExecuteRaw ¶ added in v0.1.5
func (c *Client) ExecuteRaw(ctx context.Context, query string, variables map[string]interface{}) (*GraphQLResponse, error)
ExecuteRaw performs a GraphQL request and returns raw GraphQL response fields. Unlike Execute, this does not treat GraphQL errors as transport errors.
func (*Client) FindUserByIdentifier ¶ added in v0.1.2
FindUserByIdentifier finds a user by email, name, or displayName (case-insensitive).
func (*Client) GetComment ¶ added in v0.1.2
GetComment returns a single comment by ID.
func (*Client) GetIssueAgentSession ¶ added in v0.1.2
GetIssueAgentSession returns issue delegate and agent sessions in recent comments.
func (*Client) GetIssueComments ¶ added in v0.1.1
func (c *Client) GetIssueComments(ctx context.Context, issueID string, first int, after string, orderBy string) (*Comments, error)
GetIssueComments returns comments for a specific issue
func (*Client) GetIssueRelations ¶ added in v0.1.7
GetIssueRelations returns all relations for a given issue.
func (*Client) GetIssues ¶
func (c *Client) GetIssues(ctx context.Context, filter map[string]interface{}, first int, after string, orderBy string) (*Issues, error)
GetIssues returns a list of issues with optional filtering
func (*Client) GetProject ¶ added in v0.1.1
GetProject returns a single project by ID
func (*Client) GetProjectMilestones ¶ added in v0.1.2
func (c *Client) GetProjectMilestones(ctx context.Context, projectID string) ([]ProjectMilestone, error)
GetProjectMilestones returns all milestones for a specific project.
func (*Client) GetProjects ¶
func (c *Client) GetProjects(ctx context.Context, filter map[string]interface{}, first int, after string, orderBy string) (*Projects, error)
GetProjects returns a list of projects
func (*Client) GetRateLimit ¶
Rate limiting helper
func (*Client) GetTeamLabels ¶ added in v0.1.2
GetTeamLabels returns all issue labels for a team key.
func (*Client) GetTeamMembers ¶ added in v0.1.1
GetTeamMembers returns members of a specific team
func (*Client) GetTeamStates ¶ added in v0.1.1
GetTeamStates returns workflow states for a team
func (*Client) GetTeams ¶
func (c *Client) GetTeams(ctx context.Context, first int, after string, orderBy string) (*Teams, error)
GetTeams returns a list of teams
func (*Client) GetUsers ¶ added in v0.1.1
func (c *Client) GetUsers(ctx context.Context, first int, after string, orderBy string) (*Users, error)
GetUsers returns a list of all users
func (*Client) IssueSearch ¶ added in v0.1.2
func (c *Client) IssueSearch(ctx context.Context, term string, filter map[string]interface{}, first int, after string, orderBy string, includeArchived bool) (*Issues, error)
IssueSearch returns issues that match a full-text query
func (*Client) MentionAgent ¶ added in v0.1.2
func (c *Client) MentionAgent(ctx context.Context, issueID string, agentHandle string, message string) (string, error)
MentionAgent creates a comment that @mentions an agent handle.
func (*Client) UpdateComment ¶ added in v0.1.2
UpdateComment updates an existing comment by ID.
func (*Client) UpdateIssue ¶ added in v0.1.1
func (c *Client) UpdateIssue(ctx context.Context, id string, input map[string]interface{}) (*Issue, error)
UpdateIssue updates an issue's fields
func (*Client) UpdateLabel ¶ added in v0.1.2
func (c *Client) UpdateLabel(ctx context.Context, id string, input map[string]interface{}) (*Label, error)
UpdateLabel updates an existing issue label.
func (*Client) UpdateProject ¶ added in v0.1.2
func (c *Client) UpdateProject(ctx context.Context, id string, input map[string]interface{}) (*Project, error)
UpdateProject updates an existing project
func (*Client) UpdateWorkflowState ¶ added in v0.1.4
func (c *Client) UpdateWorkflowState(ctx context.Context, id string, input map[string]interface{}) (*WorkflowState, error)
UpdateWorkflowState updates an existing workflow state.
type Comment ¶ added in v0.1.1
type Comment struct {
ID string `json:"id"`
Body string `json:"body"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
EditedAt *time.Time `json:"editedAt"`
User *User `json:"user"`
Parent *Comment `json:"parent"`
Children *Comments `json:"children"`
AgentSession *AgentSession `json:"agentSession"`
}
Comment represents a Linear comment
type CustomerTicket ¶ added in v0.1.1
type Cycle ¶ added in v0.1.1
type Cycle struct {
ID string `json:"id"`
Number int `json:"number"`
Name string `json:"name"`
Description *string `json:"description"`
StartsAt string `json:"startsAt"`
EndsAt string `json:"endsAt"`
Progress float64 `json:"progress"`
CompletedAt *time.Time `json:"completedAt"`
ScopeHistory []float64 `json:"scopeHistory"`
}
Cycle represents a Linear cycle (sprint)
type Document ¶ added in v0.1.1
type Document struct {
ID string `json:"id"`
Title string `json:"title"`
Content string `json:"content"`
Icon *string `json:"icon"`
Color string `json:"color"`
Creator *User `json:"creator"`
UpdatedBy *User `json:"updatedBy"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
type ExternalUser ¶ added in v0.1.1
type GraphQLError ¶
type GraphQLError struct {
Message string `json:"message"`
Locations []GraphQLErrorLocation `json:"locations,omitempty"`
Path []interface{} `json:"path,omitempty"`
}
type GraphQLErrorLocation ¶
type GraphQLRequest ¶
type GraphQLResponse ¶
type GraphQLResponse struct {
Data json.RawMessage `json:"data"`
Errors []GraphQLError `json:"errors,omitempty"`
// Extensions may contain rate-limit/cost details and other server metadata.
Extensions json.RawMessage `json:"extensions,omitempty"`
}
type Initiative ¶ added in v0.1.1
type Initiative struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
}
Initiative represents a Linear initiative
type Issue ¶
type Issue struct {
ID string `json:"id"`
Identifier string `json:"identifier"`
Title string `json:"title"`
Description string `json:"description"`
Priority int `json:"priority"`
Estimate *float64 `json:"estimate"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
DueDate *string `json:"dueDate"`
State *State `json:"state"`
Assignee *User `json:"assignee"`
Team *Team `json:"team"`
Labels *Labels `json:"labels"`
Children *Issues `json:"children"`
Parent *Issue `json:"parent"`
URL string `json:"url"`
BranchName string `json:"branchName"`
Cycle *Cycle `json:"cycle"`
Project *Project `json:"project"`
ProjectMilestone *ProjectMilestone `json:"projectMilestone"`
Attachments *Attachments `json:"attachments"`
Comments *Comments `json:"comments"`
SnoozedUntilAt *time.Time `json:"snoozedUntilAt"`
CompletedAt *time.Time `json:"completedAt"`
CanceledAt *time.Time `json:"canceledAt"`
ArchivedAt *time.Time `json:"archivedAt"`
TriagedAt *time.Time `json:"triagedAt"`
CustomerTicketCount int `json:"customerTicketCount"`
PreviousIdentifiers []string `json:"previousIdentifiers"`
// Additional fields
Number int `json:"number"`
BoardOrder float64 `json:"boardOrder"`
SubIssueSortOrder float64 `json:"subIssueSortOrder"`
PriorityLabel string `json:"priorityLabel"`
IntegrationSourceType *string `json:"integrationSourceType"`
Creator *User `json:"creator"`
Subscribers *Users `json:"subscribers"`
Relations *IssueRelations `json:"relations"`
History *IssueHistory `json:"history"`
Reactions []Reaction `json:"reactions"`
SlackIssueComments []SlackComment `json:"slackIssueComments"`
ExternalUserCreator *ExternalUser `json:"externalUserCreator"`
CustomerTickets []CustomerTicket `json:"customerTickets"`
Delegate *User `json:"delegate"`
}
Issue represents a Linear issue
type IssueHistory ¶ added in v0.1.1
type IssueHistory struct {
Nodes []IssueHistoryEntry `json:"nodes"`
}
type IssueHistoryEntry ¶ added in v0.1.1
type IssueHistoryEntry struct {
ID string `json:"id"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Changes string `json:"changes"`
Actor *User `json:"actor"`
FromAssignee *User `json:"fromAssignee"`
ToAssignee *User `json:"toAssignee"`
FromState *State `json:"fromState"`
ToState *State `json:"toState"`
FromPriority *int `json:"fromPriority"`
ToPriority *int `json:"toPriority"`
FromTitle *string `json:"fromTitle"`
ToTitle *string `json:"toTitle"`
FromCycle *Cycle `json:"fromCycle"`
ToCycle *Cycle `json:"toCycle"`
FromProject *Project `json:"fromProject"`
ToProject *Project `json:"toProject"`
AddedLabelIds []string `json:"addedLabelIds"`
RemovedLabelIds []string `json:"removedLabelIds"`
}
type IssueRelation ¶ added in v0.1.1
type IssueRelations ¶ added in v0.1.1
type IssueRelations struct {
Nodes []IssueRelation `json:"nodes"`
}
Additional types for expanded fields
type MCPTool ¶ added in v0.1.9
type MCPTool struct {
Name string `json:"name"`
Kind string `json:"kind"`
SourceField string `json:"sourceField"`
Description string `json:"description,omitempty"`
Args []MCPArg `json:"args,omitempty"`
ReturnType string `json:"returnType"`
ReturnNamedType string `json:"returnNamedType"`
ReturnNamedKind string `json:"returnNamedKind"`
DefaultSelection string `json:"defaultSelection,omitempty"`
}
type Project ¶
type Project struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
State string `json:"state"`
Progress float64 `json:"progress"`
StartDate *string `json:"startDate"`
TargetDate *string `json:"targetDate"`
Lead *User `json:"lead"`
Teams *Teams `json:"teams"`
URL string `json:"url"`
Icon *string `json:"icon"`
Color string `json:"color"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
CompletedAt *time.Time `json:"completedAt"`
CanceledAt *time.Time `json:"canceledAt"`
ArchivedAt *time.Time `json:"archivedAt"`
Creator *User `json:"creator"`
Members *Users `json:"members"`
Issues *Issues `json:"issues"`
// Additional fields
SlugId string `json:"slugId"`
Content string `json:"content"`
ConvertedFromIssue *Issue `json:"convertedFromIssue"`
LastAppliedTemplate *Template `json:"lastAppliedTemplate"`
ProjectUpdates *ProjectUpdates `json:"projectUpdates"`
Documents *Documents `json:"documents"`
Health string `json:"health"`
Scope int `json:"scope"`
SlackNewIssue bool `json:"slackNewIssue"`
SlackIssueComments bool `json:"slackIssueComments"`
SlackIssueStatuses bool `json:"slackIssueStatuses"`
}
Project represents a Linear project
type ProjectLink ¶ added in v0.1.1
type ProjectLinks ¶ added in v0.1.1
type ProjectLinks struct {
Nodes []ProjectLink `json:"nodes"`
}
type ProjectMilestone ¶ added in v0.1.2
type ProjectMilestone struct {
ID string `json:"id"`
Name string `json:"name"`
Description *string `json:"description"`
TargetDate *string `json:"targetDate"`
SortOrder float64 `json:"sortOrder"`
CreatedAt *time.Time `json:"createdAt"`
UpdatedAt *time.Time `json:"updatedAt"`
}
ProjectMilestone represents a milestone within a Linear project.
type ProjectUpdate ¶ added in v0.1.1
type ProjectUpdates ¶ added in v0.1.1
type ProjectUpdates struct {
Nodes []ProjectUpdate `json:"nodes"`
}
type SlackComment ¶ added in v0.1.1
type State ¶
type State struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Color string `json:"color"`
Description *string `json:"description"`
Position float64 `json:"position"`
}
State represents an issue state
type Team ¶
type Team struct {
ID string `json:"id"`
Key string `json:"key"`
Name string `json:"name"`
Description string `json:"description"`
Icon *string `json:"icon"`
Color string `json:"color"`
Private bool `json:"private"`
IssueCount int `json:"issueCount"`
CyclesEnabled bool `json:"cyclesEnabled"`
CycleStartDay int `json:"cycleStartDay"`
CycleDuration int `json:"cycleDuration"`
UpcomingCycleCount int `json:"upcomingCycleCount"`
}
Team represents a Linear team
type User ¶
type User struct {
ID string `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
AvatarURL string `json:"avatarUrl"`
DisplayName string `json:"displayName"`
IsMe bool `json:"isMe"`
Active bool `json:"active"`
Admin bool `json:"admin"`
CreatedAt *time.Time `json:"createdAt"`
}
User represents a Linear user