Expand description
Writing pages into the user’s own folder (the one Library::overlay_dir reads), so an agent
can keep notes that later sessions find: save a page, append to one, delete one.
Only markdown files strictly inside that folder are touched: a path must be relative, made of
plain names (letters, digits, ., _, -, no leading dot), end in .md and stay within
MAX_DEPTH folders; no part of it may be a symbolic link. A page needs title and
description frontmatter (so it lists like any other), is at most MAX_WRITE_BYTES, and is
written atomically (a temporary file in the same folder, then a rename). Each write sets an
updated: YYYY-MM-DD frontmatter line.
A path that names a built-in page (or a built-in category’s _category.md) is refused unless
the caller asks to replace it: the user’s page then hides the built-in one, as any overlay
page does. Built-in pages cannot be deleted; deleting the user’s copy brings the built-in back.
Structs§
- Written
- What a write did.
Constants§
- MAX_
WRITE_ BYTES - Largest page
saveandappendwrite.
Functions§
- append
- Add
textto the end of the user’s pagepath(it must exist:savemakes it). - check_
path - Check a page path for writing; the normalized path and its parts.
- delete
- Delete the user’s page
path. A built-in page of the same path shows again. - save
- Save
contentas the pagepathin the user’s folderdir(replacing the user’s own page of that path).libis the library the folder overlays: a built-in path is refused unlessreplace_built_in.