-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterface.go
More file actions
85 lines (76 loc) · 2.7 KB
/
interface.go
File metadata and controls
85 lines (76 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package devflow
// GitHubClient defines the interface for GitHub operations.
// This allows mocking the GitHub dependency in tests.
type GitHubClient interface {
SetLog(fn func(...any))
GetCurrentUser() (string, error)
RepoExists(owner, name string) (bool, error)
CreateRepo(owner, name, description, visibility string) error
DeleteRepo(owner, name string) error
IsNetworkError(err error) bool
GetHelpfulErrorMessage(err error) string
}
// GitHubAuthenticator defines the interface for GitHub authentication.
// This allows mocking authentication in tests.
type GitHubAuthenticator interface {
EnsureGitHubAuth() error
SetLog(fn func(...any))
}
// GitHubAuthHandler defines the interface for GitHub auth as a TUI handler.
type GitHubAuthHandler interface {
GitHubAuthenticator
Name() string
}
// GitClient defines the interface for Git operations.
type GitClient interface {
CheckRemoteAccess() error
Push(message, tag string) (PushResult, error)
GetLatestTag() (string, error)
SetLog(fn func(...any))
SetShouldWrite(fn func() bool)
SetRootDir(path string)
GitIgnoreAdd(entry string) error
GetConfigUserName() (string, error)
GetConfigUserEmail() (string, error)
InitRepo(dir string) error
Add() error
Commit(message string) (bool, error)
CreateTag(tag string) (bool, error)
PushWithTags(tag string) (bool, error)
PushWithoutTags() (bool, error)
HasPendingChanges() (bool, error)
}
// FolderWatcher defines interface for adding/removing directories to watch
type FolderWatcher interface {
AddDirectoriesToWatch(paths ...string) error
RemoveDirectoriesFromWatcher(paths ...string) error
}
// Publisher defines the interface for publishing code changes.
type Publisher interface {
Publish(message, tag string, skipTests, skipRace, skipDependents, skipBackup, skipTag bool) (PushResult, error)
}
// CodeJobDriver defines the contract for an external AI coding agent.
// Implementations: JulesDriver, (future: OllamaDriver, etc.)
// title is the human-readable job name (e.g. "owner/repo"), derived by CodeJob.
type CodeJobDriver interface {
Name() string
SetLog(fn func(...any))
Send(prompt, title string) (string, error)
}
// SessionProvider is implemented by CodeJobDrivers that return a session ID
// after a successful Send(). CodeJob uses this to persist to .env.
type SessionProvider interface {
SessionID() string
}
// GoModInterface defines interface for go.mod handling
type GoModInterface interface {
NewFileEvent(fileName, extension, filePath, event string) error
SetFolderWatcher(watcher FolderWatcher)
Name() string
SupportedExtensions() []string
MainInputFileRelativePath() string
UnobservedFiles() []string
SetLog(fn func(...any))
SetRootDir(path string)
GetReplacePaths() ([]ReplaceEntry, error)
}