Documentation
¶
Overview ¶
Package projectdiscovery implements tools to help LLMs discover the GitLab project associated with a local workspace. It parses git remote URLs into GitLab path_with_namespace and resolves them via the GitLab API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatMarkdown ¶
func FormatMarkdown(out ResolveOutput) string
FormatMarkdown renders the resolved project as a Markdown CallToolResult.
func ParseRemoteURL ¶
ParseRemoteURL extracts the project path_with_namespace from a git remote URL. Supports HTTPS, SSH (git@host:path), and ssh:// protocol URLs. Returns the path and nil on success, or empty string and an error.
func RegisterTools ¶
func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
RegisterTools registers project discovery tools on the MCP server.
Types ¶
type ResolveInput ¶
type ResolveInput struct {
RemoteURL string `` /* 369-byte string literal not displayed */
}
ResolveInput defines parameters for resolving a git remote URL to a GitLab project.
type ResolveOutput ¶
type ResolveOutput struct {
toolutil.HintableOutput
ID int64 `json:"id"`
Name string `json:"name"`
Path string `json:"path"`
PathWithNamespace string `json:"path_with_namespace"`
WebURL string `json:"web_url"`
DefaultBranch string `json:"default_branch"`
Description string `json:"description"`
Visibility string `json:"visibility"`
HTTPURLToRepo string `json:"http_url_to_repo,omitempty"`
SSHURLToRepo string `json:"ssh_url_to_repo,omitempty"`
ExtractedPath string `json:"extracted_path"`
}
ResolveOutput holds the resolved GitLab project information.
func Resolve ¶
func Resolve(ctx context.Context, client *gitlabclient.Client, input ResolveInput) (ResolveOutput, error)
Resolve parses a git remote URL, extracts the project path, and looks up the project via the GitLab API. Returns the project details or an error with guidance on what to try next.