Compare commits

...

6 Commits

Author SHA1 Message Date
Shawn Morreau 1c128b293f don't allow rejecting prs 2025-11-10 16:53:31 -05:00
Shawn Morreau c08008668b Merge branch 'main' of https://github.com/pullfrog/action 2025-11-10 16:05:44 -05:00
David Blass 7ac2938570 update todos 2025-11-10 16:02:37 -05:00
Shawn Morreau 363e4ecda2 update readme 2025-11-10 15:27:16 -05:00
David Blass 13cc56944f remove some debug logging 2025-11-06 21:11:28 -05:00
David Blass 2d91473f6e debug mcp 2025-11-06 21:03:13 -05:00
9 changed files with 8135 additions and 7200 deletions
-3
View File
@@ -9,9 +9,6 @@ GitHub Action for running Claude Code and other agents via Pullfrog.
```bash ```bash
# Install dependencies # Install dependencies
pnpm install pnpm install
# Test with default prompt
npm run play # Run locally on your machine
``` ```
## Testing with play.ts ## Testing with play.ts
+1 -1
View File
@@ -67,7 +67,7 @@ export const claude: Agent = {
// Write tarball to file // Write tarball to file
const fileStream = createWriteStream(tarballPath); const fileStream = createWriteStream(tarballPath);
await pipeline(response.body as any, fileStream); await pipeline(response.body!, fileStream);
log.info(`Downloaded tarball to ${tarballPath}`); log.info(`Downloaded tarball to ${tarballPath}`);
// Extract tarball // Extract tarball
+328 -347
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
run npx cowsay "don't eat me" Review https://github.com/pullfrogai/scratch/pull/17
+7794 -6815
View File
File diff suppressed because one or more lines are too long
+3 -24
View File
@@ -2,11 +2,8 @@
* Simple MCP configuration helper for adding our minimal GitHub comment server * Simple MCP configuration helper for adding our minimal GitHub comment server
*/ */
import { existsSync, readdirSync } from "node:fs";
import { dirname } from "node:path";
import type { McpServerConfig } from "@anthropic-ai/claude-agent-sdk"; import type { McpServerConfig } from "@anthropic-ai/claude-agent-sdk";
import { fromHere } from "@ark/fs"; import { fromHere } from "@ark/fs";
import { log } from "../utils/cli.ts";
import { parseRepoContext } from "../utils/github.ts"; import { parseRepoContext } from "../utils/github.ts";
export const ghPullfrogMcpName = "gh-pullfrog"; export const ghPullfrogMcpName = "gh-pullfrog";
@@ -19,27 +16,9 @@ export function createMcpConfigs(githubInstallationToken: string): McpConfigs {
const repoContext = parseRepoContext(); const repoContext = parseRepoContext();
const githubRepository = `${repoContext.owner}/${repoContext.name}`; const githubRepository = `${repoContext.owner}/${repoContext.name}`;
const serverPath = process.env.GITHUB_ACTION_PATH // In production (GitHub Actions), mcp-server.js is in same directory as entry.js (where this is bundled)
? `${process.env.GITHUB_ACTION_PATH}/mcp-server.js` // In development, server.ts is in the same directory as this file (config.ts)
: fromHere("server.ts"); const serverPath = process.env.GITHUB_ACTIONS ? fromHere("mcp-server.js") : fromHere("server.ts");
// Debug: Log server path and check if it exists
log.info(`MCP Server Path: ${serverPath}`);
const pathExists = existsSync(serverPath);
log.info(`MCP Server Path exists: ${pathExists}`);
if (!pathExists) {
const dir = dirname(serverPath);
log.info(`Directory: ${dir}`);
try {
const files = readdirSync(dir);
log.info(`Files in directory: ${files.join(", ")}`);
} catch (error) {
log.warning(
`Failed to read directory: ${error instanceof Error ? error.message : String(error)}`
);
}
}
return { return {
[ghPullfrogMcpName]: { [ghPullfrogMcpName]: {
+2 -5
View File
@@ -4,9 +4,6 @@ import { contextualize, tool } from "./shared.ts";
export const Review = type({ export const Review = type({
pull_number: type.number.describe("The pull request number to review"), pull_number: type.number.describe("The pull request number to review"),
event: type
.enumerated("APPROVE", "REQUEST_CHANGES", "COMMENT")
.describe("'APPROVE', 'REQUEST_CHANGES', or 'COMMENT' (the review action)"),
body: type.string body: type.string
.describe( .describe(
"Brief summary or general feedback that doesn't apply to specific code locations. Keep it concise - most feedback should be in the 'comments' array." "Brief summary or general feedback that doesn't apply to specific code locations. Keep it concise - most feedback should be in the 'comments' array."
@@ -45,7 +42,7 @@ export const ReviewTool = tool({
"IMPORTANT: Use 'comments' array for ALL specific code issues at the line-level. " + "IMPORTANT: Use 'comments' array for ALL specific code issues at the line-level. " +
"Only use 'body' for a brief summary or feedback that doesn't apply to a specific location.", "Only use 'body' for a brief summary or feedback that doesn't apply to a specific location.",
parameters: Review, parameters: Review,
execute: contextualize(async ({ pull_number, event, body, commit_id, comments = [] }, ctx) => { execute: contextualize(async ({ pull_number, body, commit_id, comments = [] }, ctx) => {
// Get the PR to determine the head commit if commit_id not provided // Get the PR to determine the head commit if commit_id not provided
const pr = await ctx.octokit.rest.pulls.get({ const pr = await ctx.octokit.rest.pulls.get({
owner: ctx.owner, owner: ctx.owner,
@@ -58,7 +55,7 @@ export const ReviewTool = tool({
owner: ctx.owner, owner: ctx.owner,
repo: ctx.name, repo: ctx.name,
pull_number, pull_number,
event, event: "COMMENT",
}; };
if (body) params.body = body; if (body) params.body = body;
if (commit_id) { if (commit_id) {
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@pullfrog/action", "name": "@pullfrog/action",
"version": "0.0.86", "version": "0.0.88",
"type": "module", "type": "module",
"files": [ "files": [
"index.js", "index.js",
+5 -3
View File
@@ -1,8 +1,10 @@
[x] add modes to prompt [x] add modes to prompt
[x] progressively update comment [x] progressively update comment
[] don't allow rejecting prs [x] don't allow rejecting prs
[] fix pnpm caching [x] fix pnpm caching
[] try to avoid claude narrating the initial comment
[] fix prompt to avoid narration like "I just read all tools from MCP server" [] fix prompt to avoid narration like "I just read all tools from MCP server"
[] investigate including terminal output from bash commands as collapsed groups [] investigate including terminal output from bash commands as collapsed groups
[] avoid exposing env [] avoid exposing env
[] test initialization trade offs for pullfrog.yml
[] try to find heavy claude code user
[] investigate repo config file?