ai: help-docs search — Help mode tools

Search the wrolpi-help markdown in-process: files are parsed on demand
and cached by mtime; title matches outrank headings outrank body.  No
database table — the corpus is dozens of small files.  Pages are read
as paged markdown.  The docker api container gets a read-only bind
mount of the help docs at the native /opt/wrolpi-help location; a
missing help directory degrades to empty results with a message.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Roland 2026-08-25 21:13:59 -06:00
parent da5f55c956
commit 0f7c0d4d71
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
5 changed files with 318 additions and 1 deletions

View file

@ -49,6 +49,12 @@ class AIZimSearchRequest:
offset: int = 0
@dataclasses.dataclass
class AIHelpSearchRequest:
search_str: Optional[str] = None
limit: int = 5
@dataclasses.dataclass
class AISearchResponse:
results: list = dataclasses.field(default_factory=list)