histoire
Version:
A fast story book powered by Vite
12 lines (11 loc) • 619 B
JavaScript
import { realpath, stat } from 'node:fs/promises';
import { resolve } from 'node:path';
import { startHistoireStdio } from '../mcp/transport/stdio.js';
/** Resolve one owned project without changing parent cwd or evaluating its config. */
export async function mcpCommand(options) {
const root = await realpath(resolve(options.root ?? process.cwd()));
if (!(await stat(root)).isDirectory())
throw new Error('Histoire MCP root must be an existing directory');
const config = options.config === undefined ? undefined : resolve(root, options.config);
return startHistoireStdio({ root, config });
}