diff --git a/src/cli/App.tsx b/src/cli/App.tsx index 398e1ae..fa08d81 100644 --- a/src/cli/App.tsx +++ b/src/cli/App.tsx @@ -6224,7 +6224,7 @@ export default function App({ return { submitted: true }; } - // Special handling for /memory command - opens memory viewer + // Special handling for /memory command - opens memory viewer overlay if (trimmed === "/memory") { startOverlayCommand( "memory", @@ -6236,6 +6236,44 @@ export default function App({ return { submitted: true }; } + // /palace - open Memory Palace directly in the browser (skips TUI overlay) + if (trimmed === "/palace") { + const cmd = commandRunner.start( + "/palace", + "Opening Memory Palace...", + ); + + if (!settingsManager.isMemfsEnabled(agentId)) { + cmd.finish( + "Memory Palace requires memfs. Run /memfs enable first.", + false, + ); + return { submitted: true }; + } + + const { generateAndOpenMemoryViewer } = await import( + "../web/generate-memory-viewer" + ); + generateAndOpenMemoryViewer(agentId, { + agentName: agentName ?? undefined, + }) + .then((result) => { + if (result.opened) { + cmd.finish("Opened Memory Palace in browser", true); + } else { + cmd.finish(`Open manually: ${result.filePath}`, true); + } + }) + .catch((err: unknown) => { + cmd.finish( + `Failed to open: ${err instanceof Error ? err.message : String(err)}`, + false, + ); + }); + + return { submitted: true }; + } + // Special handling for /mcp command - manage MCP servers if (msg.trim().startsWith("/mcp")) { const mcpCtx: McpCommandContext = { diff --git a/src/cli/commands/registry.ts b/src/cli/commands/registry.ts index dd6bb42..f958126 100644 --- a/src/cli/commands/registry.ts +++ b/src/cli/commands/registry.ts @@ -74,6 +74,15 @@ export const commands: Record = { return "Opening memory viewer..."; }, }, + "/palace": { + desc: "Open the Memory Palace in your browser", + order: 16, + noArgs: true, + handler: () => { + // Handled specially in App.tsx - opens browser directly + return "Opening Memory Palace..."; + }, + }, "/sleeptime": { desc: "Configure reflection reminder trigger settings", order: 15.5, @@ -94,7 +103,7 @@ export const commands: Record = { }, "/search": { desc: "Search messages across all agents (/search [query])", - order: 16, + order: 15.1, handler: () => { // Handled specially in App.tsx to show message search return "Opening message search...";