()
| 109 | } |
| 110 | |
| 111 | export async function loadVaultRoot(): Promise<string | null> { |
| 112 | const { stdout } = await execZen(["vault", "info", "--json"]); |
| 113 | const parsed = JSON.parse(String(stdout)) as unknown; |
| 114 | if (!isRecord(parsed)) return null; |
| 115 | return typeof parsed.vaultRoot === "string" && parsed.vaultRoot.trim() |
| 116 | ? parsed.vaultRoot |
| 117 | : null; |
| 118 | } |
| 119 | |
| 120 | export async function openNoteInZenNotes( |
| 121 | note: Pick<ZenNote, "path" | "title">, |
no test coverage detected