Changeset 0.25.0 (#160)
This commit is contained in:
@@ -9,8 +9,7 @@ import (
|
||||
)
|
||||
|
||||
// RegisterGitTools registers the 5 git-related workspace tools.
|
||||
// Only meaningful when a workspace has git_remote_url set — the completion
|
||||
// handler filters them out otherwise (via GitToolNames).
|
||||
// Each declares RequireWorkspace + DenyVisitor availability via workspaceToolBase.
|
||||
func RegisterGitTools(gitOps *workspace.GitOps) {
|
||||
Register(&gitStatusTool{gitOps: gitOps})
|
||||
Register(&gitDiffTool{gitOps: gitOps})
|
||||
@@ -19,14 +18,12 @@ func RegisterGitTools(gitOps *workspace.GitOps) {
|
||||
Register(&gitBranchTool{gitOps: gitOps})
|
||||
}
|
||||
|
||||
// GitToolNames returns the names of all git tools for filtering.
|
||||
func GitToolNames() []string {
|
||||
return []string{"git_status", "git_diff", "git_commit", "git_log", "git_branch"}
|
||||
}
|
||||
|
||||
// ── git_status ───────────────────────────────
|
||||
|
||||
type gitStatusTool struct{ gitOps *workspace.GitOps }
|
||||
type gitStatusTool struct {
|
||||
workspaceToolBase
|
||||
gitOps *workspace.GitOps
|
||||
}
|
||||
|
||||
func (t *gitStatusTool) Definition() ToolDef {
|
||||
return ToolDef{
|
||||
@@ -53,7 +50,10 @@ func (t *gitStatusTool) Execute(ctx context.Context, execCtx ExecutionContext, a
|
||||
|
||||
// ── git_diff ─────────────────────────────────
|
||||
|
||||
type gitDiffTool struct{ gitOps *workspace.GitOps }
|
||||
type gitDiffTool struct {
|
||||
workspaceToolBase
|
||||
gitOps *workspace.GitOps
|
||||
}
|
||||
|
||||
func (t *gitDiffTool) Definition() ToolDef {
|
||||
return ToolDef{
|
||||
@@ -92,7 +92,10 @@ func (t *gitDiffTool) Execute(ctx context.Context, execCtx ExecutionContext, arg
|
||||
|
||||
// ── git_commit ───────────────────────────────
|
||||
|
||||
type gitCommitTool struct{ gitOps *workspace.GitOps }
|
||||
type gitCommitTool struct {
|
||||
workspaceToolBase
|
||||
gitOps *workspace.GitOps
|
||||
}
|
||||
|
||||
func (t *gitCommitTool) Definition() ToolDef {
|
||||
return ToolDef{
|
||||
@@ -131,7 +134,10 @@ func (t *gitCommitTool) Execute(ctx context.Context, execCtx ExecutionContext, a
|
||||
|
||||
// ── git_log ──────────────────────────────────
|
||||
|
||||
type gitLogTool struct{ gitOps *workspace.GitOps }
|
||||
type gitLogTool struct {
|
||||
workspaceToolBase
|
||||
gitOps *workspace.GitOps
|
||||
}
|
||||
|
||||
func (t *gitLogTool) Definition() ToolDef {
|
||||
return ToolDef{
|
||||
@@ -171,7 +177,10 @@ func (t *gitLogTool) Execute(ctx context.Context, execCtx ExecutionContext, args
|
||||
|
||||
// ── git_branch ───────────────────────────────
|
||||
|
||||
type gitBranchTool struct{ gitOps *workspace.GitOps }
|
||||
type gitBranchTool struct {
|
||||
workspaceToolBase
|
||||
gitOps *workspace.GitOps
|
||||
}
|
||||
|
||||
func (t *gitBranchTool) Definition() ToolDef {
|
||||
return ToolDef{
|
||||
|
||||
Reference in New Issue
Block a user