mirror of
https://github.com/rait-09/obsidian-agent-client.git
synced 2026-07-22 16:30:32 +00:00
Replace the hand-rolled regex extraction + basename index with metadataCache.getFileCache().links. The cache excludes links inside code blocks/inline code (fixing false positives like a C++ [[nodiscard]] in a code sample), separates embeds and frontmatter, and hands back already- tokenized links with positions — so the regex, #/| splitting, embed exclusion, and the per-prompt vault scan all go away. Each link now resolves to its single destination via Obsidian's own getFirstLinkpathDest (the file it would actually open), so the resolved/unresolved/ambiguous three-state collapses to resolved/ unresolved and the basename index (and its full-vault scan) is gone. Aliases come from the raw 'original' text, not displayText, which Obsidian auto-populates for section links. Selection scoping now filters by cached link position instead of re-scanning the selected substring. Sibling-block emission, ref correlation, empty-skip, slash-command suppression, and the byte-identical note bodies are all unchanged. |
||
|---|---|---|
| .. | ||
| obsidian.ts | ||