Documentation
¶
Index ¶
- func AuditLog(toolName, walletAddress string, success bool, duration time.Duration, ...)
- func CheckTrust(currentLevel TrustLevel, toolName string) error
- func DryRunResult(toolName string, params any) (*mcp.CallToolResult, any, error)
- func IsToolEnabled(toolName string, activeToolsets map[Toolset]bool) bool
- func ParseToolsets(s string) map[Toolset]bool
- func RegisterAll(srv *mcp.Server, h *ToolHandler)
- type BatchExecuteParams
- type BatchOperation
- type BootstrapRepoParams
- type ClaimFeeGrantParams
- type CloseBountyParams
- type CoinParam
- type CommentOnIssueParams
- type CommentOnPullRequestParams
- type CommitAndPushChangesParams
- type ConfirmTransactionParams
- type CreateBountyParams
- type CreateDaoParams
- type CreateFeatureBranchPRParams
- type CreateFeatureBranchParams
- type CreateIssueParams
- type CreateLabelParams
- type CreatePullRequestParams
- type CreateReleaseParams
- type CreateRepoParams
- type CreateUserParams
- type DeleteBountyParams
- type DeleteLabelParams
- type ErrorCode
- type ExecDaoProposalParams
- type ForkRepositoryParams
- type GetBountyParams
- type GetDaoParams
- type GetDaoProposalParams
- type GetFileParams
- type GetIssueParams
- type GetPullRequestDiffParams
- type GetPullRequestParams
- type GetRepoParams
- type GitAddParams
- type GitCloneParams
- type GitCommitParams
- type GitInitParams
- type GitPushParams
- type GitStatusParams
- type ListBountiesParams
- type ListBranchesParams
- type ListCommitsParams
- type ListDaoMembersParams
- type ListDaoProposalsParams
- type ListIssuesParams
- type ListLabelsParams
- type ListPullRequestsParams
- type ListReleasesParams
- type ListReposParams
- type ListTagsParams
- type MergePullRequestParams
- type PendingTx
- type PendingTxStore
- type PromptHandler
- func (ph *PromptHandler) FixIssuePrompt(_ context.Context, req *mcp.GetPromptRequest) (*mcp.GetPromptResult, error)
- func (ph *PromptHandler) HuntBountyPrompt(_ context.Context, req *mcp.GetPromptRequest) (*mcp.GetPromptResult, error)
- func (ph *PromptHandler) ReviewPRPrompt(_ context.Context, req *mcp.GetPromptRequest) (*mcp.GetPromptResult, error)
- type RateLimiter
- type ReadFileParams
- type RejectTransactionParams
- type ResourceHandler
- func (rh *ResourceHandler) HandleBountyResource(_ context.Context, req *mcp.ReadResourceRequest) (*mcp.ReadResourceResult, error)
- func (rh *ResourceHandler) HandleIssueResource(_ context.Context, req *mcp.ReadResourceRequest) (*mcp.ReadResourceResult, error)
- func (rh *ResourceHandler) HandlePullRequestResource(_ context.Context, req *mcp.ReadResourceRequest) (*mcp.ReadResourceResult, error)
- func (rh *ResourceHandler) HandleRepoResource(_ context.Context, req *mcp.ReadResourceRequest) (*mcp.ReadResourceResult, error)
- type SearchCodeParams
- type SetActiveDAOParams
- type SubmitDaoProposalParams
- type SyncWithRemoteParams
- type ToggleRepositoryForkingParams
- type ToolHandler
- func (h *ToolHandler) BatchExecute(ctx context.Context, req *mcp.CallToolRequest, p BatchExecuteParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) BootstrapRepo(ctx context.Context, req *mcp.CallToolRequest, p BootstrapRepoParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) ClaimFeeGrant(ctx context.Context, req *mcp.CallToolRequest, p ClaimFeeGrantParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) CloseBounty(ctx context.Context, req *mcp.CallToolRequest, p CloseBountyParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) CommentOnIssue(ctx context.Context, req *mcp.CallToolRequest, p CommentOnIssueParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) CommentOnPullRequest(ctx context.Context, req *mcp.CallToolRequest, p CommentOnPullRequestParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) CommitAndPushChanges(ctx context.Context, req *mcp.CallToolRequest, p CommitAndPushChangesParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) ConfirmTransaction(ctx context.Context, req *mcp.CallToolRequest, p ConfirmTransactionParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) CreateBounty(ctx context.Context, req *mcp.CallToolRequest, p CreateBountyParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) CreateDao(ctx context.Context, req *mcp.CallToolRequest, p CreateDaoParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) CreateFeatureBranch(ctx context.Context, req *mcp.CallToolRequest, p CreateFeatureBranchParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) CreateFeatureBranchPR(ctx context.Context, req *mcp.CallToolRequest, p CreateFeatureBranchPRParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) CreateIssue(ctx context.Context, req *mcp.CallToolRequest, p CreateIssueParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) CreateLabel(ctx context.Context, req *mcp.CallToolRequest, p CreateLabelParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) CreatePullRequest(ctx context.Context, req *mcp.CallToolRequest, p CreatePullRequestParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) CreateRelease(ctx context.Context, req *mcp.CallToolRequest, p CreateReleaseParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) CreateRepository(ctx context.Context, req *mcp.CallToolRequest, p CreateRepoParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) CreateUser(ctx context.Context, req *mcp.CallToolRequest, p CreateUserParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) DeleteBounty(ctx context.Context, req *mcp.CallToolRequest, p DeleteBountyParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) DeleteLabel(ctx context.Context, req *mcp.CallToolRequest, p DeleteLabelParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) ExecDaoProposal(ctx context.Context, req *mcp.CallToolRequest, p ExecDaoProposalParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) ForkRepository(ctx context.Context, req *mcp.CallToolRequest, p ForkRepositoryParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) GetBounty(ctx context.Context, req *mcp.CallToolRequest, p GetBountyParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) GetDao(ctx context.Context, req *mcp.CallToolRequest, params GetDaoParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) GetDaoProposal(ctx context.Context, req *mcp.CallToolRequest, p GetDaoProposalParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) GetFile(ctx context.Context, req *mcp.CallToolRequest, params GetFileParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) GetIssue(ctx context.Context, req *mcp.CallToolRequest, params GetIssueParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) GetPullRequest(ctx context.Context, req *mcp.CallToolRequest, params GetPullRequestParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) GetPullRequestDiff(ctx context.Context, req *mcp.CallToolRequest, params GetPullRequestDiffParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) GetRepo(ctx context.Context, req *mcp.CallToolRequest, params GetRepoParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) GetUserContext(ctx context.Context, req *mcp.CallToolRequest, _ struct{}) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) GitAdd(ctx context.Context, req *mcp.CallToolRequest, p GitAddParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) GitClone(ctx context.Context, req *mcp.CallToolRequest, p GitCloneParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) GitCommit(ctx context.Context, req *mcp.CallToolRequest, p GitCommitParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) GitInit(ctx context.Context, req *mcp.CallToolRequest, p GitInitParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) GitPush(ctx context.Context, req *mcp.CallToolRequest, p GitPushParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) GitStatus(ctx context.Context, req *mcp.CallToolRequest, p GitStatusParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) ListBounties(ctx context.Context, req *mcp.CallToolRequest, p ListBountiesParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) ListBranches(ctx context.Context, req *mcp.CallToolRequest, params ListBranchesParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) ListCommits(ctx context.Context, req *mcp.CallToolRequest, params ListCommitsParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) ListDaoMembers(ctx context.Context, req *mcp.CallToolRequest, p ListDaoMembersParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) ListDaoProposals(ctx context.Context, req *mcp.CallToolRequest, p ListDaoProposalsParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) ListIssues(ctx context.Context, req *mcp.CallToolRequest, params ListIssuesParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) ListLabels(ctx context.Context, req *mcp.CallToolRequest, params ListLabelsParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) ListPendingTransactions(ctx context.Context, req *mcp.CallToolRequest, _ struct{}) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) ListPullRequests(ctx context.Context, req *mcp.CallToolRequest, p ListPullRequestsParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) ListReleases(ctx context.Context, req *mcp.CallToolRequest, params ListReleasesParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) ListRepos(ctx context.Context, req *mcp.CallToolRequest, params ListReposParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) ListTags(ctx context.Context, req *mcp.CallToolRequest, params ListTagsParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) MergePullRequest(ctx context.Context, req *mcp.CallToolRequest, p MergePullRequestParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) ReadFile(ctx context.Context, req *mcp.CallToolRequest, p ReadFileParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) RefreshUserContext(ctx context.Context, req *mcp.CallToolRequest, _ struct{}) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) RejectTransaction(ctx context.Context, req *mcp.CallToolRequest, p RejectTransactionParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) ResolvePath(relativePath string) (string, error)
- func (h *ToolHandler) SearchCode(ctx context.Context, req *mcp.CallToolRequest, p SearchCodeParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) SetActiveDAO(ctx context.Context, req *mcp.CallToolRequest, p SetActiveDAOParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) SubmitDaoProposal(ctx context.Context, req *mcp.CallToolRequest, p SubmitDaoProposalParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) SyncWithRemote(ctx context.Context, req *mcp.CallToolRequest, p SyncWithRemoteParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) ToggleRepositoryForking(ctx context.Context, req *mcp.CallToolRequest, p ToggleRepositoryForkingParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) UpdateBounty(ctx context.Context, req *mcp.CallToolRequest, p UpdateBountyParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) UpdateDaoMembers(ctx context.Context, req *mcp.CallToolRequest, p UpdateDaoMembersParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) UpdateFeatureBranch(ctx context.Context, req *mcp.CallToolRequest, p UpdateFeatureBranchParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) UpdateIssue(ctx context.Context, req *mcp.CallToolRequest, p UpdateIssueParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) VoteDaoProposal(ctx context.Context, req *mcp.CallToolRequest, p VoteDaoProposalParams) (*mcp.CallToolResult, any, error)
- func (h *ToolHandler) WriteFile(ctx context.Context, req *mcp.CallToolRequest, p WriteFileParams) (*mcp.CallToolResult, any, error)
- type Toolset
- type TrustLevel
- type UpdateBountyParams
- type UpdateDaoMembersParams
- type UpdateFeatureBranchParams
- type UpdateIssueParams
- type VoteDaoProposalParams
- type WriteFileParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuditLog ¶
AuditLog emits a structured log entry for chain-write operations. Non-blocking, uses existing logrus infrastructure.
func CheckTrust ¶
func CheckTrust(currentLevel TrustLevel, toolName string) error
CheckTrust returns an error if the current trust level is insufficient for the tool.
func DryRunResult ¶
DryRunResult returns a JSON preview of the operation that would be performed without actually signing or broadcasting it.
func IsToolEnabled ¶
IsToolEnabled checks if a tool should be registered given the active toolsets.
func ParseToolsets ¶
ParseToolsets parses a comma-separated toolset string. Empty string or "all" enables all toolsets.
func RegisterAll ¶
func RegisterAll(srv *mcp.Server, h *ToolHandler)
RegisterAll registers all tools, prompts, and resource templates on the given MCP server using handlers from h and the provided gitopia client. This is extracted from cmd/server/main.go so that both the production binary and integration tests share the exact same registration.
Types ¶
type BatchExecuteParams ¶
type BatchExecuteParams struct {
Operations []BatchOperation `json:"operations" jsonschema:"List of operations to execute in a single transaction (max 10)"`
}
BatchExecuteParams holds parameters for the batch_execute tool.
type BatchOperation ¶
type BatchOperation struct {
Tool string `json:"tool" jsonschema:"The tool name to execute"`
Params map[string]any `json:"params" jsonschema:"Parameters for the tool as a JSON object"`
}
BatchOperation represents a single operation in a batch transaction.
type BootstrapRepoParams ¶
type BootstrapRepoParams struct {
OwnerId string `json:"owner_id"`
Name string `json:"name"`
LocalPath string `json:"local_path,omitempty"`
Description string `json:"description,omitempty"`
CreateReadme bool `json:"create_readme"`
CreateGitignore bool `json:"create_gitignore"`
InitialBranch string `json:"initial_branch,omitempty"`
GitignoreTemplate string `json:"gitignore_template,omitempty"`
}
type ClaimFeeGrantParams ¶
type ClaimFeeGrantParams struct {
Address string `json:"address,omitempty" jsonschema:"If empty, uses current wallet address"`
}
ClaimFeeGrantParams holds parameters for the claim_fee_grant tool.
type CloseBountyParams ¶
type CloseBountyParams struct {
BountyID uint64 `json:"bounty_id"`
}
type CoinParam ¶
type CoinParam struct {
Denom string `json:"denom" jsonschema:"Token denomination (e.g. ulore)"`
Amount string `json:"amount" jsonschema:"Token amount as string (e.g. 1000)"`
}
CoinParam is a JSON-schema-friendly representation of a coin amount. sdk.Coin uses math.Int which produces "type":"object" in JSON schema; this struct produces correct "type":"string" for the amount field.
type CommentOnIssueParams ¶
type CommentOnPullRequestParams ¶
type CommentOnPullRequestParams struct {
Owner string `json:"owner" jsonschema:"Repository owner (username or DAO name)"`
Name string `json:"name" jsonschema:"Repository name"`
PullIid uint64 `json:"pull_iid" jsonschema:"Pull request number (IID)"`
Body string `json:"body" jsonschema:"Comment body text"`
DiffHunk string `json:"diff_hunk,omitempty" jsonschema:"Diff hunk for inline comment"`
Path string `json:"path,omitempty" jsonschema:"File path for inline comment"`
Position uint64 `json:"position,omitempty" jsonschema:"Line position for inline comment"`
}
type CommitAndPushChangesParams ¶
type CommitAndPushChangesParams struct {
RepoPath string `json:"repo_path" jsonschema:"Repository path relative to workspace"`
CommitMessage string `json:"commit_message" jsonschema:"Commit message"`
Files []string `json:"files,omitempty" jsonschema:"Specific files to stage (empty for all)"`
Branch string `json:"branch,omitempty" jsonschema:"Target branch (current if empty)"`
CreateBranch bool `json:"create_branch,omitempty" jsonschema:"Create branch if it does not exist"`
}
type ConfirmTransactionParams ¶
type ConfirmTransactionParams struct {
PendingID string `json:"pending_id" jsonschema:"The ID of the pending transaction to confirm"`
}
type CreateBountyParams ¶
type CreateDaoParams ¶
type CreateDaoParams struct {
Name string `json:"name"`
Description string `json:"description"`
AvatarURL string `json:"avatar_url,omitempty"`
Location string `json:"location,omitempty"`
Website string `json:"website,omitempty"`
Members []struct {
Address string `json:"address"`
Weight string `json:"weight"`
Metadata string `json:"metadata,omitempty"`
} `json:"members,omitempty"`
VotingPeriod string `json:"voting_period,omitempty"`
Percentage string `json:"percentage,omitempty"`
Config *gitopiatypes.DaoConfig `json:"config,omitempty"`
}
type CreateFeatureBranchPRParams ¶
type CreateFeatureBranchPRParams struct {
RepoPath string `json:"repo_path" jsonschema:"Repository path relative to workspace (e.g. 'myrepo')"`
Owner string `json:"owner"`
Name string `json:"name"`
BranchName string `json:"branch_name"`
BaseBranch string `json:"base_branch,omitempty"`
Files []fs.FileChange `json:"files"`
CommitMessage string `json:"commit_message"`
PRTitle string `json:"pr_title"`
PRDescription string `json:"pr_description"`
Assignees []string `json:"assignees,omitempty"`
Labels []uint64 `json:"labels,omitempty"`
}
type CreateIssueParams ¶
type CreateLabelParams ¶
type CreateLabelParams struct {
Owner string `json:"owner" jsonschema:"Repository owner (username or DAO name)"`
Name string `json:"name" jsonschema:"Repository name"`
LabelName string `json:"label_name" jsonschema:"Label name (3-63 characters)"`
Color string `json:"color" jsonschema:"Label color as hex code (e.g. FF0000)"`
Description string `json:"description,omitempty" jsonschema:"Label description (max 255 characters)"`
}
type CreatePullRequestParams ¶
type CreatePullRequestParams struct {
Owner string `json:"owner"`
Name string `json:"name"`
Title string `json:"title"`
Description string `json:"description"`
HeadBranch string `json:"head_branch"`
BaseBranch string `json:"base_branch"`
Assignees []string `json:"assignees,omitempty"`
Labels []uint64 `json:"labels,omitempty"`
IssueIids []uint64 `json:"issue_iids,omitempty"`
}
type CreateReleaseParams ¶
type CreateReleaseParams struct {
Owner string `json:"owner" jsonschema:"Repository owner (username or DAO name)"`
Name string `json:"name" jsonschema:"Repository name"`
TagName string `json:"tag_name" jsonschema:"Tag name for the release (e.g. v1.0.0)"`
Target string `json:"target,omitempty" jsonschema:"Branch or commit SHA to tag (defaults to default branch HEAD)"`
ReleaseName string `json:"release_name" jsonschema:"Human-readable release title"`
Description string `json:"description,omitempty" jsonschema:"Release notes / description"`
Draft bool `json:"draft,omitempty" jsonschema:"Mark as draft release"`
PreRelease bool `json:"pre_release,omitempty" jsonschema:"Mark as pre-release"`
Provider string `` /* 127-byte string literal not displayed */
}
type CreateRepoParams ¶
type CreateUserParams ¶
type CreateUserParams struct {
Username string `json:"username" jsonschema:"Gitopia username (3-39 chars, alphanumeric and hyphens)"`
}
CreateUserParams holds parameters for the create_user tool.
type DeleteBountyParams ¶
type DeleteBountyParams struct {
BountyID uint64 `json:"bounty_id"`
}
type DeleteLabelParams ¶
type ErrorCode ¶
type ErrorCode string
ErrorCode represents a machine-readable error classification.
const ( ErrAuthFailed ErrorCode = "AUTH_FAILED" ErrRateLimited ErrorCode = "RATE_LIMITED" ErrValidation ErrorCode = "VALIDATION_ERROR" ErrNotFound ErrorCode = "NOT_FOUND" ErrConflict ErrorCode = "CONFLICT" ErrNotRepository ErrorCode = "NOT_REPOSITORY" ErrPathTraversal ErrorCode = "PATH_TRAVERSAL" ErrChainTx ErrorCode = "CHAIN_TX_FAILED" ErrGitOperation ErrorCode = "GIT_OPERATION_FAILED" ErrFileSystem ErrorCode = "FS_ERROR" ErrApproval ErrorCode = "APPROVAL_ERROR" ErrInternal ErrorCode = "INTERNAL_ERROR" )
type ExecDaoProposalParams ¶
type ExecDaoProposalParams struct {
ProposalID uint64 `json:"proposal_id" jsonschema:"The unique ID of the proposal to execute"`
}
type ForkRepositoryParams ¶
type ForkRepositoryParams struct {
Owner string `json:"owner" jsonschema:"Source repository owner (username or DAO name)"`
Name string `json:"name" jsonschema:"Source repository name"`
ForkName string `json:"fork_name,omitempty" jsonschema:"Name for the forked repository (defaults to source name)"`
ForkDescription string `json:"fork_description,omitempty" jsonschema:"Description for the fork"`
Branch string `json:"branch,omitempty" jsonschema:"Branch to fork (defaults to all branches)"`
ForkOwner string `json:"fork_owner,omitempty" jsonschema:"Owner of the fork (defaults to authenticated user)"`
}
type GetBountyParams ¶
type GetBountyParams struct {
BountyID uint64 `json:"bounty_id" jsonschema:"The ID of the bounty to retrieve"`
}
type GetDaoParams ¶
type GetDaoParams struct {
ID string `json:"id" jsonschema:"DAO name or address"`
}
type GetDaoProposalParams ¶
type GetDaoProposalParams struct {
ProposalID uint64 `json:"proposal_id" jsonschema:"The unique ID of the proposal"`
}
type GetFileParams ¶
type GetIssueParams ¶
type GetPullRequestDiffParams ¶
type GetPullRequestDiffParams struct {
Owner string `json:"owner" jsonschema:"Repository owner (username or DAO name)"`
Name string `json:"name" jsonschema:"Repository name"`
PullIid uint64 `json:"pull_iid" jsonschema:"Pull request number (IID)"`
Limit int `json:"limit,omitempty" jsonschema:"Maximum number of file diffs to return (default 50)"`
}
type GetPullRequestParams ¶
type GetRepoParams ¶
type GitAddParams ¶
type GitCloneParams ¶
type GitCloneParams struct {
RepoURL string `json:"repo_url" jsonschema:"gitopia:// URL or owner/name format"`
LocalPath string `json:"local_path" jsonschema:"Path relative to workspace root"`
Branch string `json:"branch,omitempty" jsonschema:"Specific branch to clone"`
Depth int `json:"depth,omitempty" jsonschema:"Shallow clone depth"`
}
type GitCommitParams ¶
type GitCommitParams struct {
RepoPath string `json:"repo_path" jsonschema:"Repository path relative to workspace"`
Message string `json:"message" jsonschema:"The commit message"`
AuthorName string `json:"author_name,omitempty" jsonschema:"Optional author name"`
AuthorEmail string `json:"author_email,omitempty" jsonschema:"Optional author email"`
}
type GitInitParams ¶
type GitPushParams ¶
type GitPushParams struct {
RepoPath string `json:"repo_path" jsonschema:"Repository path relative to workspace"`
Remote string `json:"remote,omitempty" jsonschema:"Remote name (default: origin)"`
Branch string `json:"branch,omitempty" jsonschema:"Branch to push"`
Force bool `json:"force,omitempty" jsonschema:"Force push"`
SetUpstream bool `json:"set_upstream,omitempty" jsonschema:"Set upstream tracking"`
DryRun bool `json:"dry_run,omitempty" jsonschema:"Dry run"`
}
type GitStatusParams ¶
type GitStatusParams struct {
RepoPath string `json:"repo_path" jsonschema:"Repository path relative to workspace"`
}
type ListBountiesParams ¶
type ListBountiesParams struct {
Limit uint64 `json:"limit,omitempty" jsonschema:"Maximum number of bounties to return (default 50)"`
}
type ListBranchesParams ¶
type ListCommitsParams ¶
type ListCommitsParams struct {
Owner string `json:"owner" jsonschema:"Repository owner (username or DAO name)"`
Name string `json:"name" jsonschema:"Repository name"`
Branch string `json:"branch,omitempty" jsonschema:"Branch name (defaults to repo's default branch)"`
Limit int `json:"limit,omitempty" jsonschema:"Maximum number of commits to return (default 50)"`
}
type ListDaoMembersParams ¶
type ListDaoMembersParams struct {
DAO string `json:"dao,omitempty" jsonschema:"DAO name or address (alternative to group_id)"`
GroupID uint64 `json:"group_id,omitempty" jsonschema:"The cosmos group ID of the DAO"`
Limit uint64 `json:"limit,omitempty" jsonschema:"Maximum number of members to return (default 100)"`
}
type ListDaoProposalsParams ¶
type ListDaoProposalsParams struct {
DAO string `json:"dao,omitempty" jsonschema:"DAO name or address (alternative to group_policy_address)"`
GroupPolicyAddress string `json:"group_policy_address,omitempty" jsonschema:"The group policy account address"`
Limit uint64 `json:"limit,omitempty" jsonschema:"Maximum number of proposals to return (default 50)"`
}
type ListIssuesParams ¶
type ListLabelsParams ¶
type ListPullRequestsParams ¶
type ListReleasesParams ¶
type ListReposParams ¶
type ListReposParams struct {
Owner string `json:"owner" jsonschema:"Gitopia account name"`
}
type ListTagsParams ¶
type MergePullRequestParams ¶
type MergePullRequestParams struct {
Owner string `json:"owner" jsonschema:"Repository owner (username or DAO name)"`
Name string `json:"name" jsonschema:"Repository name"`
PullIid uint64 `json:"pull_iid" jsonschema:"Pull request number (IID)"`
Provider string `` /* 127-byte string literal not displayed */
}
type PendingTx ¶
type PendingTx struct {
ID string `json:"id"`
ToolName string `json:"tool_name"`
Detail string `json:"detail"`
WalletAddress string `json:"wallet_address"`
SessionID string `json:"session_id"`
CreatedAt time.Time `json:"created_at"`
ExpiresAt time.Time `json:"expires_at"`
// contains filtered or unexported fields
}
PendingTx represents a chain transaction awaiting user confirmation.
type PendingTxStore ¶
type PendingTxStore struct {
// contains filtered or unexported fields
}
PendingTxStore is a thread-safe store for pending transactions.
func NewPendingTxStore ¶
func NewPendingTxStore(ttl time.Duration) *PendingTxStore
NewPendingTxStore creates a new store with the given TTL.
func (*PendingTxStore) Add ¶
func (s *PendingTxStore) Add(tx *PendingTx) string
Add stores a pending transaction and returns its ID.
func (*PendingTxStore) Cleanup ¶
func (s *PendingTxStore) Cleanup()
Cleanup removes all expired transactions.
func (*PendingTxStore) Get ¶
func (s *PendingTxStore) Get(id string) *PendingTx
Get returns a pending transaction by ID, or nil if missing or expired.
func (*PendingTxStore) ListForSession ¶
func (s *PendingTxStore) ListForSession(sessionID string) []*PendingTx
ListForSession returns all non-expired pending transactions for a session.
func (*PendingTxStore) Remove ¶
func (s *PendingTxStore) Remove(id string)
Remove deletes a pending transaction by ID.
type PromptHandler ¶
type PromptHandler struct{}
PromptHandler holds dependencies for MCP prompt handlers.
func (*PromptHandler) FixIssuePrompt ¶
func (ph *PromptHandler) FixIssuePrompt(_ context.Context, req *mcp.GetPromptRequest) (*mcp.GetPromptResult, error)
FixIssuePrompt returns a multi-step workflow to fix an issue.
func (*PromptHandler) HuntBountyPrompt ¶
func (ph *PromptHandler) HuntBountyPrompt(_ context.Context, req *mcp.GetPromptRequest) (*mcp.GetPromptResult, error)
HuntBountyPrompt returns a multi-step workflow to find and work on bounties.
func (*PromptHandler) ReviewPRPrompt ¶
func (ph *PromptHandler) ReviewPRPrompt(_ context.Context, req *mcp.GetPromptRequest) (*mcp.GetPromptResult, error)
ReviewPRPrompt returns a multi-step workflow to review a pull request.
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
RateLimiter implements a sliding-window rate limiter for chain transactions.
func NewRateLimiter ¶
func NewRateLimiter(perMinute, perHour int) *RateLimiter
NewRateLimiter creates a new RateLimiter with the given per-minute and per-hour limits.
func (*RateLimiter) Allow ¶
func (r *RateLimiter) Allow() error
Allow checks if a new request is allowed. If allowed, it records the request and returns nil. Otherwise it returns an error describing the limit hit.
type ReadFileParams ¶
type ReadFileParams struct {
Path string `json:"path" jsonschema:"File path relative to workspace root (e.g. 'myrepo/src/main.go')"`
}
type RejectTransactionParams ¶
type RejectTransactionParams struct {
PendingID string `json:"pending_id" jsonschema:"The ID of the pending transaction to reject"`
}
type ResourceHandler ¶
ResourceHandler holds dependencies for MCP resource handlers.
func (*ResourceHandler) HandleBountyResource ¶
func (rh *ResourceHandler) HandleBountyResource(_ context.Context, req *mcp.ReadResourceRequest) (*mcp.ReadResourceResult, error)
HandleBountyResource reads a bounty resource by URI.
func (*ResourceHandler) HandleIssueResource ¶
func (rh *ResourceHandler) HandleIssueResource(_ context.Context, req *mcp.ReadResourceRequest) (*mcp.ReadResourceResult, error)
HandleIssueResource reads an issue resource by URI.
func (*ResourceHandler) HandlePullRequestResource ¶
func (rh *ResourceHandler) HandlePullRequestResource(_ context.Context, req *mcp.ReadResourceRequest) (*mcp.ReadResourceResult, error)
HandlePullRequestResource reads a pull request resource by URI.
func (*ResourceHandler) HandleRepoResource ¶
func (rh *ResourceHandler) HandleRepoResource(_ context.Context, req *mcp.ReadResourceRequest) (*mcp.ReadResourceResult, error)
HandleRepoResource reads a repository resource by URI.
type SearchCodeParams ¶
type SearchCodeParams struct {
RepoPath string `json:"repo_path" jsonschema:"Repository path relative to workspace"`
Query string `json:"query" jsonschema:"Search query string or regex pattern"`
CaseSensitive bool `json:"case_sensitive,omitempty" jsonschema:"Whether search should be case-sensitive"`
}
type SetActiveDAOParams ¶
type SetActiveDAOParams struct {
DaoName string `json:"dao_name,omitempty"` // Empty to use personal account
}
type SubmitDaoProposalParams ¶
type SubmitDaoProposalParams struct {
DAO string `json:"dao,omitempty" jsonschema:"DAO name or address (alternative to group_policy_address)"`
GroupPolicyAddress string `json:"group_policy_address,omitempty" jsonschema:"The group policy account address"`
Title string `json:"title" jsonschema:"Title of the proposal"`
Summary string `json:"summary,omitempty" jsonschema:"Summary of the proposal"`
Metadata string `json:"metadata,omitempty" jsonschema:"Arbitrary metadata for the proposal"`
ExecTry bool `json:"exec_try,omitempty" jsonschema:"If true, try to execute immediately after submission"`
}
type SyncWithRemoteParams ¶
type ToolHandler ¶
type ToolHandler struct {
GClient *gitopia.Client
GitClient *git.Client
AuthMgr *git.AuthManager
WorkspaceMgr *workspace.Manager
TrustLvl TrustLevel
ChainLimiter *RateLimiter
DryRunMode bool
ApprovalMode bool
PendingTxs *PendingTxStore
ActiveToolsets map[Toolset]bool
// contains filtered or unexported fields
}
ToolHandler holds shared dependencies for all tool handlers. By making handlers methods on this struct, we can easily share state and dependencies like clients and managers without using globals.
func New ¶
func New(g *gitopia.Client, git *git.Client, auth *git.AuthManager, ws *workspace.Manager) *ToolHandler
New creates a new ToolHandler.
func (*ToolHandler) BatchExecute ¶
func (h *ToolHandler) BatchExecute( ctx context.Context, req *mcp.CallToolRequest, p BatchExecuteParams, ) (*mcp.CallToolResult, any, error)
BatchExecute executes multiple operations in a single on-chain transaction.
func (*ToolHandler) BootstrapRepo ¶
func (h *ToolHandler) BootstrapRepo( ctx context.Context, req *mcp.CallToolRequest, p BootstrapRepoParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) ClaimFeeGrant ¶
func (h *ToolHandler) ClaimFeeGrant( ctx context.Context, req *mcp.CallToolRequest, p ClaimFeeGrantParams, ) (*mcp.CallToolResult, any, error)
ClaimFeeGrant claims a fee grant from the Gitopia faucet.
func (*ToolHandler) CloseBounty ¶
func (h *ToolHandler) CloseBounty( ctx context.Context, req *mcp.CallToolRequest, p CloseBountyParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) CommentOnIssue ¶
func (h *ToolHandler) CommentOnIssue( ctx context.Context, req *mcp.CallToolRequest, p CommentOnIssueParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) CommentOnPullRequest ¶
func (h *ToolHandler) CommentOnPullRequest( ctx context.Context, req *mcp.CallToolRequest, p CommentOnPullRequestParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) CommitAndPushChanges ¶
func (h *ToolHandler) CommitAndPushChanges( ctx context.Context, req *mcp.CallToolRequest, p CommitAndPushChangesParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) ConfirmTransaction ¶
func (h *ToolHandler) ConfirmTransaction( ctx context.Context, req *mcp.CallToolRequest, p ConfirmTransactionParams, ) (*mcp.CallToolResult, any, error)
ConfirmTransaction broadcasts a previously held pending transaction.
func (*ToolHandler) CreateBounty ¶
func (h *ToolHandler) CreateBounty( ctx context.Context, req *mcp.CallToolRequest, p CreateBountyParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) CreateDao ¶
func (h *ToolHandler) CreateDao( ctx context.Context, req *mcp.CallToolRequest, p CreateDaoParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) CreateFeatureBranch ¶
func (h *ToolHandler) CreateFeatureBranch( ctx context.Context, req *mcp.CallToolRequest, p CreateFeatureBranchParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) CreateFeatureBranchPR ¶
func (h *ToolHandler) CreateFeatureBranchPR( ctx context.Context, req *mcp.CallToolRequest, p CreateFeatureBranchPRParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) CreateIssue ¶
func (h *ToolHandler) CreateIssue( ctx context.Context, req *mcp.CallToolRequest, p CreateIssueParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) CreateLabel ¶
func (h *ToolHandler) CreateLabel( ctx context.Context, req *mcp.CallToolRequest, p CreateLabelParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) CreatePullRequest ¶
func (h *ToolHandler) CreatePullRequest( ctx context.Context, req *mcp.CallToolRequest, p CreatePullRequestParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) CreateRelease ¶
func (h *ToolHandler) CreateRelease( ctx context.Context, req *mcp.CallToolRequest, p CreateReleaseParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) CreateRepository ¶
func (h *ToolHandler) CreateRepository( ctx context.Context, req *mcp.CallToolRequest, p CreateRepoParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) CreateUser ¶
func (h *ToolHandler) CreateUser( ctx context.Context, req *mcp.CallToolRequest, p CreateUserParams, ) (*mcp.CallToolResult, any, error)
CreateUser creates an on-chain Gitopia user for the current wallet.
func (*ToolHandler) DeleteBounty ¶
func (h *ToolHandler) DeleteBounty( ctx context.Context, req *mcp.CallToolRequest, p DeleteBountyParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) DeleteLabel ¶
func (h *ToolHandler) DeleteLabel( ctx context.Context, req *mcp.CallToolRequest, p DeleteLabelParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) ExecDaoProposal ¶
func (h *ToolHandler) ExecDaoProposal( ctx context.Context, req *mcp.CallToolRequest, p ExecDaoProposalParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) ForkRepository ¶
func (h *ToolHandler) ForkRepository( ctx context.Context, req *mcp.CallToolRequest, p ForkRepositoryParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) GetBounty ¶
func (h *ToolHandler) GetBounty( ctx context.Context, req *mcp.CallToolRequest, p GetBountyParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) GetDao ¶
func (h *ToolHandler) GetDao( ctx context.Context, req *mcp.CallToolRequest, params GetDaoParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) GetDaoProposal ¶
func (h *ToolHandler) GetDaoProposal( ctx context.Context, req *mcp.CallToolRequest, p GetDaoProposalParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) GetFile ¶
func (h *ToolHandler) GetFile( ctx context.Context, req *mcp.CallToolRequest, params GetFileParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) GetIssue ¶
func (h *ToolHandler) GetIssue( ctx context.Context, req *mcp.CallToolRequest, params GetIssueParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) GetPullRequest ¶
func (h *ToolHandler) GetPullRequest( ctx context.Context, req *mcp.CallToolRequest, params GetPullRequestParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) GetPullRequestDiff ¶
func (h *ToolHandler) GetPullRequestDiff( ctx context.Context, req *mcp.CallToolRequest, params GetPullRequestDiffParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) GetRepo ¶
func (h *ToolHandler) GetRepo( ctx context.Context, req *mcp.CallToolRequest, params GetRepoParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) GetUserContext ¶
func (h *ToolHandler) GetUserContext( ctx context.Context, req *mcp.CallToolRequest, _ struct{}, ) (*mcp.CallToolResult, any, error)
GetUserContext returns the current user context information
func (*ToolHandler) GitAdd ¶
func (h *ToolHandler) GitAdd( ctx context.Context, req *mcp.CallToolRequest, p GitAddParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) GitClone ¶
func (h *ToolHandler) GitClone( ctx context.Context, req *mcp.CallToolRequest, p GitCloneParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) GitCommit ¶
func (h *ToolHandler) GitCommit( ctx context.Context, req *mcp.CallToolRequest, p GitCommitParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) GitInit ¶
func (h *ToolHandler) GitInit( ctx context.Context, req *mcp.CallToolRequest, p GitInitParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) GitPush ¶
func (h *ToolHandler) GitPush( ctx context.Context, req *mcp.CallToolRequest, p GitPushParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) GitStatus ¶
func (h *ToolHandler) GitStatus( ctx context.Context, req *mcp.CallToolRequest, p GitStatusParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) ListBounties ¶
func (h *ToolHandler) ListBounties( ctx context.Context, req *mcp.CallToolRequest, p ListBountiesParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) ListBranches ¶
func (h *ToolHandler) ListBranches( ctx context.Context, req *mcp.CallToolRequest, params ListBranchesParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) ListCommits ¶
func (h *ToolHandler) ListCommits( ctx context.Context, req *mcp.CallToolRequest, params ListCommitsParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) ListDaoMembers ¶
func (h *ToolHandler) ListDaoMembers( ctx context.Context, req *mcp.CallToolRequest, p ListDaoMembersParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) ListDaoProposals ¶
func (h *ToolHandler) ListDaoProposals( ctx context.Context, req *mcp.CallToolRequest, p ListDaoProposalsParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) ListIssues ¶
func (h *ToolHandler) ListIssues( ctx context.Context, req *mcp.CallToolRequest, params ListIssuesParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) ListLabels ¶
func (h *ToolHandler) ListLabels( ctx context.Context, req *mcp.CallToolRequest, params ListLabelsParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) ListPendingTransactions ¶
func (h *ToolHandler) ListPendingTransactions( ctx context.Context, req *mcp.CallToolRequest, _ struct{}, ) (*mcp.CallToolResult, any, error)
ListPendingTransactions lists all non-expired pending transactions for the current session.
func (*ToolHandler) ListPullRequests ¶
func (h *ToolHandler) ListPullRequests( ctx context.Context, req *mcp.CallToolRequest, p ListPullRequestsParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) ListReleases ¶
func (h *ToolHandler) ListReleases( ctx context.Context, req *mcp.CallToolRequest, params ListReleasesParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) ListRepos ¶
func (h *ToolHandler) ListRepos( ctx context.Context, req *mcp.CallToolRequest, params ListReposParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) ListTags ¶
func (h *ToolHandler) ListTags( ctx context.Context, req *mcp.CallToolRequest, params ListTagsParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) MergePullRequest ¶
func (h *ToolHandler) MergePullRequest( ctx context.Context, req *mcp.CallToolRequest, p MergePullRequestParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) ReadFile ¶
func (h *ToolHandler) ReadFile( ctx context.Context, req *mcp.CallToolRequest, p ReadFileParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) RefreshUserContext ¶
func (h *ToolHandler) RefreshUserContext( ctx context.Context, req *mcp.CallToolRequest, _ struct{}, ) (*mcp.CallToolResult, any, error)
RefreshUserContext refreshes the user context from Gitopia
func (*ToolHandler) RejectTransaction ¶
func (h *ToolHandler) RejectTransaction( ctx context.Context, req *mcp.CallToolRequest, p RejectTransactionParams, ) (*mcp.CallToolResult, any, error)
RejectTransaction cancels a previously held pending transaction.
func (*ToolHandler) ResolvePath ¶
func (h *ToolHandler) ResolvePath(relativePath string) (string, error)
ResolvePath resolves a relative path to an absolute workspace path
func (*ToolHandler) SearchCode ¶
func (h *ToolHandler) SearchCode( ctx context.Context, req *mcp.CallToolRequest, p SearchCodeParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) SetActiveDAO ¶
func (h *ToolHandler) SetActiveDAO( ctx context.Context, req *mcp.CallToolRequest, p SetActiveDAOParams, ) (*mcp.CallToolResult, any, error)
SetActiveDAO sets the active DAO for operations
func (*ToolHandler) SubmitDaoProposal ¶
func (h *ToolHandler) SubmitDaoProposal( ctx context.Context, req *mcp.CallToolRequest, p SubmitDaoProposalParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) SyncWithRemote ¶
func (h *ToolHandler) SyncWithRemote( ctx context.Context, req *mcp.CallToolRequest, p SyncWithRemoteParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) ToggleRepositoryForking ¶
func (h *ToolHandler) ToggleRepositoryForking( ctx context.Context, req *mcp.CallToolRequest, p ToggleRepositoryForkingParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) UpdateBounty ¶
func (h *ToolHandler) UpdateBounty( ctx context.Context, req *mcp.CallToolRequest, p UpdateBountyParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) UpdateDaoMembers ¶
func (h *ToolHandler) UpdateDaoMembers( ctx context.Context, req *mcp.CallToolRequest, p UpdateDaoMembersParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) UpdateFeatureBranch ¶
func (h *ToolHandler) UpdateFeatureBranch( ctx context.Context, req *mcp.CallToolRequest, p UpdateFeatureBranchParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) UpdateIssue ¶
func (h *ToolHandler) UpdateIssue( ctx context.Context, req *mcp.CallToolRequest, p UpdateIssueParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) VoteDaoProposal ¶
func (h *ToolHandler) VoteDaoProposal( ctx context.Context, req *mcp.CallToolRequest, p VoteDaoProposalParams, ) (*mcp.CallToolResult, any, error)
func (*ToolHandler) WriteFile ¶
func (h *ToolHandler) WriteFile( ctx context.Context, req *mcp.CallToolRequest, p WriteFileParams, ) (*mcp.CallToolResult, any, error)
type Toolset ¶
type Toolset string
Toolset groups tools by functional area. Tools in the "core" set are always registered. Other sets can be enabled via TOOLSETS env var.
type TrustLevel ¶
type TrustLevel int
TrustLevel represents the permission tier for tool access.
const ( TrustReadOnly TrustLevel = 1 TrustLocalWrite TrustLevel = 2 TrustChainWrite TrustLevel = 3 )
func ParseTrustLevel ¶
func ParseTrustLevel(s string) TrustLevel
ParseTrustLevel converts a string to a TrustLevel. Defaults to TrustChainWrite for backward compatibility.
func (TrustLevel) String ¶
func (t TrustLevel) String() string
String returns the human-readable name of the trust level.
type UpdateBountyParams ¶
type UpdateDaoMembersParams ¶
type UpdateDaoMembersParams struct {
DAO string `json:"dao,omitempty" jsonschema:"DAO name or address (alternative to group_id)"`
GroupID uint64 `json:"group_id,omitempty" jsonschema:"The cosmos group ID of the DAO"`
MemberUpdates []struct {
Address string `json:"address"`
Weight string `json:"weight"`
Metadata string `json:"metadata,omitempty"`
} `json:"member_updates" jsonschema:"List of member updates. Set weight to 0 to remove a member."`
}
type UpdateFeatureBranchParams ¶
type UpdateFeatureBranchParams struct {
RepoPath string `json:"repo_path" jsonschema:"Repository path relative to workspace (e.g. 'myrepo')"`
BranchName string `json:"branch_name"`
Files []fs.FileChange `json:"files"`
CommitMessage string `json:"commit_message"`
}
type UpdateIssueParams ¶
type UpdateIssueParams struct {
Owner string `json:"owner" jsonschema:"Repository owner (username or DAO name)"`
Name string `json:"name" jsonschema:"Repository name"`
IssueIid uint64 `json:"issue_iid" jsonschema:"Issue number (IID)"`
ToggleState bool `json:"toggle_state,omitempty" jsonschema:"Toggle issue open/closed state"`
StateComment string `json:"state_comment,omitempty" jsonschema:"Comment to add when toggling state"`
AddLabels []uint64 `json:"add_labels,omitempty" jsonschema:"Label IDs to add"`
RemoveLabels []uint64 `json:"remove_labels,omitempty" jsonschema:"Label IDs to remove"`
AddAssignees []string `json:"add_assignees,omitempty" jsonschema:"Usernames to assign"`
RemoveAssignees []string `json:"remove_assignees,omitempty" jsonschema:"Usernames to unassign"`
}
type VoteDaoProposalParams ¶
type VoteDaoProposalParams struct {
ProposalID uint64 `json:"proposal_id" jsonschema:"The unique ID of the proposal to vote on"`
Option string `json:"option" jsonschema:"Vote option: yes, no, abstain, or no_with_veto"`
Metadata string `json:"metadata,omitempty" jsonschema:"Arbitrary metadata for the vote"`
ExecTry bool `json:"exec_try,omitempty" jsonschema:"If true, try to execute proposal after voting"`
}
type WriteFileParams ¶
Source Files
¶
- approval.go
- approval_handlers.go
- audit.go
- batch_handlers.go
- bounty_handlers.go
- commit_handlers.go
- context_handlers.go
- dryrun.go
- fs_handlers.go
- git_handlers.go
- gitopia_dao_handlers.go
- gitopia_handlers.go
- handler.go
- label_handlers.go
- prompt_handlers.go
- ratelimit.go
- register.go
- release_handlers.go
- resource_handlers.go
- response.go
- tag_handlers.go
- toolsets.go
- trust.go
- workflow_handlers.go