Tool factories

This commit is contained in:
Colin McDonnell
2025-12-15 23:04:20 -08:00
parent 0fced1dfa6
commit 26336d0ac2
21 changed files with 14461 additions and 15875 deletions
+2 -9
View File
@@ -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
View File
@@ -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();