Documentation
¶
Overview ¶
Package middleware provides AIGitClient, a transparent wrapper around git.GitClient that intercepts operations with AI enhancements while delegating all other methods to the inner client.
Index ¶
- type AIGitClient
- func (c *AIGitClient) AnalyzeBisect(ctx context.Context, good, bad string) (*ops.BisectAnalysis, error)
- func (c *AIGitClient) AnalyzeBranches(ctx context.Context) ([]ops.BranchRecommendation, error)
- func (c *AIGitClient) BisectBad(ctx context.Context) (string, error)
- func (c *AIGitClient) BisectGood(ctx context.Context) (string, error)
- func (c *AIGitClient) BisectReset(ctx context.Context) error
- func (c *AIGitClient) BisectStart(ctx context.Context, bad, good string) error
- func (c *AIGitClient) Blame(ctx context.Context, path string) ([]git.BlameLine, error)
- func (c *AIGitClient) BranchCreate(ctx context.Context, name string, base string) error
- func (c *AIGitClient) BranchDelete(ctx context.Context, name string, force bool) error
- func (c *AIGitClient) BranchList(ctx context.Context) ([]git.Branch, error)
- func (c *AIGitClient) BranchRename(ctx context.Context, oldName, newName string) error
- func (c *AIGitClient) Checkout(ctx context.Context, ref string) error
- func (c *AIGitClient) CherryPick(ctx context.Context, commitHash string) error
- func (c *AIGitClient) Commit(ctx context.Context, msg string, opts git.CommitOpts) (string, error)
- func (c *AIGitClient) Diff(ctx context.Context, opts git.DiffOpts) ([]git.FileDiff, error)
- func (c *AIGitClient) DiffFileNames(ctx context.Context, commitA, commitB string) ([]string, error)
- func (c *AIGitClient) DiffTreeFiles(ctx context.Context, hash string) ([]string, error)
- func (c *AIGitClient) DiscardAllUnstaged(ctx context.Context) error
- func (c *AIGitClient) DiscardFile(ctx context.Context, path string) error
- func (c *AIGitClient) Fetch(ctx context.Context, opts git.FetchOpts) error
- func (c *AIGitClient) GenerateChangelog(ctx context.Context, fromRef, toRef string) ([]ops.ChangelogEntry, error)
- func (c *AIGitClient) GenerateCommitMessage(ctx context.Context) (*ops.CommitSuggestion, error)
- func (c *AIGitClient) GeneratePRDescription(ctx context.Context, targetBranch string) (*ops.PRDescription, error)
- func (c *AIGitClient) IsRepo(ctx context.Context) (bool, error)
- func (c *AIGitClient) Log(ctx context.Context, opts git.LogOpts) ([]git.Commit, error)
- func (c *AIGitClient) Merge(ctx context.Context, branch string, opts git.MergeOpts) error
- func (c *AIGitClient) MergeAbort(ctx context.Context) error
- func (c *AIGitClient) Pull(ctx context.Context, opts git.PullOpts) error
- func (c *AIGitClient) Push(ctx context.Context, opts git.PushOpts) error
- func (c *AIGitClient) Rebase(ctx context.Context, onto string, opts git.RebaseOpts) error
- func (c *AIGitClient) RebaseAbort(ctx context.Context) error
- func (c *AIGitClient) RebaseContinue(ctx context.Context) error
- func (c *AIGitClient) Reflog(ctx context.Context, ref string, limit int) ([]git.ReflogEntry, error)
- func (c *AIGitClient) RemoteAdd(ctx context.Context, name, url string) error
- func (c *AIGitClient) RemoteList(ctx context.Context) ([]git.Remote, error)
- func (c *AIGitClient) RemoteRemove(ctx context.Context, name string) error
- func (c *AIGitClient) RepoRoot(ctx context.Context) (string, error)
- func (c *AIGitClient) Reset(ctx context.Context, ref string, mode git.ResetMode) error
- func (c *AIGitClient) Revert(ctx context.Context, hash string) error
- func (c *AIGitClient) RevertAbort(ctx context.Context) error
- func (c *AIGitClient) RevertContinue(ctx context.Context) error
- func (c *AIGitClient) ReviewDiff(ctx context.Context, opts git.DiffOpts) ([]ops.ReviewFinding, error)
- func (c *AIGitClient) Stage(ctx context.Context, paths []string) error
- func (c *AIGitClient) StageHunk(ctx context.Context, path string, hunk git.Hunk) error
- func (c *AIGitClient) StageLine(ctx context.Context, path string, hunk git.Hunk, lineIdx int) error
- func (c *AIGitClient) StashApply(ctx context.Context, index int) error
- func (c *AIGitClient) StashDrop(ctx context.Context, index int) error
- func (c *AIGitClient) StashList(ctx context.Context) ([]git.StashEntry, error)
- func (c *AIGitClient) StashPop(ctx context.Context, index int) error
- func (c *AIGitClient) StashPush(ctx context.Context, opts git.StashOpts) error
- func (c *AIGitClient) StashShow(ctx context.Context, index int) (string, error)
- func (c *AIGitClient) Status(ctx context.Context) ([]git.FileStatus, error)
- func (c *AIGitClient) SuggestRebase(ctx context.Context, onto string) (*ops.RebaseSuggestion, error)
- func (c *AIGitClient) SuggestSplit(ctx context.Context, commitHash string) (*ops.SplitPlan, error)
- func (c *AIGitClient) TagCreate(ctx context.Context, name, ref, message string) error
- func (c *AIGitClient) TagDelete(ctx context.Context, name string) error
- func (c *AIGitClient) TagList(ctx context.Context) ([]git.Tag, error)
- func (c *AIGitClient) TagListRemote(ctx context.Context, remote string) ([]git.Tag, error)
- func (c *AIGitClient) TagPush(ctx context.Context, remote, name string) error
- func (c *AIGitClient) TagPushAll(ctx context.Context, remote string) error
- func (c *AIGitClient) Unstage(ctx context.Context, paths []string) error
- func (c *AIGitClient) UnstageHunk(ctx context.Context, path string, hunk git.Hunk) error
- func (c *AIGitClient) UnstageLine(ctx context.Context, path string, hunk git.Hunk, lineIdx int) error
- func (c *AIGitClient) WorktreeAdd(ctx context.Context, path, branch string) error
- func (c *AIGitClient) WorktreeList(ctx context.Context) ([]git.Worktree, error)
- func (c *AIGitClient) WorktreeRemove(ctx context.Context, path string, force bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AIGitClient ¶
type AIGitClient struct {
// contains filtered or unexported fields
}
AIGitClient wraps a git.GitClient to transparently intercept operations with AI enhancements. Unintercepted methods delegate directly to the inner client.
func NewAIGitClient ¶
func NewAIGitClient( inner git.GitClient, registry *ai.Registry, builder *ai.Builder, audit *ai.AuditLogger, cfg config.AIConfig, ) *AIGitClient
NewAIGitClient creates an AI-enhanced git client wrapper.
func (*AIGitClient) AnalyzeBisect ¶
func (c *AIGitClient) AnalyzeBisect(ctx context.Context, good, bad string) (*ops.BisectAnalysis, error)
AnalyzeBisect provides AI-enhanced bisect analysis.
func (*AIGitClient) AnalyzeBranches ¶
func (c *AIGitClient) AnalyzeBranches(ctx context.Context) ([]ops.BranchRecommendation, error)
AnalyzeBranches recommends branch cleanup actions.
func (*AIGitClient) BisectBad ¶
func (c *AIGitClient) BisectBad(ctx context.Context) (string, error)
func (*AIGitClient) BisectGood ¶
func (c *AIGitClient) BisectGood(ctx context.Context) (string, error)
func (*AIGitClient) BisectReset ¶
func (c *AIGitClient) BisectReset(ctx context.Context) error
func (*AIGitClient) BisectStart ¶
func (c *AIGitClient) BisectStart(ctx context.Context, bad, good string) error
func (*AIGitClient) BranchCreate ¶
func (*AIGitClient) BranchDelete ¶
func (*AIGitClient) BranchList ¶
func (*AIGitClient) BranchRename ¶
func (c *AIGitClient) BranchRename(ctx context.Context, oldName, newName string) error
func (*AIGitClient) Checkout ¶
func (c *AIGitClient) Checkout(ctx context.Context, ref string) error
func (*AIGitClient) CherryPick ¶
func (c *AIGitClient) CherryPick(ctx context.Context, commitHash string) error
func (*AIGitClient) Commit ¶
func (c *AIGitClient) Commit(ctx context.Context, msg string, opts git.CommitOpts) (string, error)
Commit intercepts the commit operation. When cfg.AutoCommitMsg is true and msg is empty, it generates an AI commit message before delegating to the inner client. AI failures never block the git operation.
func (*AIGitClient) DiffFileNames ¶ added in v0.0.2
func (*AIGitClient) DiffTreeFiles ¶
func (*AIGitClient) DiscardAllUnstaged ¶
func (c *AIGitClient) DiscardAllUnstaged(ctx context.Context) error
func (*AIGitClient) DiscardFile ¶
func (c *AIGitClient) DiscardFile(ctx context.Context, path string) error
func (*AIGitClient) GenerateChangelog ¶
func (c *AIGitClient) GenerateChangelog(ctx context.Context, fromRef, toRef string) ([]ops.ChangelogEntry, error)
GenerateChangelog creates an AI-powered changelog.
func (*AIGitClient) GenerateCommitMessage ¶
func (c *AIGitClient) GenerateCommitMessage(ctx context.Context) (*ops.CommitSuggestion, error)
GenerateCommitMessage generates an AI commit message without committing.
func (*AIGitClient) GeneratePRDescription ¶
func (c *AIGitClient) GeneratePRDescription(ctx context.Context, targetBranch string) (*ops.PRDescription, error)
GeneratePRDescription generates an AI PR description.
func (*AIGitClient) Merge ¶
Merge delegates to the inner client and, on conflict, triggers AI conflict resolution. AI failures never block the git operation — the original merge error is returned so the caller can handle it.
func (*AIGitClient) MergeAbort ¶
func (c *AIGitClient) MergeAbort(ctx context.Context) error
func (*AIGitClient) Rebase ¶
func (c *AIGitClient) Rebase(ctx context.Context, onto string, opts git.RebaseOpts) error
Rebase delegates to the inner client and, on conflict, triggers AI conflict resolution. AI failures never block the git operation.
func (*AIGitClient) RebaseAbort ¶
func (c *AIGitClient) RebaseAbort(ctx context.Context) error
func (*AIGitClient) RebaseContinue ¶
func (c *AIGitClient) RebaseContinue(ctx context.Context) error
func (*AIGitClient) Reflog ¶
func (c *AIGitClient) Reflog(ctx context.Context, ref string, limit int) ([]git.ReflogEntry, error)
func (*AIGitClient) RemoteAdd ¶
func (c *AIGitClient) RemoteAdd(ctx context.Context, name, url string) error
func (*AIGitClient) RemoteList ¶
func (*AIGitClient) RemoteRemove ¶
func (c *AIGitClient) RemoteRemove(ctx context.Context, name string) error
func (*AIGitClient) RevertAbort ¶
func (c *AIGitClient) RevertAbort(ctx context.Context) error
func (*AIGitClient) RevertContinue ¶
func (c *AIGitClient) RevertContinue(ctx context.Context) error
func (*AIGitClient) ReviewDiff ¶
func (c *AIGitClient) ReviewDiff(ctx context.Context, opts git.DiffOpts) ([]ops.ReviewFinding, error)
ReviewDiff performs an AI code review on the given diff.
func (*AIGitClient) StashApply ¶
func (c *AIGitClient) StashApply(ctx context.Context, index int) error
func (*AIGitClient) StashDrop ¶
func (c *AIGitClient) StashDrop(ctx context.Context, index int) error
func (*AIGitClient) StashList ¶
func (c *AIGitClient) StashList(ctx context.Context) ([]git.StashEntry, error)
func (*AIGitClient) Status ¶
func (c *AIGitClient) Status(ctx context.Context) ([]git.FileStatus, error)
func (*AIGitClient) SuggestRebase ¶
func (c *AIGitClient) SuggestRebase(ctx context.Context, onto string) (*ops.RebaseSuggestion, error)
SuggestRebase provides AI-powered rebase suggestions.
func (*AIGitClient) SuggestSplit ¶
SuggestSplit suggests how to split a large commit.
func (*AIGitClient) TagCreate ¶
func (c *AIGitClient) TagCreate(ctx context.Context, name, ref, message string) error
func (*AIGitClient) TagDelete ¶
func (c *AIGitClient) TagDelete(ctx context.Context, name string) error
func (*AIGitClient) TagListRemote ¶
func (*AIGitClient) TagPush ¶
func (c *AIGitClient) TagPush(ctx context.Context, remote, name string) error
func (*AIGitClient) TagPushAll ¶
func (c *AIGitClient) TagPushAll(ctx context.Context, remote string) error
func (*AIGitClient) Unstage ¶
func (c *AIGitClient) Unstage(ctx context.Context, paths []string) error
func (*AIGitClient) UnstageHunk ¶
func (*AIGitClient) UnstageLine ¶
func (*AIGitClient) WorktreeAdd ¶
func (c *AIGitClient) WorktreeAdd(ctx context.Context, path, branch string) error