ExternalConfigs.Injector (fnord v0.9.27)

View Source

Runtime injection of Cursor auto-attached rules triggered by a file path that the model has read or written.

This is the moving part that mirrors Cursor's own "auto-attach" semantics: when a file is added to the chat context, any rule whose globs match that file should be in context too. In fnord we interpret "added to context" as "read by file_contents_tool" or "written by file_edit_tool".

Each rule-path pair fires at most once per session (gated via Services.Once). Injected messages are system-role and are stripped from the persisted conversation, just like the other coordinator scaffolding.

Summary

Functions

Consider injecting auto-attached rules matching the given file path. Safe to call in any context; returns :ok silently when no project is selected, external-configs are disabled, Once is not running, or no rule matches.

Functions

maybe_inject_for_path(file_path)

@spec maybe_inject_for_path(String.t()) :: :ok

Consider injecting auto-attached rules matching the given file path. Safe to call in any context; returns :ok silently when no project is selected, external-configs are disabled, Once is not running, or no rule matches.