INNER CODE UNIT · TypeScript

exportFromFile

Dicklesworthstone/pi_agent_rust · legacy_pi_mono_code/pi-mono/packages/coding-agent/src/core/export-html/index.ts:276

export async function exportFromFile(inputPath: string, options?: ExportOptions | string): Promise<string> {
	const opts: ExportOptions = typeof options === "string" ? { outputPath: options } : options || {};

	if (!existsSync(inputPath)) {
		throw new Error(`File not found: ${inputPath}`);
	}

	const sm = SessionManager.open(inputPath);

	const sessionData: SessionData = {
		header: sm.getHeader(),
		entries: sm.getEntries(),
		leafId: sm.getLeafId(),
		systemPrompt: undefined,
		tools: undefined,
	};

	const html = generateHtml(sessionData, opts.themeName);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…