fix pnpm play

This commit is contained in:
David Blass
2025-11-11 16:42:30 -05:00
parent e8ca1d87ef
commit 0bf456b6dc
5 changed files with 7174 additions and 8151 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
import type { McpServerConfig } from "@anthropic-ai/claude-agent-sdk";
import { workflows } from "../../lib/workflows.ts";
import { ghPullfrogMcpName } from "../mcp/config.ts";
import { workflows } from "../workflows.ts";
/**
* Result returned by agent execution
+397 -397
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -33,8 +33,8 @@ export async function main(inputs: Inputs): Promise<MainResult> {
// Fetch repo settings (agent, permissions, workflows) from API
const repoSettings = await getRepoSettings(githubInstallationToken, repoContext);
if (repoSettings.defaultAgent !== "claude")
throw new Error(`Unsupported agent: ${repoSettings.defaultAgent}`);
const agent = repoSettings.defaultAgent || "claude";
if (agent !== "claude") throw new Error(`Unsupported agent: ${agent}`);
setupGitAuth(githubInstallationToken, repoContext);
+6749 -7729
View File
File diff suppressed because one or more lines are too long
+25 -22
View File
@@ -24,7 +24,7 @@ const DEFAULT_REPO_SETTINGS: RepoSettings = {
/**
* Fetch repository settings from the Pullfrog API with fallback to defaults
* Returns agent, permissions, and workflows (excludes triggers)
* Returns null if repo doesn't exist, defaults if fetch fails
* Returns defaults if repo doesn't exist or fetch fails
*/
export async function getRepoSettings(
token: string,
@@ -32,30 +32,33 @@ export async function getRepoSettings(
): Promise<RepoSettings> {
const apiUrl = process.env.API_URL || "https://pullfrog.ai";
const response = await fetch(
`${apiUrl}/api/repo/${repoContext.owner}/${repoContext.name}/settings`,
{
method: "GET",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
}
);
if (!response.ok) {
const errorText = await response.text();
throw new Error(
`Failed to fetch repo settings: ${response.status} ${response.statusText} - ${errorText}`
try {
const response = await fetch(
`${apiUrl}/api/repo/${repoContext.owner}/${repoContext.name}/settings`,
{
method: "GET",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
}
);
}
const settings = (await response.json()) as RepoSettings | null;
if (!response.ok) {
// If API returns 404 or other error, fall back to defaults
return DEFAULT_REPO_SETTINGS;
}
// If API returns null (repo doesn't exist), return defaults
if (settings === null) {
const settings = (await response.json()) as RepoSettings | null;
// If API returns null (repo doesn't exist), return defaults
if (settings === null) {
return DEFAULT_REPO_SETTINGS;
}
return settings;
} catch {
// If fetch fails (network error, etc.), fall back to defaults
return DEFAULT_REPO_SETTINGS;
}
return settings;
}