Add markdown embed resolver and read-only mode#4
Open
orthagonal wants to merge 4 commits into
Open
Conversation
Introduce recursive markdown loading and embedded wikilink expansion, plus a read-only mode and related runtime fixes. - Add markdownStoreLoader to recursively collect .md files, provide relPathKey and readUtf8 helpers. - Implement resolveEmbeddedReferences to parse/normalize wikilinks, expand embeds with depth, and report references/missing/cycles; env flags to disable or limit depth. - Integrate embedding into FileMdSharedContextStore and FileMdPromptStore: maintain byRelPath maps, use collected files, expand embedded references on fetch, and improve logging of package-relative paths. - Add readOnlyMode utility and use it to short-circuit write/invoke operations (syncContent, subMcpProxy). - Fix runtime reload to resolve ai-agent-framework from project package and guard resetToolModuleCache call. - Add tests and example sharedContext markdown files; update tools and package lock accordingly.
Add normalizeEmbedTarget behavior to strip a trailing .md and introduce lookupStoreEntry which first resolves normalized relative-path hits (case-insensitive) before falling back to id lookup. Update FileMdSharedContextStore and FileMdPromptStore to use the new lookup. Add tests: a unit for .md stripping and an integration test to verify nested path ids and chained embeds resolve correctly.
Normalize Windows backslashes and extract nested path segments when deriving names from sourceRelPath for sharedContext and prompts. The new logic matches sharedContext|prompts/<subpath>.md and returns the captured subpath (e.g. "tests/test2"); it falls back to basename if no match. Adds a test to verify nested path IDs are produced correctly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce recursive markdown loading and embedded wikilink expansion, plus a read-only mode and related runtime fixes.