use working comment
This commit is contained in:
@@ -101499,6 +101499,61 @@ var EditCommentTool = tool({
|
||||
};
|
||||
})
|
||||
});
|
||||
var workingCommentId = null;
|
||||
var WorkingComment = type({
|
||||
issueNumber: type.number.describe("the issue number to comment on"),
|
||||
intent: type("/^I'll .+$/").describe(
|
||||
"the body of the initial comment expressing your intent to handle the request. must have the form 'I'll {summary of request}'"
|
||||
)
|
||||
});
|
||||
var CreateWorkingCommentTool = tool({
|
||||
name: "create_working_comment",
|
||||
description: "Create an initial comment on a GitHub issue that will be updated as work progresses",
|
||||
parameters: WorkingComment,
|
||||
execute: contextualize(async ({ issueNumber, intent }, ctx) => {
|
||||
if (workingCommentId) {
|
||||
throw new Error("create_working_comment may not be called multiple times");
|
||||
}
|
||||
const result = await ctx.octokit.rest.issues.createComment({
|
||||
owner: ctx.owner,
|
||||
repo: ctx.name,
|
||||
issue_number: issueNumber,
|
||||
body: intent
|
||||
});
|
||||
workingCommentId = result.data.id;
|
||||
return {
|
||||
success: true,
|
||||
commentId: result.data.id,
|
||||
url: result.data.html_url,
|
||||
body: result.data.body
|
||||
};
|
||||
})
|
||||
});
|
||||
var WorkingCommentUpdate = type({
|
||||
body: type.string.describe("the new comment body content")
|
||||
});
|
||||
var UpdateWorkingCommentTool = tool({
|
||||
name: "update_working_comment",
|
||||
description: "Update a working comment on a GitHub issue",
|
||||
parameters: WorkingCommentUpdate,
|
||||
execute: contextualize(async ({ body }, ctx) => {
|
||||
if (!workingCommentId) {
|
||||
throw new Error("create_working_comment must be called before update_working_comment");
|
||||
}
|
||||
const result = await ctx.octokit.rest.issues.updateComment({
|
||||
owner: ctx.owner,
|
||||
repo: ctx.name,
|
||||
comment_id: workingCommentId,
|
||||
body
|
||||
});
|
||||
return {
|
||||
success: true,
|
||||
commentId: result.data.id,
|
||||
url: result.data.html_url,
|
||||
body: result.data.body
|
||||
};
|
||||
})
|
||||
});
|
||||
|
||||
// mcp/issue.ts
|
||||
var Issue = type({
|
||||
@@ -101685,6 +101740,8 @@ var server = new FastMCP({
|
||||
addTools(server, [
|
||||
CreateCommentTool,
|
||||
EditCommentTool,
|
||||
CreateWorkingCommentTool,
|
||||
UpdateWorkingCommentTool,
|
||||
IssueTool,
|
||||
PullRequestTool,
|
||||
ReviewTool,
|
||||
|
||||
Reference in New Issue
Block a user