pub fn add_part_to_library(
name: &str,
source_key: &str,
source_signature: &str,
document_json: &str,
) -> Result<String, JsValue>Expand description
INSERT: hand the opened sub-part document over to the library. Executes the
document once, snapshots, stores the entry, and returns the EFFECTIVE part
name (the ACOMP partName the app must reference):
- a live entry with the same
sourceKeyANDsourceSignatureis reused verbatim (no re-execution — instant re-insert, spec §2.1); - same
sourceKeybut a DIFFERENT signature gets a fresh entry under a disambiguated name (existing instances keep their version; the explicit refresh lane isrefresh_library_entry); - a requested name taken by different content is disambiguated (
name-2).