services

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MockUpdateStatusForTests bool

MockUpdateStatusForTests is a flag that can be set to disable UI updates during testing

Functions

func ApplyCommitToNewRepo added in v0.2.0

func ApplyCommitToNewRepo(originalRepo *git.Repository, newRepoPath, commitID, newMessage string) error

ApplyCommitToNewRepo applies a commit from the original repo to the new repo

func CheckOllamaAvailability added in v0.2.0

func CheckOllamaAvailability() error

CheckOllamaAvailability checks if the Ollama server is available

func ConfigureNewRepository added in v0.2.0

func ConfigureNewRepository(sourceRepoPath, newRepoPath string) error

ConfigureNewRepository sets up the new repository with the same branch name and remote as the source

func CreateNewRepository added in v0.2.0

func CreateNewRepository(sourceRepoPath string, targetRepoName string, defaultBranch string) error

CreateNewRepository creates a new empty git repository at the specified path with the given default branch name The new repository is created as a sibling directory to the source repository

func EstimateTokenCount added in v0.2.0

func EstimateTokenCount(text string) int

EstimateTokenCount provides a rough estimate of token count for text

func ExecuteCommand

func ExecuteCommand(command string, args []string, dir string) error

ExecuteCommand runs a command and returns an error if it fails

func GenerateNewCommitMessage

func GenerateNewCommitMessage(commit models.CommitOutput, model string, temperature float64, contextSize int) (models.NewCommitMessage, error)

GenerateNewCommitMessage generates a new commit message using Ollama

func GenerateSimplifiedCommitMessage added in v0.2.0

func GenerateSimplifiedCommitMessage(commit models.CommitOutput, model string, temperature float64, contextSize int) (string, error)

GenerateSimplifiedCommitMessage generates a one-line commit message for large commits

func GetCommandOutput

func GetCommandOutput(command string, args []string, dir string) (string, error)

GetCommandOutput runs a command and returns its output

func GetCommitsChronological added in v0.2.0

func GetCommitsChronological(repo *git.Repository, maxMsgLength, maxDiffLength int) ([]models.CommitOutput, []models.CommitOutput, error)

GetCommitsChronological returns ALL commits from oldest to newest

func GetCommitsToRewrite

func GetCommitsToRewrite(repo *git.Repository, maxMsgLength, maxDiffLength int) ([]models.CommitOutput, error)

GetCommitsToRewrite gets a list of commits that need to be rewritten

func GetCurrentBranchName added in v0.2.0

func GetCurrentBranchName(repoPath string) (string, error)

GetCurrentBranchName gets the name of the current branch

func GetDefaultBranchName added in v0.2.0

func GetDefaultBranchName(repoPath string) (string, error)

GetDefaultBranchName gets the default branch name of the repository

func GetModelContextSize added in v0.2.0

func GetModelContextSize(model string) (int, error)

GetModelContextSize retrieves the context window size for a model

func GetRemoteOriginURL added in v0.2.0

func GetRemoteOriginURL(repoPath string) (string, error)

GetRemoteOriginURL gets the URL of the remote origin

func GetRepoName

func GetRepoName(repoPath string) string

GetRepoName extracts the name of a repository from its path

func RewordCommit

func RewordCommit(repoPath, targetCommit, newMessage string) error

RewordCommit changes the message of a specific git commit

func SendOllamaMessage

func SendOllamaMessage(model string, messages []ollama.Message, format json.RawMessage, temperature float64) (string, error)

SendOllamaMessage sends a request to the Ollama API

Types

This section is empty.

Jump to

Keyboard shortcuts

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