import { getLogs } from "@plugos/plugos-syscall/sandbox"; import { getText, hidePanel, showPanel, } from "@silverbulletmd/plugos-silverbullet-syscall/editor"; import { parseMarkdown } from "@silverbulletmd/plugos-silverbullet-syscall/markdown"; import { getServerLogs } from "@silverbulletmd/plugos-silverbullet-syscall/sandbox"; export async function parsePageCommand() { console.log( "AST", JSON.stringify(await parseMarkdown(await getText()), null, 2) ); } export async function showLogsCommand() { let clientLogs = await getLogs(); let serverLogs = await getServerLogs(); await showPanel( "bhs", 1, `
${clientLogs .map((le) => `[${le.level}] ${le.message}`) .join("\n")}
${serverLogs .map((le) => `[${le.level}] ${le.message}`) .join("\n")}