Files
feynman/extensions/research-tools/shared.ts
Advait Paliwal 7ef1ca2859 Add ASCII logo, spinner during install, all packages core, fix tests
- ASCII art logo on website hero and OAuth callback page
- Clean spinner during postinstall instead of npm noise
- pi-session-search and pi-memory moved to core (13 packages)
- pi-generative-ui is the only optional package
- Alpha Hub callback page branded with Feynman logo

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 22:33:35 -07:00

40 lines
1.1 KiB
TypeScript

import { readFileSync } from "node:fs";
import { homedir } from "node:os";
import { dirname, resolve as resolvePath } from "node:path";
import { fileURLToPath } from "node:url";
export const APP_ROOT = resolvePath(dirname(fileURLToPath(import.meta.url)), "..", "..");
export const FEYNMAN_VERSION = (() => {
try {
const pkg = JSON.parse(readFileSync(resolvePath(APP_ROOT, "package.json"), "utf8")) as { version?: string };
return pkg.version ?? "dev";
} catch {
return "dev";
}
})();
export { FEYNMAN_ASCII_LOGO as FEYNMAN_AGENT_LOGO } from "../../logo.mjs";
export const FEYNMAN_RESEARCH_TOOLS = [
"alpha_search",
"alpha_get_paper",
"alpha_ask_paper",
"alpha_annotate_paper",
"alpha_list_annotations",
"alpha_read_code",
"session_search",
"preview_file",
];
export function formatToolText(result: unknown): string {
return typeof result === "string" ? result : JSON.stringify(result, null, 2);
}
export function getFeynmanHome(): string {
const agentDir = process.env.FEYNMAN_CODING_AGENT_DIR ??
process.env.PI_CODING_AGENT_DIR ??
resolvePath(homedir(), ".feynman", "agent");
return dirname(agentDir);
}