ports

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommitSummarizer

type CommitSummarizer interface {
	// GenerateSuggestions generates a list of commit message suggestions.
	GenerateSuggestions(ctx context.Context, info models.CommitInfo, count int) ([]models.CommitSuggestion, error)
}

CommitSummarizer is an interface that defines the service to generate commit suggestions.

type CostAwareAIProvider

type CostAwareAIProvider interface {
	// CountTokens counts the tokens of a prompt without making the actual model call.
	// This allows estimating the cost before executing the generation.
	CountTokens(ctx context.Context, prompt string) (int, error)

	// GetModelName returns the name of the current model (e.g.: "gemini-2.5-flash")
	GetModelName() string

	// GetProviderName returns the name of the provider (e.g.: "gemini", "openai", "anthropic")
	GetProviderName() string
}

CostAwareAIProvider defines the interface for AI providers that support cost tracking.

type DependencyAnalyzer

type DependencyAnalyzer interface {
	// CanHandle detects if this analyzer can handle the project
	CanHandle(ctx context.Context, vcsClient VCSClient, previousTag, currentTag string) bool

	// AnalyzeChanges analyzes dependency changes between two versions
	AnalyzeChanges(ctx context.Context, vcsClient VCSClient, previousTag, currentTag string) ([]models.DependencyChange, error)

	// Name returns the name of the dependency manager
	Name() string
}

DependencyAnalyzer defines the interface to analyze dependencies for different languages

type IssueContentGenerator

type IssueContentGenerator interface {
	// GenerateIssueContent generates the title, description, and labels of an issue
	// based on the context provided in the request.
	GenerateIssueContent(ctx context.Context, request models.IssueGenerationRequest) (*models.IssueGenerationResult, error)
}

IssueContentGenerator defines the interface to generate issue content with AI.

type PRSummarizer

type PRSummarizer interface {
	// GeneratePRSummary generates a summary of a Pull Request given a prompt.
	GeneratePRSummary(ctx context.Context, prompt string) (models.PRSummary, error)
}

PRSummarizer defines the interface for services that summarize Pull Requests.

type ReleaseNotesGenerator

type ReleaseNotesGenerator interface {
	GenerateNotes(ctx context.Context, release *models.Release) (*models.ReleaseNotes, error)
}

ReleaseNotesGenerator defines the interface to generate release notes.

type TickerManager

type TickerManager interface {
	GetTicketInfo(ticketID string) (*models.TicketInfo, error)
}

type TokenCounter

type TokenCounter interface {
	CountTokens(ctx context.Context, content string) (int, error)
}

TokenCounter is a simpler interface for providers that only need to count tokens.

type VCSClient

type VCSClient interface {
	// UpdatePR updates a Pull Request (title, body, and labels) in the provider.
	UpdatePR(ctx context.Context, prNumber int, summary models.PRSummary) error
	// GetPR gets the PR data (for example, to extract commits, diff, etc.).
	GetPR(ctx context.Context, prNumber int) (models.PRData, error)
	// GetRepoLabels gets all available labels in the repository
	GetRepoLabels(ctx context.Context) ([]string, error)
	// CreateLabel creates a new label in the repository
	CreateLabel(ctx context.Context, name string, color string, description string) error
	// AddLabelsToPR adds specific labels to a PR
	AddLabelsToPR(ctx context.Context, prNumber int, labels []string) error
	// CreateRelease creates a new release in the repository
	// buildBinaries indicates whether binaries should be compiled and uploaded (optional, only some providers support it)
	CreateRelease(ctx context.Context, release *models.Release, notes *models.ReleaseNotes, draft bool, buildBinaries bool) error
	// GetRelease gets the release from the repository
	GetRelease(ctx context.Context, version string) (*models.VCSRelease, error)
	// UpdateRelease updates a release from the repository
	UpdateRelease(ctx context.Context, version, body string) error
	// GetClosedIssuesBetweenTags gets closed issues between two tags
	GetClosedIssuesBetweenTags(ctx context.Context, previousTag, currentTag string) ([]models.Issue, error)
	// GetMergedPRsBetweenTags gets merged PRs between two tags
	GetMergedPRsBetweenTags(ctx context.Context, previousTag, currentTag string) ([]models.PullRequest, error)
	// GetContributorsBetweenTags gets contributors between two tags
	GetContributorsBetweenTags(ctx context.Context, previousTag, currentTag string) ([]string, error)
	// GetFileStatsBetweenTags gets file statistics between two tags
	GetFileStatsBetweenTags(ctx context.Context, previousTag, currentTag string) (*models.FileStatistics, error)
	// GetIssue gets information for an issue/ticket by its number
	GetIssue(ctx context.Context, issueNumber int) (*models.Issue, error)
	// GetFileAtTag gets the content of a file at a specific tag
	GetFileAtTag(ctx context.Context, tag, filepath string) (string, error)
	// GetPRIssues gets issues related to a PR based on branch name, commits, and description
	GetPRIssues(ctx context.Context, branchName string, commits []string, prDescription string) ([]models.Issue, error)
	// UpdateIssueChecklist updates the checklist of an issue marking items as completed
	UpdateIssueChecklist(ctx context.Context, issueNumber int, indices []int) error
	// CreateIssue creates a new issue in the repository
	CreateIssue(ctx context.Context, title string, body string, labels []string, assignees []string) (*models.Issue, error)
	// GetAuthenticatedUser gets the current authenticated user
	GetAuthenticatedUser(ctx context.Context) (string, error)
}

VCSClient defines common methods to interact with the APIs of version control systems.

Jump to

Keyboard shortcuts

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