Merge branch 'main' into feat__github-issue-tools

This commit is contained in:
Justin Spahr-Summers
2024-12-03 07:20:25 -06:00
committed by GitHub
31 changed files with 1626 additions and 1496 deletions

View File

@@ -639,7 +639,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
case "fork_repository": {
const args = ForkRepositorySchema.parse(request.params.arguments);
const fork = await forkRepository(args.owner, args.repo, args.organization);
return { toolResult: fork };
return { content: [{ type: "text", text: JSON.stringify(fork, null, 2) }] };
}
case "create_branch": {
@@ -672,25 +672,25 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
sha
});
return { toolResult: branch };
return { content: [{ type: "text", text: JSON.stringify(branch, null, 2) }] };
}
case "search_repositories": {
const args = SearchRepositoriesSchema.parse(request.params.arguments);
const results = await searchRepositories(args.query, args.page, args.perPage);
return { toolResult: results };
return { content: [{ type: "text", text: JSON.stringify(results, null, 2) }] };
}
case "create_repository": {
const args = CreateRepositorySchema.parse(request.params.arguments);
const repository = await createRepository(args);
return { toolResult: repository };
return { content: [{ type: "text", text: JSON.stringify(repository, null, 2) }] };
}
case "get_file_contents": {
const args = GetFileContentsSchema.parse(request.params.arguments);
const contents = await getFileContents(args.owner, args.repo, args.path, args.branch);
return { toolResult: contents };
return { content: [{ type: "text", text: JSON.stringify(contents, null, 2) }] };
}
case "create_or_update_file": {
@@ -704,7 +704,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
args.branch,
args.sha
);
return { toolResult: result };
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
}
case "push_files": {
@@ -716,21 +716,21 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
args.files,
args.message
);
return { toolResult: result };
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
}
case "create_issue": {
const args = CreateIssueSchema.parse(request.params.arguments);
const { owner, repo, ...options } = args;
const issue = await createIssue(owner, repo, options);
return { toolResult: issue };
return { content: [{ type: "text", text: JSON.stringify(issue, null, 2) }] };
}
case "create_pull_request": {
const args = CreatePullRequestSchema.parse(request.params.arguments);
const { owner, repo, ...options } = args;
const pullRequest = await createPullRequest(owner, repo, options);
return { toolResult: pullRequest };
return { content: [{ type: "text", text: JSON.stringify(pullRequest, null, 2) }] };
}
case "list_issues": {