fix pnpm play
This commit is contained in:
+1
-1
@@ -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
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
|
|||||||
+6705
-7685
File diff suppressed because one or more lines are too long
+8
-5
@@ -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,6 +32,7 @@ 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";
|
||||||
|
|
||||||
|
try {
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
`${apiUrl}/api/repo/${repoContext.owner}/${repoContext.name}/settings`,
|
`${apiUrl}/api/repo/${repoContext.owner}/${repoContext.name}/settings`,
|
||||||
{
|
{
|
||||||
@@ -44,10 +45,8 @@ export async function getRepoSettings(
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
const errorText = await response.text();
|
// If API returns 404 or other error, fall back to defaults
|
||||||
throw new Error(
|
return DEFAULT_REPO_SETTINGS;
|
||||||
`Failed to fetch repo settings: ${response.status} ${response.statusText} - ${errorText}`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const settings = (await response.json()) as RepoSettings | null;
|
const settings = (await response.json()) as RepoSettings | null;
|
||||||
@@ -58,4 +57,8 @@ export async function getRepoSettings(
|
|||||||
}
|
}
|
||||||
|
|
||||||
return settings;
|
return settings;
|
||||||
|
} catch {
|
||||||
|
// If fetch fails (network error, etc.), fall back to defaults
|
||||||
|
return DEFAULT_REPO_SETTINGS;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user