WeKnora/internal/productdocs
lyingbug 7c9088d0fe
feat(agent): let the WeKnora assistant read the bundled documentation (#4303)
* feat(agent): let the WeKnora assistant read the bundled documentation

Embeds the website-docs pages (01-07) into the server and adds
search_weknora_docs / read_weknora_doc for the built-in assistant, so it
answers how WeKnora works from the docs of the running version.

- pages split into sections with the site's VitePress anchors; Mermaid
  dropped, screenshots reduced to captions, links rewritten to public URLs
- in-memory BM25 over sections, with Han character pairs and whole
  identifiers such as OLLAMA_BASE_URL or v0.8.3
- granted to the built-in assistant by ID, like the operation tools; the
  docs are public, so no signed-in user is required
- tests check every embedded page parses and every internal link resolves

* fix(agent): read long doc sections to the end and keep docs on a broken page

- read_weknora_doc takes an offset: a section too long for one read is cut
  at a line break and returns next_offset, so leaf sections such as the
  model field reference are readable to the end instead of losing the tail.
- Reads follow the registry's output budget (capped at 8000 runes).
- Percent-encoded anchors, as a browser copies them, and http:// doc URLs
  resolve.
- productdocs.Load leaves out a page it cannot parse and reports it, so one
  broken page no longer withholds the documentation tools.
- App CI runs on changes to the embedded doc pages and the sidebar config,
  where the parse and link tests now apply.
2026-10-15 13:06:58 +08:00
..
library.go feat(agent): let the WeKnora assistant read the bundled documentation (#4303) 2026-10-15 13:06:58 +08:00
markdown.go feat(agent): let the WeKnora assistant read the bundled documentation (#4303) 2026-10-15 13:06:58 +08:00
productdocs_test.go feat(agent): let the WeKnora assistant read the bundled documentation (#4303) 2026-10-15 13:06:58 +08:00