section-source-note.mjs
42 lines 1.5 KB
Raw
sha256:8d46372e39d2d5a54fd93a8b1c27922fe0d9b22a72197345f1d2c71701cc4ce2 feat(auth): persistent login system + C7 session introspection Human minor ⚠ breaking 16 days ago
1 /**
2 * Local note integration for SectionSource v0.
3 *
4 * This module reads one caller-authorized Markdown note through the existing
5 * vault note-read path and derives body-free section source metadata on demand.
6 * It intentionally adds no hosted transport, Hub route, search, index,
7 * persistence, summaries, Scooling runtime behavior, PageIndex, OCR, LLM calls,
8 * provider routing, snippets, or section body output.
9 */
10
11 import { buildSectionSource } from './section-source.mjs';
12 import { readNote, resolveVaultRelativePath } from './vault.mjs';
13
14 /**
15 * Read one vault note through the same local read path used by `get_note`, then
16 * return body-free section source metadata for the current note content.
17 * @param {string} vaultPath - Absolute path to the local vault root.
18 * @param {string} relativePath - Vault-relative Markdown note path.
19 * @param {{ maxInputChars?: number, maxHeadings?: number }} [options]
20 * @returns {{
21 * schema: string,
22 * path: string,
23 * title: string|null,
24 * sections: {
25 * section_id: string,
26 * heading_id: string,
27 * level: number,
28 * heading_path: string[],
29 * heading_text: string,
30 * child_section_ids: string[],
31 * body_available: boolean,
32 * body_returned: false,
33 * snippet_returned: false
34 * }[],
35 * truncated: boolean
36 * }}
37 */
38 export function readSectionSource(vaultPath, relativePath, options = {}) {
39 resolveVaultRelativePath(vaultPath, relativePath);
40 const note = readNote(vaultPath, relativePath);
41 return buildSectionSource(note, options);
42 }
File History 1 commit
sha256:8d46372e39d2d5a54fd93a8b1c27922fe0d9b22a72197345f1d2c71701cc4ce2 feat(auth): persistent login system + C7 session introspection Human minor 16 days ago