diff --git a/extensions/research-tools.ts b/extensions/research-tools.ts index b4d7e43..84d351a 100644 --- a/extensions/research-tools.ts +++ b/extensions/research-tools.ts @@ -606,6 +606,64 @@ Recommended contents: `; } +type HelpCommand = { + usage: string; + description: string; +}; + +function buildFeynmanHelpSections(): Array<{ title: string; commands: HelpCommand[] }> { + return [ + { + title: "Core Research Workflows", + commands: [ + { usage: "/lit ", description: "Survey papers on a topic." }, + { usage: "/related ", description: "Map related work and justify the gap." }, + { usage: "/review ", description: "Simulate a peer review for an AI research artifact." }, + { usage: "/ablate ", description: "Design the minimum convincing ablation set." }, + { usage: "/rebuttal ", description: "Draft a rebuttal and revision matrix." }, + { usage: "/replicate ", description: "Plan or execute a replication workflow." }, + { usage: "/reading ", description: "Build a prioritized reading list." }, + { usage: "/memo ", description: "Write a source-grounded research memo." }, + { usage: "/compare ", description: "Compare sources and disagreements." }, + { usage: "/audit ", description: "Audit a paper against its codebase." }, + { usage: "/draft ", description: "Write a paper-style draft." }, + { usage: "/deepresearch ", description: "Run a source-heavy research pass." }, + { usage: "/autoresearch ", description: "Run an end-to-end idea-to-paper workflow." }, + ], + }, + { + title: "Project Memory And Tracking", + commands: [ + { usage: "/init", description: "Bootstrap AGENTS.md and session-log folders." }, + { usage: "/log", description: "Write a durable session log into notes/." }, + { usage: "/watch ", description: "Create a recurring or deferred research watch." }, + { usage: "/jobs", description: "Inspect active background work." }, + { usage: "/search", description: "Search prior indexed sessions." }, + ], + }, + { + title: "Delegation And Background Work", + commands: [ + { usage: "/agents", description: "Open the agent and chain manager." }, + { usage: "/run ", description: "Run one subagent." }, + { usage: "/chain ...", description: "Run a sequential multi-agent chain." }, + { usage: "/parallel ...", description: "Run agents in parallel." }, + { usage: "/ps", description: "Open the background process panel." }, + { usage: "/schedule-prompt", description: "Manage recurring and deferred jobs." }, + ], + }, + { + title: "Setup And Utilities", + commands: [ + { usage: "/alpha-login", description: "Sign in to alphaXiv." }, + { usage: "/alpha-status", description: "Check alphaXiv auth." }, + { usage: "/alpha-logout", description: "Clear alphaXiv auth." }, + { usage: "/preview", description: "Preview generated artifacts." }, + ], + }, + ]; +} + export default function researchTools(pi: ExtensionAPI): void { function installFeynmanHeader(ctx: ExtensionContext): void { if (!ctx.hasUI) { @@ -757,6 +815,26 @@ export default function researchTools(pi: ExtensionAPI): void { }, }); + pi.registerCommand("help", { + description: "Show grouped Feynman commands and prefill the editor with a selected command.", + handler: async (_args, ctx) => { + const sections = buildFeynmanHelpSections(); + const items = sections.flatMap((section) => [ + `--- ${section.title} ---`, + ...section.commands.map((command) => `${command.usage} — ${command.description}`), + ]); + + const selected = await ctx.ui.select("Feynman Help", items); + if (!selected || selected.startsWith("---")) { + return; + } + + const usage = selected.split(" — ")[0]; + ctx.ui.setEditorText(usage); + ctx.ui.notify(`Prefilled ${usage}`, "info"); + }, + }); + pi.registerCommand("init", { description: "Initialize AGENTS.md and session-log folders for a research project.", handler: async (_args, ctx) => { diff --git a/src/index.ts b/src/index.ts index afbb29a..fb1132e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -138,6 +138,9 @@ async function probeTerminalBackgroundHex(timeoutMs = 120): Promise((resolve) => { let settled = false; @@ -157,6 +160,9 @@ async function probeTerminalBackgroundHex(timeoutMs = 120): Promise