pm

package
v0.1.5 Latest Latest
Warning

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

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

README

pkg/tools/pm — Project Management Tools

Unified interface for issue tracking across Linear, Jira, and Asana.

Tools

Tool Name Description
projectmanagement_get_issue Get details of a single issue by ID (e.g. PROJ-123)
projectmanagement_list_issues List issues. Returns open issues by default; use status=closed for completed
projectmanagement_create_issue Create a new issue with title, description, project, and type
projectmanagement_assign_issue Assign an issue to a user

Configuration

In .genie.toml:

[project_management]
provider = "linear"          # linear, jira, or asana
api_token = "${PM_API_TOKEN}"
base_url = "https://linear.app/"  # Required for Jira; optional for Linear/Asana
# email = "[email protected]" # Jira only: required for Basic auth

Service Interface

type Service interface {
    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
}

Provider Details

  • Linear — GraphQL API (https://api.linear.app/graphql). ListIssues filters by state type (unstarted/started for open, completed/canceled for closed).
  • Jira — REST API v3. ListIssues uses JQL search (statusCategory != Done).
  • Asana — REST API v1. ListIssues uses the tasks endpoint with completed_since=now for open tasks.

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

View Source
const (
	ProviderJira   = "jira"
	ProviderLinear = "linear"
	ProviderAsana  = "asana"
)

Supported provider names.

Variables

This section is empty.

Functions

func AllTools

func AllTools(s Service) []tool.Tool

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 AddCommentRequest struct {
	IssueID string `json:"issue_id" jsonschema:"description=Issue ID to comment on,required"`
	Body    string `json:"body" jsonschema:"description=Comment body text,required"`
}

type AddLabelRequest

type AddLabelRequest struct {
	IssueID string `json:"issue_id" jsonschema:"description=Issue ID,required"`
	LabelID string `json:"label_id" jsonschema:"description=Label ID to add (use pm_list_labels to discover),required"`
}

type AssignIssueRequest

type AssignIssueRequest struct {
	ID       string `json:"id" jsonschema:"description=Issue ID,required"`
	Assignee string `json:"assignee" jsonschema:"description=User to assign to,required"`
}

type Comment

type Comment struct {
	ID     string `json:"id"`
	Body   string `json:"body"`
	Author string `json:"author,omitempty"`
}

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 Issue

type Issue struct {
	ID          string   `json:"id"`
	Title       string   `json:"title"`
	Description string   `json:"description,omitempty"`
	Status      string   `json:"status,omitempty"`
	Assignee    string   `json:"assignee,omitempty"`
	Labels      []string `json:"labels,omitempty"`
}

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 IssueInput struct {
	Title       string
	Description string
	Project     string
	Type        string
}

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 Label

type Label struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Color string `json:"color,omitempty"`
}

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

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).

func New

func New(cfg Config) (Service, error)

New creates a new PM Service based on the configuration.

type Team

type Team struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Key  string `json:"key,omitempty"`
}

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)"`
}

type User

type User struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Email string `json:"email,omitempty"`
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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