section-source-note.mjs
sha256:b5f647cb9c409f563d4671fe3fc05ddea01fabfed9b41fc11cb923588e1c1baf
mirror: GitHub Phase A durable MCP OAuth (#270)
Human
minor
⚠ breaking
11 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
3 commits
sha256:b5f647cb9c409f563d4671fe3fc05ddea01fabfed9b41fc11cb923588e1c1baf
mirror: GitHub Phase A durable MCP OAuth (#270)
Human
minor
⚠
11 days ago
sha256:d8c648b20a4d53b2673c5c082ee7edfa7b2fc9b11080832da1f38807b6bf940b
fix(7C-L1b): route hosted delegation proposals through cani…
Human
minor
⚠
31 days ago
sha256:2827ba9e7632a4b141c50caf1e8f7d77abbc3515be20e7465f2bccb0ac4edf91
fix: repair endpoint now sets has_active_subscription when …
Human
minor
⚠
51 days ago