continuuu
This commit is contained in:
+62
-69
@@ -47,9 +47,10 @@ export const codex = agent({
|
|||||||
// Stream events and handle them
|
// Stream events and handle them
|
||||||
let finalOutput = "";
|
let finalOutput = "";
|
||||||
for await (const event of streamedTurn.events) {
|
for await (const event of streamedTurn.events) {
|
||||||
const handler = messageHandlers[event.type as keyof typeof messageHandlers];
|
const handler = messageHandlers[event.type];
|
||||||
|
console.log(JSON.stringify(event, null, 2));
|
||||||
if (handler) {
|
if (handler) {
|
||||||
await handler(event);
|
handler(event as never);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Capture final response from agent messages
|
// Capture final response from agent messages
|
||||||
@@ -77,94 +78,86 @@ export const codex = agent({
|
|||||||
// Track command execution IDs to identify when command results come back
|
// Track command execution IDs to identify when command results come back
|
||||||
const commandExecutionIds = new Set<string>();
|
const commandExecutionIds = new Set<string>();
|
||||||
|
|
||||||
type ThreadEventHandler = (event: ThreadEvent) => void | Promise<void>;
|
type ThreadEventHandler<type extends ThreadEvent["type"]> = (
|
||||||
|
event: Extract<ThreadEvent, { type: type }>
|
||||||
|
) => void;
|
||||||
|
|
||||||
const messageHandlers: Partial<Record<ThreadEvent["type"], ThreadEventHandler>> = {
|
const messageHandlers: {
|
||||||
"thread.started": (event) => {
|
[type in ThreadEvent["type"]]: ThreadEventHandler<type>;
|
||||||
if (event.type === "thread.started") {
|
} = {
|
||||||
log.info(`Thread started: ${event.thread_id}`);
|
"thread.started": () => {
|
||||||
}
|
// No logging needed
|
||||||
},
|
},
|
||||||
"turn.started": () => {
|
"turn.started": () => {
|
||||||
log.info("Turn started");
|
// No logging needed
|
||||||
},
|
},
|
||||||
"turn.completed": async (event) => {
|
"turn.completed": async (event) => {
|
||||||
if (event.type === "turn.completed") {
|
await log.summaryTable([
|
||||||
await log.summaryTable([
|
[
|
||||||
[
|
{ data: "Input Tokens", header: true },
|
||||||
{ data: "Input Tokens", header: true },
|
{ data: "Cached Input Tokens", header: true },
|
||||||
{ data: "Cached Input Tokens", header: true },
|
{ data: "Output Tokens", header: true },
|
||||||
{ data: "Output Tokens", header: true },
|
],
|
||||||
],
|
[
|
||||||
[
|
String(event.usage.input_tokens || 0),
|
||||||
String(event.usage.input_tokens || 0),
|
String(event.usage.cached_input_tokens || 0),
|
||||||
String(event.usage.cached_input_tokens || 0),
|
String(event.usage.output_tokens || 0),
|
||||||
String(event.usage.output_tokens || 0),
|
],
|
||||||
],
|
]);
|
||||||
]);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"turn.failed": (event) => {
|
"turn.failed": (event) => {
|
||||||
if (event.type === "turn.failed") {
|
log.error(`Turn failed: ${event.error.message}`);
|
||||||
log.error(`Turn failed: ${event.error.message}`);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"item.started": (event) => {
|
"item.started": (event) => {
|
||||||
if (event.type === "item.started") {
|
const item = event.item;
|
||||||
const item = event.item;
|
if (item.type === "command_execution") {
|
||||||
if (item.type === "command_execution") {
|
log.info(`→ ${item.command}`);
|
||||||
log.info(`→ ${item.command}`);
|
commandExecutionIds.add(item.id);
|
||||||
commandExecutionIds.add(item.id);
|
} else if (item.type === "agent_message") {
|
||||||
} else if (item.type === "agent_message") {
|
// Will be handled on completion
|
||||||
// Will be handled on completion
|
} else if (item.type === "mcp_tool_call") {
|
||||||
} else if (item.type === "mcp_tool_call") {
|
log.info(`→ ${item.tool} (${item.server})`);
|
||||||
log.info(`→ ${item.tool} (${item.server})`);
|
|
||||||
} else if (item.type === "reasoning") {
|
|
||||||
const preview = item.text.length > 100 ? `${item.text.substring(0, 100)}...` : item.text;
|
|
||||||
log.info(`→ reasoning: ${preview}`);
|
|
||||||
} else {
|
|
||||||
log.info(`→ ${item.type}`);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// Reasoning items are handled on completion for better readability
|
||||||
},
|
},
|
||||||
"item.updated": (event) => {
|
"item.updated": (event) => {
|
||||||
if (event.type === "item.updated") {
|
const item = event.item;
|
||||||
const item = event.item;
|
if (item.type === "command_execution") {
|
||||||
if (item.type === "command_execution") {
|
if (item.status === "in_progress" && item.aggregated_output) {
|
||||||
if (item.status === "in_progress" && item.aggregated_output) {
|
// Command is still running, could show progress if needed
|
||||||
// Command is still running, could show progress if needed
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"item.completed": (event) => {
|
"item.completed": (event) => {
|
||||||
if (event.type === "item.completed") {
|
const item = event.item;
|
||||||
const item = event.item;
|
if (item.type === "agent_message") {
|
||||||
if (item.type === "agent_message") {
|
log.box(item.text.trim(), { title: "Codex" });
|
||||||
log.box(item.text.trim(), { title: "Codex" });
|
} else if (item.type === "command_execution") {
|
||||||
} else if (item.type === "command_execution") {
|
const isTracked = commandExecutionIds.has(item.id);
|
||||||
const isTracked = commandExecutionIds.has(item.id);
|
if (isTracked) {
|
||||||
if (isTracked) {
|
log.startGroup(`bash output`);
|
||||||
log.startGroup(`bash output`);
|
if (item.status === "failed" || (item.exit_code !== undefined && item.exit_code !== 0)) {
|
||||||
if (item.status === "failed" || (item.exit_code !== undefined && item.exit_code !== 0)) {
|
log.warning(item.aggregated_output || "Command failed");
|
||||||
log.warning(item.aggregated_output || "Command failed");
|
} else {
|
||||||
} else {
|
log.info(item.aggregated_output || "");
|
||||||
log.info(item.aggregated_output || "");
|
|
||||||
}
|
|
||||||
log.endGroup();
|
|
||||||
commandExecutionIds.delete(item.id);
|
|
||||||
}
|
|
||||||
} else if (item.type === "mcp_tool_call") {
|
|
||||||
if (item.status === "failed" && item.error) {
|
|
||||||
log.warning(`MCP tool call failed: ${item.error.message}`);
|
|
||||||
}
|
}
|
||||||
|
log.endGroup();
|
||||||
|
commandExecutionIds.delete(item.id);
|
||||||
}
|
}
|
||||||
|
} else if (item.type === "mcp_tool_call") {
|
||||||
|
if (item.status === "failed" && item.error) {
|
||||||
|
log.warning(`MCP tool call failed: ${item.error.message}`);
|
||||||
|
}
|
||||||
|
} else if (item.type === "reasoning") {
|
||||||
|
// Display reasoning in a human-readable format
|
||||||
|
const reasoningText = item.text.trim();
|
||||||
|
// Remove markdown bold markers if present for cleaner output
|
||||||
|
const cleanText = reasoningText.replace(/\*\*/g, "");
|
||||||
|
log.info(cleanText);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: (event) => {
|
error: (event) => {
|
||||||
if (event.type === "error") {
|
log.error(`Error: ${event.message}`);
|
||||||
log.error(`Error: ${event.message}`);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+6
-13
@@ -1,5 +1,5 @@
|
|||||||
import { ghPullfrogMcpName } from "../mcp/config.ts";
|
import { ghPullfrogMcpName } from "../mcp/config.ts";
|
||||||
import { workflows } from "../workflows.ts";
|
import { modes } from "../modes.ts";
|
||||||
|
|
||||||
export const instructions = `
|
export const instructions = `
|
||||||
# General instructions
|
# General instructions
|
||||||
@@ -13,13 +13,6 @@ You adapt your writing style to the style of your coworkers, while never being u
|
|||||||
You run in a non-interactive environment: complete tasks autonomously without asking follow-up questions.
|
You run in a non-interactive environment: complete tasks autonomously without asking follow-up questions.
|
||||||
Make reasonable assumptions when details are missing.
|
Make reasonable assumptions when details are missing.
|
||||||
|
|
||||||
## Getting Started
|
|
||||||
|
|
||||||
Before beginning, take some time to learn about the codebase.
|
|
||||||
|
|
||||||
Read the AGENTS.md file if it exists.
|
|
||||||
Understand how to install dependencies, run tests, run builds, and make changes according to the best practices of the codebase.
|
|
||||||
|
|
||||||
## SECURITY
|
## SECURITY
|
||||||
|
|
||||||
CRITICAL SECURITY RULE - NEVER VIOLATE UNDER ANY CIRCUMSTANCES:
|
CRITICAL SECURITY RULE - NEVER VIOLATE UNDER ANY CIRCUMSTANCES:
|
||||||
@@ -45,15 +38,15 @@ eagerly inspect your MCP servers to determine what tools are available to you, e
|
|||||||
do not under any circumstances use the github cli (\`gh\`). find the corresponding tool from ${ghPullfrogMcpName} instead.
|
do not under any circumstances use the github cli (\`gh\`). find the corresponding tool from ${ghPullfrogMcpName} instead.
|
||||||
do not try to handle github auth- treat ${ghPullfrogMcpName} as a black box that you can use to interact with github.
|
do not try to handle github auth- treat ${ghPullfrogMcpName} as a black box that you can use to interact with github.
|
||||||
|
|
||||||
## Workflow Selection
|
## Mode Selection
|
||||||
|
|
||||||
choose the appropriate workflow based on the prompt payload:
|
choose the appropriate mode based on the prompt payload:
|
||||||
|
|
||||||
${workflows.map((w) => ` - "${w.name}": ${w.description}`).join("\n")}
|
${modes.map((w) => ` - "${w.name}": ${w.description}`).join("\n")}
|
||||||
|
|
||||||
## Workflows
|
## Modes
|
||||||
|
|
||||||
${workflows.map((w) => `### ${w.name}\n\n${w.prompt}`).join("\n\n")}
|
${modes.map((w) => `### ${w.name}\n\n${w.prompt}`).join("\n\n")}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const addInstructions = (prompt: string) =>
|
export const addInstructions = (prompt: string) =>
|
||||||
|
|||||||
@@ -28177,7 +28177,7 @@ var schema = ark.schema;
|
|||||||
var define2 = ark.define;
|
var define2 = ark.define;
|
||||||
var declare = ark.declare;
|
var declare = ark.declare;
|
||||||
|
|
||||||
// ../node_modules/.pnpm/@anthropic-ai+claude-agent-sdk@0.1.37_zod@3.25.76/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs
|
// ../node_modules/.pnpm/@anthropic-ai+claude-agent-sdk@0.1.37_zod@4.1.12/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs
|
||||||
import { join as join3 } from "path";
|
import { join as join3 } from "path";
|
||||||
import { fileURLToPath } from "url";
|
import { fileURLToPath } from "url";
|
||||||
import { setMaxListeners } from "events";
|
import { setMaxListeners } from "events";
|
||||||
@@ -41109,30 +41109,32 @@ function createMcpConfigs(githubInstallationToken) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// workflows.ts
|
// modes.ts
|
||||||
var ghPullfrogMcpName2 = "gh-pullfrog";
|
var ghPullfrogMcpName2 = "gh-pullfrog";
|
||||||
var workflows = [
|
var modes = [
|
||||||
{
|
{
|
||||||
name: "Plan",
|
name: "Plan",
|
||||||
description: "Create plans, break down tasks, outline steps, analyze requirements, understand scope of work, or provide task breakdowns",
|
description: "Create plans, break down tasks, outline steps, analyze requirements, understand scope of work, or provide task breakdowns",
|
||||||
prompt: `Follow these steps:
|
prompt: `Follow these steps:
|
||||||
1. Create initial response comment using mcp__${ghPullfrogMcpName2}__create_issue_comment saying "I'll {summary of request}" and save the commentId
|
1. Before beginning, take some time to learn about the codebase. Read the AGENTS.md file if it exists. Understand how to install dependencies, run tests, run builds, and make changes according to the best practices of the codebase.
|
||||||
2. Analyze the request and break it down into clear, actionable tasks
|
2. Create initial response comment using mcp__${ghPullfrogMcpName2}__create_issue_comment saying "I'll {summary of request}" and save the commentId
|
||||||
3. Consider dependencies, potential challenges, and implementation order
|
3. Analyze the request and break it down into clear, actionable tasks
|
||||||
4. Create a structured plan with clear milestones
|
4. Consider dependencies, potential challenges, and implementation order
|
||||||
5. Update your comment using mcp__${ghPullfrogMcpName2}__edit_issue_comment with the commentId to present the plan in a clear, organized format
|
5. Create a structured plan with clear milestones
|
||||||
6. Continue updating the same comment as needed (never create additional comments - always use edit_issue_comment)`
|
6. Update your comment using mcp__${ghPullfrogMcpName2}__edit_issue_comment with the commentId to present the plan in a clear, organized format
|
||||||
|
7. Continue updating the same comment as needed (never create additional comments - always use edit_issue_comment)`
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Implement",
|
name: "Build",
|
||||||
description: "Implement, build, create, or develop code changes; make specific changes to files or features; execute a plan; or handle tasks with specific implementation details",
|
description: "Implement, build, create, or develop code changes; make specific changes to files or features; execute a plan; or handle tasks with specific implementation details",
|
||||||
prompt: `Follow these steps:
|
prompt: `Follow these steps:
|
||||||
1. Create initial response comment using mcp__${ghPullfrogMcpName2}__create_issue_comment saying "I'll {summary of request}" and save the commentId
|
1. Before beginning, take some time to learn about the codebase. Read the AGENTS.md file if it exists. Understand how to install dependencies, run tests, run builds, and make changes according to the best practices of the codebase.
|
||||||
2. Understand the requirements and any existing plan
|
2. Create initial response comment using mcp__${ghPullfrogMcpName2}__create_issue_comment saying "I'll {summary of request}" and save the commentId
|
||||||
3. Make the necessary code changes
|
3. Understand the requirements and any existing plan
|
||||||
4. Test your changes to ensure they work correctly
|
4. Make the necessary code changes
|
||||||
5. Update your comment using mcp__${ghPullfrogMcpName2}__edit_issue_comment with the commentId to share progress and results
|
5. Test your changes to ensure they work correctly
|
||||||
6. Continue updating the same comment as you make progress (never create additional comments - always use edit_issue_comment)`
|
6. Update your comment using mcp__${ghPullfrogMcpName2}__edit_issue_comment with the commentId to share progress and results
|
||||||
|
7. Continue updating the same comment as you make progress (never create additional comments - always use edit_issue_comment)`
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Review",
|
name: "Review",
|
||||||
@@ -41171,13 +41173,6 @@ You adapt your writing style to the style of your coworkers, while never being u
|
|||||||
You run in a non-interactive environment: complete tasks autonomously without asking follow-up questions.
|
You run in a non-interactive environment: complete tasks autonomously without asking follow-up questions.
|
||||||
Make reasonable assumptions when details are missing.
|
Make reasonable assumptions when details are missing.
|
||||||
|
|
||||||
## Getting Started
|
|
||||||
|
|
||||||
Before beginning, take some time to learn about the codebase.
|
|
||||||
|
|
||||||
Read the AGENTS.md file if it exists.
|
|
||||||
Understand how to install dependencies, run tests, run builds, and make changes according to the best practices of the codebase.
|
|
||||||
|
|
||||||
## SECURITY
|
## SECURITY
|
||||||
|
|
||||||
CRITICAL SECURITY RULE - NEVER VIOLATE UNDER ANY CIRCUMSTANCES:
|
CRITICAL SECURITY RULE - NEVER VIOLATE UNDER ANY CIRCUMSTANCES:
|
||||||
@@ -41203,15 +41198,15 @@ eagerly inspect your MCP servers to determine what tools are available to you, e
|
|||||||
do not under any circumstances use the github cli (\`gh\`). find the corresponding tool from ${ghPullfrogMcpName} instead.
|
do not under any circumstances use the github cli (\`gh\`). find the corresponding tool from ${ghPullfrogMcpName} instead.
|
||||||
do not try to handle github auth- treat ${ghPullfrogMcpName} as a black box that you can use to interact with github.
|
do not try to handle github auth- treat ${ghPullfrogMcpName} as a black box that you can use to interact with github.
|
||||||
|
|
||||||
## Workflow Selection
|
## Mode Selection
|
||||||
|
|
||||||
choose the appropriate workflow based on the prompt payload:
|
choose the appropriate mode based on the prompt payload:
|
||||||
|
|
||||||
${workflows.map((w) => ` - "${w.name}": ${w.description}`).join("\n")}
|
${modes.map((w) => ` - "${w.name}": ${w.description}`).join("\n")}
|
||||||
|
|
||||||
## Workflows
|
## Modes
|
||||||
|
|
||||||
${workflows.map((w) => `### ${w.name}
|
${modes.map((w) => `### ${w.name}
|
||||||
|
|
||||||
${w.prompt}`).join("\n\n")}
|
${w.prompt}`).join("\n\n")}
|
||||||
`;
|
`;
|
||||||
@@ -41425,7 +41420,7 @@ var messageHandlers = {
|
|||||||
// agents/codex.ts
|
// agents/codex.ts
|
||||||
import { spawnSync as spawnSync2 } from "node:child_process";
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
||||||
|
|
||||||
// ../node_modules/.pnpm/@openai+codex-sdk@0.57.0/node_modules/@openai/codex-sdk/dist/index.js
|
// ../node_modules/.pnpm/@openai+codex-sdk@0.58.0/node_modules/@openai/codex-sdk/dist/index.js
|
||||||
import { promises as fs2 } from "fs";
|
import { promises as fs2 } from "fs";
|
||||||
import os from "os";
|
import os from "os";
|
||||||
import path2 from "path";
|
import path2 from "path";
|
||||||
@@ -41780,8 +41775,9 @@ var codex = agent({
|
|||||||
let finalOutput = "";
|
let finalOutput = "";
|
||||||
for await (const event of streamedTurn.events) {
|
for await (const event of streamedTurn.events) {
|
||||||
const handler = messageHandlers2[event.type];
|
const handler = messageHandlers2[event.type];
|
||||||
|
console.log(JSON.stringify(event, null, 2));
|
||||||
if (handler) {
|
if (handler) {
|
||||||
await handler(event);
|
handler(event);
|
||||||
}
|
}
|
||||||
if (event.type === "item.completed" && event.item.type === "agent_message") {
|
if (event.type === "item.completed" && event.item.type === "agent_message") {
|
||||||
finalOutput = event.item.text;
|
finalOutput = event.item.text;
|
||||||
@@ -41804,89 +41800,72 @@ var codex = agent({
|
|||||||
});
|
});
|
||||||
var commandExecutionIds = /* @__PURE__ */ new Set();
|
var commandExecutionIds = /* @__PURE__ */ new Set();
|
||||||
var messageHandlers2 = {
|
var messageHandlers2 = {
|
||||||
"thread.started": (event) => {
|
"thread.started": () => {
|
||||||
if (event.type === "thread.started") {
|
|
||||||
log.info(`Thread started: ${event.thread_id}`);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"turn.started": () => {
|
"turn.started": () => {
|
||||||
log.info("Turn started");
|
|
||||||
},
|
},
|
||||||
"turn.completed": async (event) => {
|
"turn.completed": async (event) => {
|
||||||
if (event.type === "turn.completed") {
|
await log.summaryTable([
|
||||||
await log.summaryTable([
|
[
|
||||||
[
|
{ data: "Input Tokens", header: true },
|
||||||
{ data: "Input Tokens", header: true },
|
{ data: "Cached Input Tokens", header: true },
|
||||||
{ data: "Cached Input Tokens", header: true },
|
{ data: "Output Tokens", header: true }
|
||||||
{ data: "Output Tokens", header: true }
|
],
|
||||||
],
|
[
|
||||||
[
|
String(event.usage.input_tokens || 0),
|
||||||
String(event.usage.input_tokens || 0),
|
String(event.usage.cached_input_tokens || 0),
|
||||||
String(event.usage.cached_input_tokens || 0),
|
String(event.usage.output_tokens || 0)
|
||||||
String(event.usage.output_tokens || 0)
|
]
|
||||||
]
|
]);
|
||||||
]);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"turn.failed": (event) => {
|
"turn.failed": (event) => {
|
||||||
if (event.type === "turn.failed") {
|
log.error(`Turn failed: ${event.error.message}`);
|
||||||
log.error(`Turn failed: ${event.error.message}`);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"item.started": (event) => {
|
"item.started": (event) => {
|
||||||
if (event.type === "item.started") {
|
const item = event.item;
|
||||||
const item = event.item;
|
if (item.type === "command_execution") {
|
||||||
if (item.type === "command_execution") {
|
log.info(`\u2192 ${item.command}`);
|
||||||
log.info(`\u2192 ${item.command}`);
|
commandExecutionIds.add(item.id);
|
||||||
commandExecutionIds.add(item.id);
|
} else if (item.type === "agent_message") {
|
||||||
} else if (item.type === "agent_message") {
|
} else if (item.type === "mcp_tool_call") {
|
||||||
} else if (item.type === "mcp_tool_call") {
|
log.info(`\u2192 ${item.tool} (${item.server})`);
|
||||||
log.info(`\u2192 ${item.tool} (${item.server})`);
|
|
||||||
} else if (item.type === "reasoning") {
|
|
||||||
const preview = item.text.length > 100 ? `${item.text.substring(0, 100)}...` : item.text;
|
|
||||||
log.info(`\u2192 reasoning: ${preview}`);
|
|
||||||
} else {
|
|
||||||
log.info(`\u2192 ${item.type}`);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"item.updated": (event) => {
|
"item.updated": (event) => {
|
||||||
if (event.type === "item.updated") {
|
const item = event.item;
|
||||||
const item = event.item;
|
if (item.type === "command_execution") {
|
||||||
if (item.type === "command_execution") {
|
if (item.status === "in_progress" && item.aggregated_output) {
|
||||||
if (item.status === "in_progress" && item.aggregated_output) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"item.completed": (event) => {
|
"item.completed": (event) => {
|
||||||
if (event.type === "item.completed") {
|
const item = event.item;
|
||||||
const item = event.item;
|
if (item.type === "agent_message") {
|
||||||
if (item.type === "agent_message") {
|
log.box(item.text.trim(), { title: "Codex" });
|
||||||
log.box(item.text.trim(), { title: "Codex" });
|
} else if (item.type === "command_execution") {
|
||||||
} else if (item.type === "command_execution") {
|
const isTracked = commandExecutionIds.has(item.id);
|
||||||
const isTracked = commandExecutionIds.has(item.id);
|
if (isTracked) {
|
||||||
if (isTracked) {
|
log.startGroup(`bash output`);
|
||||||
log.startGroup(`bash output`);
|
if (item.status === "failed" || item.exit_code !== void 0 && item.exit_code !== 0) {
|
||||||
if (item.status === "failed" || item.exit_code !== void 0 && item.exit_code !== 0) {
|
log.warning(item.aggregated_output || "Command failed");
|
||||||
log.warning(item.aggregated_output || "Command failed");
|
} else {
|
||||||
} else {
|
log.info(item.aggregated_output || "");
|
||||||
log.info(item.aggregated_output || "");
|
|
||||||
}
|
|
||||||
log.endGroup();
|
|
||||||
commandExecutionIds.delete(item.id);
|
|
||||||
}
|
|
||||||
} else if (item.type === "mcp_tool_call") {
|
|
||||||
if (item.status === "failed" && item.error) {
|
|
||||||
log.warning(`MCP tool call failed: ${item.error.message}`);
|
|
||||||
}
|
}
|
||||||
|
log.endGroup();
|
||||||
|
commandExecutionIds.delete(item.id);
|
||||||
}
|
}
|
||||||
|
} else if (item.type === "mcp_tool_call") {
|
||||||
|
if (item.status === "failed" && item.error) {
|
||||||
|
log.warning(`MCP tool call failed: ${item.error.message}`);
|
||||||
|
}
|
||||||
|
} else if (item.type === "reasoning") {
|
||||||
|
const reasoningText = item.text.trim();
|
||||||
|
const cleanText = reasoningText.replace(/\*\*/g, "");
|
||||||
|
log.info(cleanText);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: (event) => {
|
error: (event) => {
|
||||||
if (event.type === "error") {
|
log.error(`Error: ${event.message}`);
|
||||||
log.error(`Error: ${event.message}`);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
function configureMcpServers({
|
function configureMcpServers({
|
||||||
@@ -41938,7 +41917,7 @@ var DEFAULT_REPO_SETTINGS = {
|
|||||||
webAccessLevel: "full_access",
|
webAccessLevel: "full_access",
|
||||||
webAccessAllowTrusted: false,
|
webAccessAllowTrusted: false,
|
||||||
webAccessDomains: "",
|
webAccessDomains: "",
|
||||||
workflows: []
|
modes: []
|
||||||
};
|
};
|
||||||
async function fetchRepoSettings({
|
async function fetchRepoSettings({
|
||||||
token,
|
token,
|
||||||
|
|||||||
+6765
-5909
File diff suppressed because it is too large
Load Diff
+16
-14
@@ -1,30 +1,32 @@
|
|||||||
// MCP name constant - matches action/mcp/config.ts
|
// MCP name constant - matches action/mcp/config.ts
|
||||||
const ghPullfrogMcpName = "gh-pullfrog";
|
const ghPullfrogMcpName = "gh-pullfrog";
|
||||||
|
|
||||||
export const workflows = [
|
export const modes = [
|
||||||
{
|
{
|
||||||
name: "Plan",
|
name: "Plan",
|
||||||
description:
|
description:
|
||||||
"Create plans, break down tasks, outline steps, analyze requirements, understand scope of work, or provide task breakdowns",
|
"Create plans, break down tasks, outline steps, analyze requirements, understand scope of work, or provide task breakdowns",
|
||||||
prompt: `Follow these steps:
|
prompt: `Follow these steps:
|
||||||
1. Create initial response comment using mcp__${ghPullfrogMcpName}__create_issue_comment saying "I'll {summary of request}" and save the commentId
|
1. Before beginning, take some time to learn about the codebase. Read the AGENTS.md file if it exists. Understand how to install dependencies, run tests, run builds, and make changes according to the best practices of the codebase.
|
||||||
2. Analyze the request and break it down into clear, actionable tasks
|
2. Create initial response comment using mcp__${ghPullfrogMcpName}__create_issue_comment saying "I'll {summary of request}" and save the commentId
|
||||||
3. Consider dependencies, potential challenges, and implementation order
|
3. Analyze the request and break it down into clear, actionable tasks
|
||||||
4. Create a structured plan with clear milestones
|
4. Consider dependencies, potential challenges, and implementation order
|
||||||
5. Update your comment using mcp__${ghPullfrogMcpName}__edit_issue_comment with the commentId to present the plan in a clear, organized format
|
5. Create a structured plan with clear milestones
|
||||||
6. Continue updating the same comment as needed (never create additional comments - always use edit_issue_comment)`,
|
6. Update your comment using mcp__${ghPullfrogMcpName}__edit_issue_comment with the commentId to present the plan in a clear, organized format
|
||||||
|
7. Continue updating the same comment as needed (never create additional comments - always use edit_issue_comment)`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Implement",
|
name: "Build",
|
||||||
description:
|
description:
|
||||||
"Implement, build, create, or develop code changes; make specific changes to files or features; execute a plan; or handle tasks with specific implementation details",
|
"Implement, build, create, or develop code changes; make specific changes to files or features; execute a plan; or handle tasks with specific implementation details",
|
||||||
prompt: `Follow these steps:
|
prompt: `Follow these steps:
|
||||||
1. Create initial response comment using mcp__${ghPullfrogMcpName}__create_issue_comment saying "I'll {summary of request}" and save the commentId
|
1. Before beginning, take some time to learn about the codebase. Read the AGENTS.md file if it exists. Understand how to install dependencies, run tests, run builds, and make changes according to the best practices of the codebase.
|
||||||
2. Understand the requirements and any existing plan
|
2. Create initial response comment using mcp__${ghPullfrogMcpName}__create_issue_comment saying "I'll {summary of request}" and save the commentId
|
||||||
3. Make the necessary code changes
|
3. Understand the requirements and any existing plan
|
||||||
4. Test your changes to ensure they work correctly
|
4. Make the necessary code changes
|
||||||
5. Update your comment using mcp__${ghPullfrogMcpName}__edit_issue_comment with the commentId to share progress and results
|
5. Test your changes to ensure they work correctly
|
||||||
6. Continue updating the same comment as you make progress (never create additional comments - always use edit_issue_comment)`,
|
6. Update your comment using mcp__${ghPullfrogMcpName}__edit_issue_comment with the commentId to share progress and results
|
||||||
|
7. Continue updating the same comment as you make progress (never create additional comments - always use edit_issue_comment)`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Review",
|
name: "Review",
|
||||||
+9
-7
@@ -2,17 +2,19 @@ import type { AgentName } from "../main.ts";
|
|||||||
import { log } from "./cli.ts";
|
import { log } from "./cli.ts";
|
||||||
import type { RepoContext } from "./github.ts";
|
import type { RepoContext } from "./github.ts";
|
||||||
|
|
||||||
|
export interface Mode {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
description: string;
|
||||||
|
prompt: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface RepoSettings {
|
export interface RepoSettings {
|
||||||
defaultAgent: AgentName | null;
|
defaultAgent: AgentName | null;
|
||||||
webAccessLevel: "full_access" | "limited";
|
webAccessLevel: "full_access" | "limited";
|
||||||
webAccessAllowTrusted: boolean;
|
webAccessAllowTrusted: boolean;
|
||||||
webAccessDomains: string;
|
webAccessDomains: string;
|
||||||
workflows: Array<{
|
modes: Mode[];
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
description: string;
|
|
||||||
prompt: string;
|
|
||||||
}>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const DEFAULT_REPO_SETTINGS: RepoSettings = {
|
export const DEFAULT_REPO_SETTINGS: RepoSettings = {
|
||||||
@@ -20,7 +22,7 @@ export const DEFAULT_REPO_SETTINGS: RepoSettings = {
|
|||||||
webAccessLevel: "full_access",
|
webAccessLevel: "full_access",
|
||||||
webAccessAllowTrusted: false,
|
webAccessAllowTrusted: false,
|
||||||
webAccessDomains: "",
|
webAccessDomains: "",
|
||||||
workflows: [],
|
modes: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user