Documentation
¶
Overview ¶
Package pm provides a DataSource connector for issue-tracking systems. The Linear (and optionally other) backend can list issues and return them as NormalizedItems for vectorization. Scope uses LinearTeamIDs; when the underlying ListIssues does not support team filter yet, all listed issues are returned.
Index ¶
- Constants
- func AllTools(s Service) []tool.Tool
- func NewAddCommentTool(s Service) tool.CallableTool
- func NewAddLabelTool(s Service) tool.CallableTool
- func NewAssignIssueTool(s Service) tool.CallableTool
- func NewCreateIssueTool(s Service) tool.CallableTool
- func NewGetIssueTool(s Service) tool.CallableTool
- func NewListCommentsTool(s Service) tool.CallableTool
- func NewListIssuesTool(s Service) tool.CallableTool
- func NewListLabelsTool(s Service) tool.CallableTool
- func NewListTeamsTool(s Service) tool.CallableTool
- func NewListUsersTool(s Service) tool.CallableTool
- func NewSearchIssuesTool(s Service) tool.CallableTool
- func NewUpdateIssueTool(s Service) tool.CallableTool
- type AddCommentRequest
- type AddLabelRequest
- type AssignIssueRequest
- type Comment
- type Config
- type CreateIssueRequest
- type GetIssueRequest
- type Issue
- type IssueFilter
- type IssueInput
- type IssueUpdate
- type Label
- type LinearConnector
- type ListCommentsRequest
- type ListIssuesRequest
- type ListLabelsRequest
- type ListTeamsRequest
- type ListUsersRequest
- type SearchIssuesRequest
- type Service
- type Team
- type ToolProvider
- type UpdateIssueRequest
- type User
Constants ¶
const ( ProviderJira = "jira" ProviderLinear = "linear" ProviderAsana = "asana" )
Supported provider names.
Variables ¶
This section is empty.
Functions ¶
func NewAddCommentTool ¶
func NewAddCommentTool(s Service) tool.CallableTool
func NewAddLabelTool ¶
func NewAddLabelTool(s Service) tool.CallableTool
func NewAssignIssueTool ¶
func NewAssignIssueTool(s Service) tool.CallableTool
func NewCreateIssueTool ¶
func NewCreateIssueTool(s Service) tool.CallableTool
func NewGetIssueTool ¶
func NewGetIssueTool(s Service) tool.CallableTool
func NewListCommentsTool ¶
func NewListCommentsTool(s Service) tool.CallableTool
func NewListIssuesTool ¶
func NewListIssuesTool(s Service) tool.CallableTool
func NewListLabelsTool ¶
func NewListLabelsTool(s Service) tool.CallableTool
func NewListTeamsTool ¶
func NewListTeamsTool(s Service) tool.CallableTool
func NewListUsersTool ¶
func NewListUsersTool(s Service) tool.CallableTool
func NewSearchIssuesTool ¶
func NewSearchIssuesTool(s Service) tool.CallableTool
func NewUpdateIssueTool ¶
func NewUpdateIssueTool(s Service) tool.CallableTool
Types ¶
type AddCommentRequest ¶
type AddLabelRequest ¶
type AssignIssueRequest ¶
type Config ¶
type Config struct {
Provider string `yaml:"provider,omitempty" toml:"provider,omitempty"` // jira, linear, asana
APIToken string `yaml:"api_token,omitempty" toml:"api_token,omitempty"`
BaseURL string `yaml:"base_url,omitempty" toml:"base_url,omitempty"` // Jira: required; Linear/Asana: optional override
Email string `yaml:"email,omitempty" toml:"email,omitempty"` // Jira only: email for Basic auth
}
Config holds configuration for PM providers.
type CreateIssueRequest ¶
type CreateIssueRequest struct {
Title string `json:"title" jsonschema:"description=Issue Title,required"`
Description string `json:"description" jsonschema:"description=Issue Description"`
Project string `json:"project" jsonschema:"description=Project Key/ID,required"`
Type string `json:"type" jsonschema:"description=Issue Type (Bug Task Story),required"`
}
type GetIssueRequest ¶
type GetIssueRequest struct {
ID string `json:"id" jsonschema:"description=Issue ID (e.g. PROJ-123),required"`
}
type IssueFilter ¶
type IssueFilter struct {
Status string // optional: filter by status (e.g. "open", "in_progress", "closed")
}
IssueFilter controls which issues are returned by ListIssues.
type IssueInput ¶
type IssueUpdate ¶
type IssueUpdate struct {
Title *string // nil = no change
Description *string
Status *string // workflow state name (e.g. "In Progress", "Done")
}
IssueUpdate holds optional fields for updating an issue.
type LinearConnector ¶
type LinearConnector struct {
// contains filtered or unexported fields
}
LinearConnector implements datasource.DataSource for Linear (and any pm.Service that supports ListIssues). It lists issues and returns one NormalizedItem per issue for the sync pipeline to vectorize.
func NewLinearConnector ¶
func NewLinearConnector(svc Service) *LinearConnector
NewLinearConnector returns a DataSource that lists issues from the given pm.Service. When the config provider is Linear, scope.LinearTeamIDs is intended to filter by team; the current Linear API in this package lists all issues (team filter can be added later to the GraphQL query).
func (*LinearConnector) ListItems ¶
func (c *LinearConnector) ListItems(ctx context.Context, scope datasource.Scope) ([]datasource.NormalizedItem, error)
ListItems lists issues via the pm.Service (e.g. Linear ListIssues) and returns one NormalizedItem per issue with ID "linear:identifier". Content is title + description; metadata includes status and assignee.
func (*LinearConnector) Name ¶
func (c *LinearConnector) Name() string
Name returns the source identifier for Linear.
type ListCommentsRequest ¶
type ListCommentsRequest struct {
IssueID string `json:"issue_id" jsonschema:"description=Issue ID to list comments for,required"`
}
type ListIssuesRequest ¶
type ListIssuesRequest struct {
Status string `json:"status" jsonschema:"description=Optional status filter: open or closed. Defaults to open."`
}
type ListLabelsRequest ¶
type ListLabelsRequest struct {
TeamID string `json:"team_id" jsonschema:"description=Team ID to list labels for (use pm_list_teams to discover),required"`
}
type ListTeamsRequest ¶
type ListTeamsRequest struct{}
type ListUsersRequest ¶
type ListUsersRequest struct{}
type SearchIssuesRequest ¶
type SearchIssuesRequest struct {
Query string `json:"query" jsonschema:"description=Free-text search query,required"`
}
type Service ¶
type Service interface {
// Supported returns the list of operation names this provider implements.
Supported() []string
// Validate performs a lightweight health check to verify that the
// provider's token is valid and the endpoint is reachable.
Validate(ctx context.Context) error
GetIssue(ctx context.Context, id string) (*Issue, error)
ListIssues(ctx context.Context, filter IssueFilter) ([]*Issue, error)
CreateIssue(ctx context.Context, input IssueInput) (*Issue, error)
AssignIssue(ctx context.Context, id string, assignee string) error
UpdateIssue(ctx context.Context, id string, update IssueUpdate) (*Issue, error)
AddComment(ctx context.Context, issueID string, body string) (*Comment, error)
ListComments(ctx context.Context, issueID string) ([]*Comment, error)
SearchIssues(ctx context.Context, query string) ([]*Issue, error)
ListTeams(ctx context.Context) ([]*Team, error)
ListLabels(ctx context.Context, teamID string) ([]*Label, error)
AddLabel(ctx context.Context, issueID string, labelID string) error
ListUsers(ctx context.Context) ([]*User, error)
}
Service abstracts Issue Tracking Systems (JIRA, Linear, Asana).
type ToolProvider ¶
type ToolProvider struct {
// contains filtered or unexported fields
}
ToolProvider wraps a PM Service and satisfies the tools.ToolProviders interface so project management tools can be passed directly to tools.NewRegistry. Without this, PM tool construction would be inlined in the registry.
func NewToolProvider ¶
func NewToolProvider(svc Service) *ToolProvider
NewToolProvider creates a ToolProvider from an already-initialised PM service. Callers are responsible for creating and validating the service beforehand.
func (*ToolProvider) GetTools ¶
func (p *ToolProvider) GetTools() []tool.Tool
GetTools returns all PM tools wired to the underlying service.
type UpdateIssueRequest ¶
type UpdateIssueRequest struct {
ID string `json:"id" jsonschema:"description=Issue ID,required"`
Title *string `json:"title" jsonschema:"description=New title (omit to keep current)"`
Description *string `json:"description" jsonschema:"description=New description (omit to keep current)"`
Status *string `json:"status" jsonschema:"description=New status/state name e.g. In Progress or Done (omit to keep current)"`
}