module

Smith::Mentions

@path in a prompt pulls the file into the first request.

Without it the model spends a full provider roundtrip on read_file to reach a path the user already named โ€” and guesses at paths when it gets them wrong. The @path stays in the text so the sentence still reads; the content is appended below it.

Kept out of Skills::Catalog on purpose: expanding skills and reading files are different jobs, and expand_prompt is already dense enough.

Constants

DEFAULT_MAX_LINES = 2000
DEFAULT_MAX_TOTAL_BYTES = 256 * 1024
PATTERN = /(^|\s)@(?:"([^"]+)"|([^\s]+))/m

@ only counts at the start of a word, which is what keeps foo@bar.com from being read as a mention. Either a quoted path โ€” for spaces โ€” or a run of non-whitespace.

SNIFF_BYTES = 1024

How much of a file to look at when deciding whether it is text.

TRAILING_PUNCTUATION = ".,;:!?)]}"

A path is rarely the last thing in a sentence, so trailing sentence punctuation is not part of it. A trailing slash is: it is what marks a directory listing.

Class methods

expand(text : String, project_dir : String, settings : Settings = Settings.new) : Result
Source

Nested types