Skip to content

Add markdown embed resolver and read-only mode#4

Open
orthagonal wants to merge 4 commits into
primaryfrom
refs
Open

Add markdown embed resolver and read-only mode#4
orthagonal wants to merge 4 commits into
primaryfrom
refs

Conversation

@orthagonal

Copy link
Copy Markdown
Collaborator

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant