Replace the alpha-research CLI skill with direct programmatic Pi tool registrations via @companion-ai/alpha-hub/lib. Tools connect to alphaXiv's MCP server through the library and reuse the connection across calls instead of spawning a new CLI process each time. Registers: alpha_search, alpha_get_paper, alpha_ask_paper, alpha_annotate_paper, alpha_list_annotations, alpha_read_code. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
24 lines
825 B
TypeScript
24 lines
825 B
TypeScript
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
|
|
import { registerAlphaTools } from "./research-tools/alpha.js";
|
|
import { installFeynmanHeader } from "./research-tools/header.js";
|
|
import { registerHelpCommand } from "./research-tools/help.js";
|
|
import { registerInitCommand, registerOutputsCommand } from "./research-tools/project.js";
|
|
|
|
export default function researchTools(pi: ExtensionAPI): void {
|
|
const cache: { agentSummaryPromise?: Promise<{ agents: string[]; chains: string[] }> } = {};
|
|
|
|
pi.on("session_start", async (_event, ctx) => {
|
|
await installFeynmanHeader(pi, ctx, cache);
|
|
});
|
|
|
|
pi.on("session_switch", async (_event, ctx) => {
|
|
await installFeynmanHeader(pi, ctx, cache);
|
|
});
|
|
|
|
registerAlphaTools(pi);
|
|
registerHelpCommand(pi);
|
|
registerInitCommand(pi);
|
|
registerOutputsCommand(pi);
|
|
}
|