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 type { McpServerConfig } from "@anthropic-ai/claude-agent-sdk";
import { workflows } from "../../lib/workflows.ts";
import { ghPullfrogMcpName } from "../mcp/config.ts"; import { ghPullfrogMcpName } from "../mcp/config.ts";
import { workflows } from "../workflows.ts";
/** /**
* Result returned by agent execution * 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 // Fetch repo settings (agent, permissions, workflows) from API
const repoSettings = await getRepoSettings(githubInstallationToken, repoContext); const repoSettings = await getRepoSettings(githubInstallationToken, repoContext);
if (repoSettings.defaultAgent !== "claude") const agent = repoSettings.defaultAgent || "claude";
throw new Error(`Unsupported agent: ${repoSettings.defaultAgent}`); if (agent !== "claude") throw new Error(`Unsupported agent: ${agent}`);
setupGitAuth(githubInstallationToken, repoContext); 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 * Fetch repository settings from the Pullfrog API with fallback to defaults
* Returns agent, permissions, and workflows (excludes triggers) * 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( export async function getRepoSettings(
token: string, token: string,
@@ -32,30 +32,33 @@ export async function getRepoSettings(
): Promise<RepoSettings> { ): Promise<RepoSettings> {
const apiUrl = process.env.API_URL || "https://pullfrog.ai"; const apiUrl = process.env.API_URL || "https://pullfrog.ai";
const response = await fetch( try {
`${apiUrl}/api/repo/${repoContext.owner}/${repoContext.name}/settings`, const response = await fetch(
{ `${apiUrl}/api/repo/${repoContext.owner}/${repoContext.name}/settings`,
method: "GET", {
headers: { method: "GET",
Authorization: `Bearer ${token}`, headers: {
"Content-Type": "application/json", 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}`
); );
}
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 const settings = (await response.json()) as RepoSettings | null;
if (settings === 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 DEFAULT_REPO_SETTINGS;
} }
return settings;
} }