Tool factories
This commit is contained in:
@@ -48,16 +48,9 @@ export async function reportErrorToComment({
|
||||
}
|
||||
}
|
||||
|
||||
// if no comment ID available, try using reportProgress (requires MCP context)
|
||||
// if no comment ID available, can't update comment
|
||||
if (!commentId) {
|
||||
try {
|
||||
const { reportProgress } = await import("../mcp/comment.ts");
|
||||
await reportProgress({ body: formattedError });
|
||||
return;
|
||||
} catch {
|
||||
// MCP context not available, can't create/update comment
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// update comment directly using GitHub API
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { execSync } from "node:child_process";
|
||||
import { existsSync, rmSync } from "node:fs";
|
||||
import type { MainContext } from "../main.ts";
|
||||
import type { Context } from "../main.ts";
|
||||
import { log } from "./cli.ts";
|
||||
import { $ } from "./shell.ts";
|
||||
|
||||
@@ -72,7 +72,7 @@ export type SetupGitResult = {
|
||||
* For PR events, gh pr checkout sets up proper remote tracking.
|
||||
* Returns the remote to push to (detected from branch tracking after checkout).
|
||||
*/
|
||||
export function setupGit(ctx: MainContext): SetupGitResult {
|
||||
export function setupGit(ctx: Context): SetupGitResult {
|
||||
const { githubInstallationToken, payload } = ctx;
|
||||
const repoDir = process.cwd();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user