Let hackmd_get_note leave the body out

Merged
JS
2d ago
+74-21

Adds include_content (default true) to hackmd_get_note, so a caller can check many notes for changes or read their permissions without pulling every body into context. With note_ref and false, the body is dropped after body_hash is computed and every other field stays. HackMD still sends the whole note and the read still keeps its snapshot for a later edit, so this saves context, not requests. With local_path the flag is refused like team_path and refresh, since the sync report carries no body. This supersedes #26 by Fang-Yu Zhang, rebased onto the snapshot reads from #27, with the tool description stating the flag applies with note_ref (the cubic finding on #26).

Verified with make check (390 lib tests plus integration targets) and cargo clippy --all-targets --all-features -- -D warnings, both clean. Added tests for the default path returning the body, the schema's boolean default: true, and the exact SyncFilters message; setting the default to false or always dropping the body fails them.

Closes #25


Summary by cubic

Adds include_content (default true) to hackmd_get_note so callers can check many notes for changes or read permissions without pulling bodies into context. With note_ref and false, the body is dropped after body_hash is computed and all other fields stay; HackMD still sends the whole note, so this saves context, not requests. With local_path, the flag is refused just like team_path and refresh.

Updated the tool description, docs, error message, and added tests for the new behavior.