section-source-note.mjs
sha256:65ccb454656ea5acdea0a10e559b78bcde1eb6ff753ecc2911bc99d1c3d7cadd
feat(calendar): enforce agent context tiers in retrieval AP…
Human
minor
⚠ breaking
1 day 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
2 commits
sha256:65ccb454656ea5acdea0a10e559b78bcde1eb6ff753ecc2911bc99d1c3d7cadd
feat(calendar): enforce agent context tiers in retrieval AP…
Human
minor
⚠
1 day ago
sha256:9103f98c89257ed2b01c237cea895dabb3e85ea337dccb1161c175e4422355b6
docs: accept Calendar Events v0 spec with Phase 0 security …
Human
1 day ago