interface contacts { enum capability { read-name-only, read, add, remove, } variant request { get-names, // requires read-names-only get-all-contacts, // requires read get-contact(string), // requires read add-contact(string), // requires add // tuple add-field(tuple), // requires add remove-contact(string), // requires remove // tuple remove-field(tuple), // requires remove } variant response { get-names(list), get-all-contacts, // JSON all-contacts dict in blob get-contact, // JSON contact dict in blob add-contact, add-field, remove-contact, remove-field, err(string), // any failed request will receive this response } } world contacts-sys-v0 { import contacts; include process-v0; }