Fix MCP discovery
This commit is contained in:
+3
-3
@@ -4,9 +4,9 @@
|
|||||||
|
|
||||||
import type { McpStdioServerConfig } from "@anthropic-ai/claude-agent-sdk";
|
import type { McpStdioServerConfig } from "@anthropic-ai/claude-agent-sdk";
|
||||||
import { fromHere } from "@ark/fs";
|
import { fromHere } from "@ark/fs";
|
||||||
|
import { ghPullfrogMcpName } from "../external.ts";
|
||||||
import type { Mode } from "../modes.ts";
|
import type { Mode } from "../modes.ts";
|
||||||
import { parseRepoContext } from "../utils/github.ts";
|
import { parseRepoContext } from "../utils/github.ts";
|
||||||
import { ghPullfrogMcpName } from "../external.ts";
|
|
||||||
|
|
||||||
export type McpName = typeof ghPullfrogMcpName;
|
export type McpName = typeof ghPullfrogMcpName;
|
||||||
|
|
||||||
@@ -16,9 +16,9 @@ export function createMcpConfigs(githubInstallationToken: string, modes: Mode[])
|
|||||||
const repoContext = parseRepoContext();
|
const repoContext = parseRepoContext();
|
||||||
const githubRepository = `${repoContext.owner}/${repoContext.name}`;
|
const githubRepository = `${repoContext.owner}/${repoContext.name}`;
|
||||||
|
|
||||||
// In production (GitHub Actions), mcp-server.js is in same directory as entry.js (where this is bundled)
|
// In production (GitHub Actions), mcp-server is in same directory as entry.js (where this is bundled)
|
||||||
// In development, server.ts is in the same directory as this file (config.ts)
|
// In development, server.ts is in the same directory as this file (config.ts)
|
||||||
const serverPath = process.env.GITHUB_ACTIONS ? fromHere("mcp-server.js") : fromHere("server.ts");
|
const serverPath = process.env.GITHUB_ACTIONS ? fromHere("mcp-server") : fromHere("server.ts");
|
||||||
|
|
||||||
return {
|
return {
|
||||||
[ghPullfrogMcpName]: {
|
[ghPullfrogMcpName]: {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { spawnSync } from "node:child_process";
|
|||||||
import { appendFileSync, existsSync } from "node:fs";
|
import { appendFileSync, existsSync } from "node:fs";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
import * as core from "@actions/core";
|
import * as core from "@actions/core";
|
||||||
|
import { table } from "table";
|
||||||
|
|
||||||
const isGitHubActions = !!process.env.GITHUB_ACTIONS;
|
const isGitHubActions = !!process.env.GITHUB_ACTIONS;
|
||||||
const isDebugEnabled = process.env.LOG_LEVEL === "debug";
|
const isDebugEnabled = process.env.LOG_LEVEL === "debug";
|
||||||
@@ -160,6 +161,43 @@ async function summaryTable(
|
|||||||
core.info(`\n${tableText}\n`);
|
core.info(`\n${tableText}\n`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print a formatted table using the table package
|
||||||
|
* Also logs to console and GitHub Actions summary
|
||||||
|
*/
|
||||||
|
async function printTable(
|
||||||
|
rows: Array<Array<{ data: string; header?: boolean } | string>>,
|
||||||
|
options?: {
|
||||||
|
title?: string;
|
||||||
|
}
|
||||||
|
): Promise<void> {
|
||||||
|
const { title } = options || {};
|
||||||
|
|
||||||
|
// Convert rows to string arrays for the table package
|
||||||
|
const tableData = rows.map((row) =>
|
||||||
|
row.map((cell) => {
|
||||||
|
if (typeof cell === "string") {
|
||||||
|
return cell;
|
||||||
|
}
|
||||||
|
return cell.data;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
const formatted = table(tableData);
|
||||||
|
|
||||||
|
if (title) {
|
||||||
|
core.info(`\n${title}`);
|
||||||
|
}
|
||||||
|
core.info(`\n${formatted}\n`);
|
||||||
|
|
||||||
|
if (isGitHubActions) {
|
||||||
|
if (title) {
|
||||||
|
core.summary.addRaw(`**${title}**\n\n`);
|
||||||
|
}
|
||||||
|
core.summary.addRaw(`\`\`\`\n${formatted}\n\`\`\`\n`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print a separator line
|
* Print a separator line
|
||||||
*/
|
*/
|
||||||
@@ -240,6 +278,11 @@ export const log = {
|
|||||||
*/
|
*/
|
||||||
summaryTable,
|
summaryTable,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print a formatted table using the table package
|
||||||
|
*/
|
||||||
|
table: printTable,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print a separator line
|
* Print a separator line
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user